From cf89bd58d174aaad3388287e33e9fd104e1d0f97 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 15 Feb 2008 10:35:00 +0000 Subject: [PATCH] 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 --- applet.cpp | 5 +++++ applet.h | 6 ++++++ theme.cpp | 7 +++++++ theme.h | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/applet.cpp b/applet.cpp index 4ac7bb820..3200b7c9c 100644 --- a/applet.cpp +++ b/applet.cpp @@ -334,6 +334,11 @@ Applet::~Applet() delete d; } +PackageStructure Applet::packageStructure() +{ + return PlasmoidStructure(); +} + void Applet::init() { if (d->script && !d->script->init()) { diff --git a/applet.h b/applet.h index 3adb20962..176a181ab 100644 --- a/applet.h +++ b/applet.h @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -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 diff --git a/theme.cpp b/theme.cpp index 53bd2df1c..44cf25098 100644 --- a/theme.cpp +++ b/theme.cpp @@ -31,6 +31,8 @@ #include #include +#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) { diff --git a/theme.h b/theme.h index c8c235eb3..20f5b5b81 100644 --- a/theme.h +++ b/theme.h @@ -27,6 +27,7 @@ #include #include +#include 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