try and be a bit more careful about creating non-existent containments due to broken config files

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=742122
This commit is contained in:
Aaron J. Seigo 2007-11-27 07:47:23 +00:00
parent 8abab3d5ac
commit fa2286925c

View File

@ -153,6 +153,11 @@ void Corona::loadApplets(const QString& configName)
foreach (const QString& group, containments.groupList()) { foreach (const QString& group, containments.groupList()) {
KConfigGroup containmentConfig(&containments, group); KConfigGroup containmentConfig(&containments, group);
if (containmentConfig.entryMap().isEmpty()) {
continue;
}
int cid = group.toUInt(); int cid = group.toUInt();
kDebug() << "got a containment in the config, trying to make a" << containmentConfig.readEntry("plugin", QString()) << "from" << group; kDebug() << "got a containment in the config, trying to make a" << containmentConfig.readEntry("plugin", QString()) << "from" << group;
Containment *c = addContainment(containmentConfig.readEntry("plugin", QString()), QVariantList(), Containment *c = addContainment(containmentConfig.readEntry("plugin", QString()), QVariantList(),
@ -265,6 +270,9 @@ void Corona::loadDefaultSetup()
//TODO: but .. *where* on the left edge? //TODO: but .. *where* on the left edge?
panel->setLocation(Plasma::LeftEdge); panel->setLocation(Plasma::LeftEdge);
*/ */
// in case something goes bad during runtime, let's at least save this to disk right away
config()->sync();
} }
Containment* Corona::containmentForScreen(int screen) const Containment* Corona::containmentForScreen(int screen) const