Commit a02797ca authored by Martin Flöser's avatar Martin Flöser
Browse files

Use existing KSharedConfig in RuleBook::save

Recently a KSharedConfig was introduced in RuleBook. It makes sense to
also use it in save and not just in load.

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent 32a715b0
......@@ -1080,20 +1080,23 @@ void RuleBook::load()
void RuleBook::save()
KConfig cfg(QStringLiteral(KWIN_NAME "rulesrc"), KConfig::NoGlobals);
QStringList groups = cfg.groupList();
if (!m_config) {
qCWarning(KWIN_CORE) << "RuleBook::save invoked without prior invokation of RuleBook::load";
QStringList groups = m_config->groupList();
for (QStringList::ConstIterator it = groups.constBegin();
it != groups.constEnd();
cfg.deleteGroup(*it);"General").writeEntry("count", m_rules.count());
m_config->group("General").writeEntry("count", m_rules.count());
int i = 1;
for (QList< Rules* >::ConstIterator it = m_rules.constBegin();
it != m_rules.constEnd();
++it) {
if ((*it)->isTemporary())
KConfigGroup cg(&cfg, QString::number(i));
KConfigGroup cg(m_config, QString::number(i));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment