make it possible to get at the package structures using Theme::packageStructure() and Applet::packageStructure() without having to export the package definitions from the library itself.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=775272
This commit is contained in:
Aaron J. Seigo 2008-02-15 10:35:00 +00:00
parent 322faacbe7
commit cf89bd58d1
4 changed files with 24 additions and 0 deletions

View File

@ -334,6 +334,11 @@ Applet::~Applet()
delete d;
}
PackageStructure Applet::packageStructure()
{
return PlasmoidStructure();
}
void Applet::init()
{
if (d->script && !d->script->init()) {

View File

@ -29,6 +29,7 @@
#include <kgenericfactory.h>
#include <plasma/configxml.h>
#include <plasma/packagestructure.h>
#include <plasma/plasma.h>
#include <plasma/widgets/widget.h>
@ -100,6 +101,11 @@ class PLASMA_EXPORT Applet : public Widget
~Applet();
/**
* @return a package structure representing a Theme
*/
static PackageStructure packageStructure();
/**
* This method is called once the applet is loaded and added to a Corona.
* If the applet requires a QGraphicsScene or has an particularly intensive

View File

@ -31,6 +31,8 @@
#include <KSharedConfig>
#include <KStandardDirs>
#include "plasma/packages_p.h"
namespace Plasma
{
@ -111,6 +113,11 @@ Theme::~Theme()
delete d;
}
PackageStructure Theme::packageStructure()
{
return ThemePackageStructure();
}
void Theme::setApplication(const QString &appname)
{
if (d->app != appname) {

View File

@ -27,6 +27,7 @@
#include <KDE/KSharedConfig>
#include <plasma/plasma_export.h>
#include <plasma/packagestructure.h>
namespace Plasma
{
@ -63,6 +64,11 @@ class PLASMA_EXPORT Theme : public QObject
explicit Theme( QObject* parent = 0 );
~Theme();
/**
* @return a package structure representing a Theme
*/
static PackageStructure packageStructure();
/**
* Sets the application the theme setting is associated with. This
* allows for individual applications that use libplasma to have the