avoid making a copy of the config group in the loop, and switch to a mutable iterator to avoid a const_cast (which are ugly); should make krazy happier

svn path=/trunk/KDE/kdelibs/; revision=880617
This commit is contained in:
Aaron J. Seigo 2008-11-05 23:14:47 +00:00
parent 98585afd6e
commit daf6fa87b5

View File

@ -335,7 +335,9 @@ void Containment::restoreContents(KConfigGroup &group)
} }
qSort(appletConfigs.begin(), appletConfigs.end(), appletConfigLessThan); qSort(appletConfigs.begin(), appletConfigs.end(), appletConfigLessThan);
foreach (KConfigGroup appletConfig, appletConfigs) { QMutableListIterator<KConfigGroup> it(appletConfigs);
while (it.hasNext()) {
KConfigGroup &appletConfig = it.next();
int appId = appletConfig.name().toUInt(); int appId = appletConfig.name().toUInt();
QString plugin = appletConfig.readEntry("plugin", QString()); QString plugin = appletConfig.readEntry("plugin", QString());
@ -343,9 +345,9 @@ void Containment::restoreContents(KConfigGroup &group)
continue; continue;
} }
Applet *applet = Applet *applet = d->addApplet(plugin, QVariantList(),
d->addApplet(plugin, QVariantList(), appletConfig.readEntry("geometry", QRectF()),
appletConfig.readEntry("geometry", QRectF()), appId, true); appId, true);
applet->restore(appletConfig); applet->restore(appletConfig);
} }
} }