summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/services/genericunix/qgenericunixservices.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2012-06-06 15:01:59 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-08 04:47:59 +0200
commit21e0d164110a4a1ff824e4014957353765542c2d (patch)
tree9972ad9d441e58cf959bfbd1d44bce657109594a /src/platformsupport/services/genericunix/qgenericunixservices.cpp
parent168c583a783196181b7aa601d644459d7e0de92d (diff)
Remove widgets lib dependency on platformsupport.
Instead of the dependency add the one needed function as virtual to the QPlatformServices in QtGui. Change-Id: Ia4455f5ac88ec4d0480bd81635cebba62bbd8ac5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/platformsupport/services/genericunix/qgenericunixservices.cpp')
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index 34f46e4e6e..168ecf82e4 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -52,14 +52,14 @@ QT_BEGIN_NAMESPACE
enum { debug = 0 };
-static inline QGenericUnixServices::DesktopEnvironment detectDesktopEnvironment()
+static inline QByteArray detectDesktopEnvironment()
{
if (!qgetenv("KDE_FULL_SESSION").isEmpty())
- return QGenericUnixServices::DE_KDE;
+ return QByteArray("KDE");
// GNOME_DESKTOP_SESSION_ID is deprecated for some reason, but still check it
if (qgetenv("DESKTOP_SESSION") == "gnome" || !qgetenv("GNOME_DESKTOP_SESSION_ID").isEmpty())
- return QGenericUnixServices::DE_GNOME;
- return QGenericUnixServices::DE_UNKNOWN;
+ return QByteArray("GNOME");
+ return QByteArray("UNKNOWN");
}
static inline bool checkExecutable(const QString &candidate, QString *result)
@@ -68,7 +68,7 @@ static inline bool checkExecutable(const QString &candidate, QString *result)
return !result->isEmpty();
}
-static inline bool detectWebBrowser(QGenericUnixServices::DesktopEnvironment desktop,
+static inline bool detectWebBrowser(QByteArray desktop,
bool checkBrowserVariable,
QString *browser)
{
@@ -86,19 +86,15 @@ static inline bool detectWebBrowser(QGenericUnixServices::DesktopEnvironment des
return true;
}
- switch (desktop) {
- case QGenericUnixServices::DE_UNKNOWN:
- break;
- case QGenericUnixServices::DE_KDE:
+ if (desktop == QByteArray("KDE")) {
// Konqueror launcher
if (checkExecutable(QStringLiteral("kfmclient"), browser)) {
browser->append(QStringLiteral(" exec"));
return true;
}
- case QGenericUnixServices::DE_GNOME:
+ } else if (desktop == QByteArray("GNOME")) {
if (checkExecutable(QStringLiteral("gnome-open"), browser))
return true;
- break;
}
for (size_t i = 0; i < sizeof(browsers)/sizeof(char *); ++i)
@@ -122,9 +118,9 @@ static inline bool launch(const QString &launcher, const QUrl &url)
return ok;
}
-QGenericUnixServices::DesktopEnvironment QGenericUnixServices::desktopEnvironment()
+QByteArray QGenericUnixServices::desktopEnvironment() const
{
- static const DesktopEnvironment result = detectDesktopEnvironment();
+ static const QByteArray result = detectDesktopEnvironment();
return result;
}