From 13ae8060051f794324898f4d189946696f8d2ef6 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sun, 13 Nov 2011 00:40:29 +0000 Subject: [PATCH] Only use the Unity hack on Ubuntu. Fixes issue 2198 --- src/core/ubuntuunityhack.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/ubuntuunityhack.cpp b/src/core/ubuntuunityhack.cpp index e51275172..d5c253622 100644 --- a/src/core/ubuntuunityhack.cpp +++ b/src/core/ubuntuunityhack.cpp @@ -18,6 +18,7 @@ #include "ubuntuunityhack.h" #include "core/logging.h" +#include #include const char* UbuntuUnityHack::kGSettingsFileName = "gsettings"; @@ -27,6 +28,16 @@ const char* UbuntuUnityHack::kUnitySystrayWhitelist = "systray-whitelist"; UbuntuUnityHack::UbuntuUnityHack(QObject* parent) : QObject(parent) { + // Check if we're on Ubuntu first. + QFile lsb_release("/etc/lsb-release"); + if (lsb_release.open(QIODevice::ReadOnly)) { + QByteArray data = lsb_release.readAll(); + if (!data.contains("DISTRIB_ID=Ubuntu")) { + // It's not Ubuntu - don't do anything. + return; + } + } + // Get the systray whitelist from gsettings. If this fails we're probably // not running on a system with unity QProcess* get = new QProcess(this);