From d266a9594bdd4d48464d60faf461f0eb5071fb3d Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 8 Aug 2014 11:29:23 +0200 Subject: [PATCH] valid package internalload even if just structure consider a loaded package valid even if !isvalid() but does have some file that indicates it has a valid packagestructure. for how packages are loaded now, a package is never valid at first if has a required file: because the path gets set only after the package is loaded this fixes wallpaper loading --- src/plasma/pluginloader.cpp | 2 +- src/scriptengines/qml/plasmoid/wallpaperinterface.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp index 20f696fa8..bb712ed19 100644 --- a/src/plasma/pluginloader.cpp +++ b/src/plasma/pluginloader.cpp @@ -399,7 +399,7 @@ Package PluginLoader::loadPackage(const QString &packageFormat, const QString &s { if (!d->isDefaultLoader) { Package p = internalLoadPackage(packageFormat, specialization); - if (p.isValid()) { + if (p.isValid() || !p.files().isEmpty()) { return p; } } diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp index 844df0cdb..1fc2ab523 100644 --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp @@ -127,11 +127,11 @@ void WallpaperInterface::syncWallpaperPackage() m_actions->clear(); m_pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Wallpaper"); + m_pkg.setPath(m_wallpaperPlugin); if (!m_pkg.isValid()) { qWarning() << "Error loading the wallpaper, no valid package loaded"; return; } - m_pkg.setPath(m_wallpaperPlugin); if (m_configLoader) m_configLoader->deleteLater(); if (m_configuration) m_configuration->deleteLater();