remove Containment::destroy()

This commit is contained in:
Marco Martin 2013-02-18 18:59:47 +01:00
parent 86d89bf634
commit d3448c01d6
3 changed files with 1 additions and 44 deletions

View File

@ -716,38 +716,11 @@ QString Containment::activity() const
return d->activityId;
}
void Containment::destroy()
{
destroy(true);
}
void Containment::showConfigurationInterface()
{
Applet::showConfigurationInterface();
}
void Containment::destroy(bool confirm)
{
if (immutability() != Mutable || Applet::d->transient) {
return;
}
if (isContainment() && confirm) {
//FIXME: should not be blocking
const QString title = i18nc("@title:window %1 is the name of the containment", "Remove %1", Containment::title());
KGuiItem remove = KStandardGuiItem::remove();
remove.setText(title);
//FIXME: make the view accessible?
if (KMessageBox::warningContinueCancel(0/*view()*/,
i18nc("%1 is the name of the containment", "Do you really want to remove this %1?", Containment::title()),
title, remove) != KMessageBox::Continue) {
return;
}
}
Applet::destroy();
}
KConfigGroup Containment::containmentActionsConfig()
{
KConfigGroup cfg;

View File

@ -399,22 +399,6 @@ Q_SIGNALS:
*/
void setFormFactor(Plasma::FormFactor formFactor);
/**
* Destroys this containment and all its applets (after a confirmation dialog);
* it will be removed nicely and deleted.
* Its configuration will also be deleted.
*/
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.
*
* @param confirm whether or not confirmation from the user should be requested
*/
void destroy(bool confirm);
/**
* @reimp
* @sa Applet::showConfigurationInterface()

View File

@ -138,7 +138,7 @@ void Corona::exportLayout(KConfigGroup &config, QList<Containment*> containments
a->d->immutability = Mutable;
}
c->destroy(false);
c->destroy();
}
//restore immutability