introduce a detroy(bool confirm) for containments so that we can confirm on zoom out, but not on containment swapping; was not a pleasant surprise to have a containment instantly evaporated without this =/
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=850224
This commit is contained in:
parent
2c341a5521
commit
9a94a36afd
@ -1187,13 +1187,16 @@ void Containment::focusPreviousApplet()
|
||||
}
|
||||
|
||||
void Containment::destroy()
|
||||
{
|
||||
destroy(true);
|
||||
}
|
||||
|
||||
void Containment::destroy(bool confirm)
|
||||
{
|
||||
if (immutability() != Mutable) {
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO For desktop containment change we need to remove containment so do we need these?
|
||||
#if 0
|
||||
if (isContainment()) {
|
||||
//don't remove a desktop that's in use
|
||||
//FIXME allow removal of containments for screens that don't currently exist
|
||||
@ -1210,9 +1213,8 @@ void Containment::destroy()
|
||||
Applet::destroy();
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
Applet::destroy();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -409,6 +409,15 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
*/
|
||||
void destroy();
|
||||
|
||||
/**
|
||||
* Destroys this containment and all its applets (after a confirmation dialog);
|
||||
* it will be removed nicely and deleted.
|
||||
* Its configuration will also be deleted.
|
||||
*
|
||||
* @arg confirm whether or not confirmation from the user should be requested
|
||||
*/
|
||||
void destroy(bool confirm);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Sets the type of this containment.
|
||||
|
4
view.cpp
4
view.cpp
@ -257,11 +257,11 @@ Containment* View::swapContainment(const QString& name, const QVariantList& args
|
||||
}
|
||||
}
|
||||
|
||||
// set our containment
|
||||
// set our containment to the new one
|
||||
setContainment(c);
|
||||
|
||||
// destroy the old one
|
||||
old->destroy();
|
||||
old->destroy(false);
|
||||
|
||||
// and now save the config
|
||||
containmentConfig = c->config();
|
||||
|
Loading…
Reference in New Issue
Block a user