cache knownWidgets
This commit is contained in:
parent
b46779dcc5
commit
e806602994
@ -165,14 +165,18 @@ bool AppInterface::hasBattery() const
|
|||||||
|
|
||||||
QStringList AppInterface::knownWidgetTypes() const
|
QStringList AppInterface::knownWidgetTypes() const
|
||||||
{
|
{
|
||||||
QStringList widgets;
|
if (m_knownWidgets.isEmpty()) {
|
||||||
KPluginInfo::List infoLs = Plasma::Applet::listAppletInfo();
|
QStringList widgets;
|
||||||
|
KPluginInfo::List infoLs = Plasma::Applet::listAppletInfo();
|
||||||
|
|
||||||
foreach (const KPluginInfo &info, infoLs) {
|
foreach (const KPluginInfo &info, infoLs) {
|
||||||
widgets.append(info.pluginName());
|
widgets.append(info.pluginName());
|
||||||
|
}
|
||||||
|
|
||||||
|
const_cast<AppInterface *>(this)->m_knownWidgets = widgets;
|
||||||
}
|
}
|
||||||
|
|
||||||
return widgets;
|
return m_knownWidgets;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList AppInterface::knownActivityTypes() const
|
QStringList AppInterface::knownActivityTypes() const
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
#include "../plasmagenericshell_export.h"
|
#include "../plasmagenericshell_export.h"
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ScriptEngine *m_env;
|
ScriptEngine *m_env;
|
||||||
|
QStringList m_knownWidgets;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user