Port toolbox loading to KPackage

This needs KPluginMetaData::isHidden() which was recently added in kcoreaddons.

Reviewed-by: Marco Martin
This commit is contained in:
Sebastian Kügler 2015-02-18 10:38:04 +01:00
parent bda055367f
commit a8edd6fd2c
2 changed files with 8 additions and 2 deletions

View File

@ -31,6 +31,7 @@ target_link_libraries(plasma_appletscript_declarative
KF5::XmlGui # KActionCollection KF5::XmlGui # KActionCollection
KF5::Plasma KF5::Plasma
KF5::PlasmaQuick KF5::PlasmaQuick
KF5::Package
) )

View File

@ -44,9 +44,11 @@
#include <plasma.h> #include <plasma.h>
#include <Plasma/ContainmentActions> #include <Plasma/ContainmentActions>
#include <Plasma/Corona> #include <Plasma/Corona>
#include <Plasma/Package>
#include <Plasma/PluginLoader> #include <Plasma/PluginLoader>
#include <KPackage/Package>
#include <KPackage/PackageLoader>
#include <kactivities/info.h> #include <kactivities/info.h>
#include "kdeclarative/configpropertymap.h" #include "kdeclarative/configpropertymap.h"
@ -102,7 +104,7 @@ void ContainmentInterface::init()
defaults = KConfigGroup(KSharedConfig::openConfig(m_containment->corona()->package().filePath("defaults")), "Panel"); defaults = KConfigGroup(KSharedConfig::openConfig(m_containment->corona()->package().filePath("defaults")), "Panel");
} }
Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage("Plasma/Generic");
if (defaults.isValid()) { if (defaults.isValid()) {
pkg.setPath(defaults.readEntry("ToolBox", "org.kde.desktoptoolbox")); pkg.setPath(defaults.readEntry("ToolBox", "org.kde.desktoptoolbox"));
@ -128,7 +130,10 @@ void ContainmentInterface::init()
} else { } else {
qWarning() << "Could not load toolbox package." << pkg.path(); qWarning() << "Could not load toolbox package." << pkg.path();
} }
} else {
qWarning() << "Toolbox not loading, toolbox package is either invalid or disabled.";
} }
} }
//set parent, both as object hierarchically and visually //set parent, both as object hierarchically and visually