let's try defaulting to the desktop containment if we end up without one (e.g. a config file mess up)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=722678
This commit is contained in:
parent
b1273b15d2
commit
42b02fbfa5
10
corona.cpp
10
corona.cpp
@ -263,16 +263,20 @@ void Corona::clearApplets()
|
||||
|
||||
Containment* Corona::addContainment(const QString& name, const QVariantList& args, uint id, bool delayedInit)
|
||||
{
|
||||
QString pluginName = name;
|
||||
Containment* containment = 0;
|
||||
Applet* applet = 0;
|
||||
|
||||
kDebug() << "Loading" << name << args << id;
|
||||
|
||||
if (!name.isEmpty()) {
|
||||
applet = Applet::loadApplet(name, id, args);
|
||||
containment = dynamic_cast<Containment*>(applet);
|
||||
if (pluginName.isEmpty()) {
|
||||
// default to the desktop containment
|
||||
pluginName = "desktop";
|
||||
}
|
||||
|
||||
applet = Applet::loadApplet(pluginName, id, args);
|
||||
containment = dynamic_cast<Containment*>(applet);
|
||||
|
||||
if (!containment) {
|
||||
delete applet; // in case we got a non-Containment from Applet::loadApplet
|
||||
containment = new Containment;
|
||||
|
Loading…
Reference in New Issue
Block a user