allow setting of config values
svn path=/trunk/KDE/kdebase/workspace/plasma/scriptengines/javascript/; revision=906374
This commit is contained in:
parent
ddc7609369
commit
3394124002
@ -140,6 +140,24 @@ void AppletInterface::setActiveConfig(const QString &name)
|
||||
m_currentConfig = name;
|
||||
}
|
||||
|
||||
void AppletInterface::writeConfig(const QString &entry, const QVariant &value)
|
||||
{
|
||||
Plasma::ConfigLoader *config = 0;
|
||||
if (m_currentConfig.isEmpty()) {
|
||||
config = applet()->configScheme();
|
||||
} else {
|
||||
config = m_configs.value(m_currentConfig, 0);
|
||||
}
|
||||
|
||||
if (config) {
|
||||
KConfigSkeletonItem *item = config->findItemByName(entry);
|
||||
if (item) {
|
||||
item->setProperty(entry);
|
||||
m_appletScriptEngine->configNeedsSaving();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QVariant AppletInterface::readConfig(const QString &entry) const
|
||||
{
|
||||
Plasma::ConfigLoader *config = 0;
|
||||
|
@ -145,6 +145,8 @@ enum QtOrientation {
|
||||
|
||||
Q_INVOKABLE QVariant readConfig(const QString &entry) const;
|
||||
|
||||
Q_INVOKABLE void writeConfig(const QString &entry, const QVariant &value);
|
||||
|
||||
//FIXME bindings
|
||||
Plasma::DataEngine *dataEngine(const QString &name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user