Refactor theme plugin loading.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Wed, 14 Mar 2012 12:50:14 +0000 (13:50 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 14 Mar 2012 23:50:47 +0000 (00:50 +0100)
commitf7957f39937c42aadecc6ad2b73d006559514e00
tree05dd38f103090dcc7eb5d5fc9f8f6446ebef1e6f
parentd295b9b9cfc8bde021bf07ea997d8cd0d14cffb8
Refactor theme plugin loading.

In the old implementation, the QPlatformIntegration was asked
for the theme first, so there was no way of overriding that
by a custom plugin. Also, there was a memory leak in case
the platform theme was actually created by a plugin.

QGuiApplication now asks the QPlatformIntegration for a list
of potential theme names first, tries to load them using
the plugin loader and finally invokes a factory method of
QPlatformIntegration in case that fails. The theme is now
owned by QGuiApplication.

In the XCB plugin, the environment variable DESKTOP_SESSION
is queried and appended to the list of themes, making it possible
to load plugins for other session types.

Change-Id: I1a4b4e061815bca16c65b23e591bb7563a3e44e2
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
16 files changed:
src/gui/kernel/qguiapplication.cpp
src/gui/kernel/qplatformintegration_qpa.cpp
src/gui/kernel/qplatformintegration_qpa.h
src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
src/plugins/platforms/cocoa/qcocoaintegration.h
src/plugins/platforms/cocoa/qcocoaintegration.mm
src/plugins/platforms/cocoa/qcocoatheme.h
src/plugins/platforms/cocoa/qcocoatheme.mm
src/plugins/platforms/windows/qwindowscontext.cpp
src/plugins/platforms/windows/qwindowsintegration.cpp
src/plugins/platforms/windows/qwindowsintegration.h
src/plugins/platforms/windows/qwindowstheme.cpp
src/plugins/platforms/windows/qwindowstheme.h
src/plugins/platforms/xcb/qxcbintegration.cpp
src/plugins/platforms/xcb/qxcbintegration.h