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