allow setting of config values

svn path=/trunk/KDE/kdebase/workspace/plasma/scriptengines/javascript/; revision=906374
This commit is contained in:
Aaron J. Seigo 2009-01-06 03:04:31 +00:00
parent ddc7609369
commit 3394124002
2 changed files with 20 additions and 0 deletions

View File

@ -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;

View File

@ -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);