diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-01-06 12:18:40 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-02-08 10:40:33 +0000 |
commit | 4fb7eb0da74798205f5cac693c921065492fa33e (patch) | |
tree | 2082182e4b640ef9233d1bd9108caccd30a5edb7 /src/gui/kernel/qplatformthemefactory.cpp | |
parent | 21861e6fd1fcd1e4642f3d4c06ee7181d2c81778 (diff) |
Drop most "#ifndef QT_NO_LIBRARY"
As we can load plugins without QLibrary now, we don't have to #ifdef
out the code that does so anymore.
Change-Id: I1dc20216830a882dbd5a1b431183407e6b19c837
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/kernel/qplatformthemefactory.cpp')
-rw-r--r-- | src/gui/kernel/qplatformthemefactory.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp index dd000c1571..40ba844e57 100644 --- a/src/gui/kernel/qplatformthemefactory.cpp +++ b/src/gui/kernel/qplatformthemefactory.cpp @@ -48,31 +48,29 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QPlatformThemeFactoryInterface_iid, QLatin1String("/platformthemes"), Qt::CaseInsensitive)) + +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, (QPlatformThemeFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) #endif QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath) { -#ifndef QT_NO_LIBRARY QStringList paramList = key.split(QLatin1Char(':')); const QString platform = paramList.takeFirst().toLower(); - +#ifndef QT_NO_LIBRARY // Try loading the plugin from platformPluginPath first: if (!platformPluginPath.isEmpty()) { QCoreApplication::addLibraryPath(platformPluginPath); if (QPlatformTheme *ret = qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(directLoader(), platform, paramList)) return ret; } - return qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList); #else - Q_UNUSED(key); Q_UNUSED(platformPluginPath); - return 0; #endif + return qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList); } /*! @@ -83,9 +81,9 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString */ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath) { -#ifndef QT_NO_LIBRARY QStringList list; +#ifndef QT_NO_LIBRARY if (!platformPluginPath.isEmpty()) { QCoreApplication::addLibraryPath(platformPluginPath); list += directLoader()->keyMap().values(); @@ -98,12 +96,11 @@ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath) (*it).append(postFix); } } - list += loader()->keyMap().values(); - return list; #else Q_UNUSED(platformPluginPath); - return QStringList(); #endif + list += loader()->keyMap().values(); + return list; } QT_END_NAMESPACE |