support the standard package types

svn path=/trunk/KDE/kdelibs/; revision=922898
This commit is contained in:
Aaron J. Seigo 2009-02-07 18:48:11 +00:00
parent 3c31418f84
commit b59302b92f
2 changed files with 20 additions and 0 deletions

View File

@ -33,6 +33,8 @@
#include <kio/job.h>
#include "package.h"
#include "private/packages_p.h"
#include "theme.h"
namespace Plasma
{
@ -120,6 +122,21 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
return structure;
}
if (packageFormat == "plasmoid") {
structure = defaultPackageStructure(AppletComponent);
} else if (packageFormat == "dataengine") {
structure = defaultPackageStructure(DataEngineComponent);
} else if (packageFormat == "runner") {
structure = defaultPackageStructure(RunnerComponent);
} else if (packageFormat == "theme") {
structure = Theme::packageStructure();
}
if (structure) {
PackageStructurePrivate::structures[packageFormat] = structure;
return structure;
}
// first we check for plugins in sycoca
QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(packageFormat);
KService::List offers =

View File

@ -21,6 +21,7 @@
#define LIBS_PLASMA_PACKAGES_P_H
#include <plasma/packagestructure.h>
#include "plasma.h"
namespace Plasma
{
@ -43,6 +44,8 @@ public:
explicit ThemePackage(QObject *parent = 0);
};
PackageStructure::Ptr defaultPackageStructure(ComponentType type);
} // namespace Plasma
#endif // LIBS_PLASMA_PACKAGES_P_H