remove PlasmaKPackageLoader

use a package of type KPackage/GenericQML for the toolbox instead

Change-Id: I5e559535338f093b3cd3734ef9c3906bb20cf001
This commit is contained in:
Marco Martin 2015-02-20 18:08:48 +01:00
parent 2bbb9dda7f
commit e2e7cb1cab
5 changed files with 2 additions and 109 deletions

View File

@ -67,7 +67,6 @@ set(Plasma_LIB_SRCS
package.cpp package.cpp
packagestructure.cpp packagestructure.cpp
private/packages.cpp private/packages.cpp
private/plasmakpackageloader_p.cpp
#graphics #graphics
framesvg.cpp framesvg.cpp

View File

@ -44,7 +44,6 @@
#include "private/storage_p.h" #include "private/storage_p.h"
#include "private/package_p.h" #include "private/package_p.h"
#include "private/packagestructure_p.h" #include "private/packagestructure_p.h"
#include "private/plasmakpackageloader_p.h"
namespace Plasma namespace Plasma
{ {
@ -121,7 +120,6 @@ QString PluginLoaderPrivate::parentAppConstraint(const QString &parentApp)
PluginLoader::PluginLoader() PluginLoader::PluginLoader()
: d(new PluginLoaderPrivate) : d(new PluginLoaderPrivate)
{ {
KPackage::PackageLoader::self()->setPackageLoader(new Plasma::KPackageLoader);
} }
PluginLoader::~PluginLoader() PluginLoader::~PluginLoader()

View File

@ -1,62 +0,0 @@
/*
* Copyright 2015 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "plasmakpackageloader_p.h"
#include "packages_p.h"
namespace Plasma
{
KPackageLoader::KPackageLoader()
: KPackage::PackageLoader()
{
}
KPackageLoader::~KPackageLoader()
{
}
KPackage::Package KPackageLoader::internalLoadPackage(const QString &packageFormat)
{
KPackage::PackageStructure *structure = 0;
if (packageFormat.startsWith("Plasma")) {
if (packageFormat.endsWith("/Applet")) {
structure = new PlasmoidPackage();
} else if (packageFormat.endsWith("/DataEngine")) {
structure = new DataEnginePackage();
} else if (packageFormat.endsWith("/Theme")) {
structure = new ThemePackage();
} else if (packageFormat.endsWith("/ContainmentActions")) {
structure = new ContainmentActionsPackage();
} else if (packageFormat.endsWith("/Generic")) {
structure = new GenericPackage();
}
if (structure) {
return KPackage::Package(structure);
}
}
return KPackage::Package();
}
}

View File

@ -1,43 +0,0 @@
/*
* Copyright 2015 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef PLASMA_PACKAGELOADER_P_H
#define PLASMA_PACKAGELOADER_P_H
#include <kpackage/package.h>
#include <kpackage/packageloader.h>
namespace Plasma
{
class KPackageLoader : public KPackage::PackageLoader
{
public:
KPackageLoader();
~KPackageLoader();
protected:
KPackage::Package internalLoadPackage(const QString &packageFormat);
};
}
#endif

View File

@ -104,7 +104,8 @@ 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");
} }
KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage("Plasma/Generic"); KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage("KPackage/GenericQML");
pkg.setDefaultPackageRoot("plasma/packages/");
if (defaults.isValid()) { if (defaults.isValid()) {
pkg.setPath(defaults.readEntry("ToolBox", "org.kde.desktoptoolbox")); pkg.setPath(defaults.readEntry("ToolBox", "org.kde.desktoptoolbox"));