version read only property
svn path=/trunk/KDE/kdebase/workspace/; revision=1119867
This commit is contained in:
parent
ae70c2fce5
commit
1d60579972
20
applet.cpp
20
applet.cpp
@ -22,6 +22,9 @@
|
||||
#include <QAction>
|
||||
#include <QGraphicsLinearLayout>
|
||||
|
||||
#include <KService>
|
||||
#include <KServiceTypeTrader>
|
||||
|
||||
#include <Plasma/Applet>
|
||||
#include <Plasma/Containment>
|
||||
#include <Plasma/Corona>
|
||||
@ -190,6 +193,23 @@ void Applet::reloadConfig()
|
||||
}
|
||||
}
|
||||
|
||||
QString Applet::version() const
|
||||
{
|
||||
Plasma::Applet *app = applet();
|
||||
if (!app) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString type = app->pluginName();
|
||||
KService::List services = KServiceTypeTrader::self()->query("Plasma/Applet", "[X-KDE-PluginInfo-Name] == '" + type + "'");
|
||||
if (services.isEmpty()) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
KPluginInfo info(services.first());
|
||||
return info.version();
|
||||
}
|
||||
|
||||
Plasma::Applet *Applet::applet() const
|
||||
{
|
||||
return 0;
|
||||
|
2
applet.h
2
applet.h
@ -52,6 +52,8 @@ public:
|
||||
void setCurrentGlobalConfigGroup(const QStringList &groupNames);
|
||||
QStringList currentGlobalConfigGroup() const;
|
||||
|
||||
QString version() const;
|
||||
|
||||
virtual Plasma::Applet *applet() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
|
@ -39,6 +39,7 @@ class PanelView;
|
||||
class PLASMAGENERICSHELL_EXPORT Containment : public Applet
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString version READ version)
|
||||
Q_PROPERTY(QStringList configKeys READ configKeys)
|
||||
Q_PROPERTY(QStringList configGroups READ configGroups)
|
||||
Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys)
|
||||
|
1
widget.h
1
widget.h
@ -35,6 +35,7 @@ class PLASMAGENERICSHELL_EXPORT Widget : public Applet
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString type READ type)
|
||||
Q_PROPERTY(QString version READ version)
|
||||
Q_PROPERTY(int id READ id)
|
||||
Q_PROPERTY(QStringList configKeys READ configKeys)
|
||||
Q_PROPERTY(QStringList configGroups READ configGroups)
|
||||
|
Loading…
Reference in New Issue
Block a user