summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/services
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-02-10 17:17:36 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-17 11:44:29 +0100
commit4cf0deef73ff2f24a80622ec5f391d10c74ea6c7 (patch)
treec34fb7c1e9b9488ca42ce8d681876515194aba2d /src/platformsupport/services
parent71bad3e8180297351b143271856b4b6732169f39 (diff)
Add palette() and further hints to QtGui/QPlatformTheme.
- Move palette() from deprecated QtWidgets/QGuiPlatformPlugin to QtGui/QPlatformTheme, Make it return a const * since QPalette does not have isNull(). - Initialize QGuiApplication::palette() and QApplication::systemPalette() from it. - Do not initialize QPalette from QGuiApplication::palette() unless app_pal is non-null (default to Qt::black if it is 0). This avoids initialization order crashes/recursions in the QPA plugin. Streamline initialization function. - Remove styleName(), systemIconThemeName() and iconSearchPaths() from QGuiPlatformPlugin and re-add them as QPlatformTheme::themeHint(). - Remove styleHint() from QGuiPlatformPlugin, add it to QPlatformTheme::themeHint(). - Add UNIX themes with factory function (Generic, KDE, Gnome), taking it from Qt 4.8 code (stripping the KDE 3 code). - Implement Windows palettes. Task-number: QTBUG-24204 Change-Id: Ie27ec035df4f84c42deaffc4816b2e53ce705462 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/platformsupport/services')
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp9
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices_p.h5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index 3c10fb63f6..34f46e4e6e 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -122,9 +122,10 @@ static inline bool launch(const QString &launcher, const QUrl &url)
return ok;
}
-QGenericUnixServices::QGenericUnixServices() :
- m_desktopEnvironment(detectDesktopEnvironment())
+QGenericUnixServices::DesktopEnvironment QGenericUnixServices::desktopEnvironment()
{
+ static const DesktopEnvironment result = detectDesktopEnvironment();
+ return result;
}
bool QGenericUnixServices::openUrl(const QUrl &url)
@@ -132,7 +133,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
if (url.scheme() == QStringLiteral("mailto"))
return openDocument(url);
- if (m_webBrowser.isEmpty() && !detectWebBrowser(m_desktopEnvironment, true, &m_webBrowser)) {
+ if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) {
qWarning("%s: Unable to detect a web browser to launch '%s'", Q_FUNC_INFO, qPrintable(url.toString()));
return false;
}
@@ -141,7 +142,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
bool QGenericUnixServices::openDocument(const QUrl &url)
{
- if (m_documentLauncher.isEmpty() && !detectWebBrowser(m_desktopEnvironment, false, &m_documentLauncher)) {
+ if (m_documentLauncher.isEmpty() && !detectWebBrowser(desktopEnvironment(), false, &m_documentLauncher)) {
qWarning("%s: Unable to detect a launcher for '%s'", Q_FUNC_INFO, qPrintable(url.toString()));
return false;
}
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices_p.h b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
index 48b790a5b8..3923a45f89 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices_p.h
+++ b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
@@ -58,13 +58,14 @@ public:
DE_GNOME
};
- QGenericUnixServices();
+ QGenericUnixServices() {}
+
+ static DesktopEnvironment desktopEnvironment();
virtual bool openUrl(const QUrl &url);
virtual bool openDocument(const QUrl &url);
private:
- const DesktopEnvironment m_desktopEnvironment;
QString m_webBrowser;
QString m_documentLauncher;
};