From 5f7fb0c50061959dd636f9dadf6b674684cddfa8 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 6 May 2009 19:08:29 +0000 Subject: [PATCH] prevent getting called twice (fixes crash on removing panels) svn path=/trunk/KDE/kdelibs/; revision=964500 --- containment.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/containment.cpp b/containment.cpp index 5da0def67..c8abef2fe 100644 --- a/containment.cpp +++ b/containment.cpp @@ -567,12 +567,9 @@ void ContainmentPrivate::appletActions(KMenu &desktopMenu, Applet *applet, bool } QAction *closeApplet = applet->d->actions->action("remove"); - if (!closeApplet) { //unlikely but not impossible - closeApplet = new QAction(i18nc("%1 is the name of the applet", "Remove this %1", applet->name()), &desktopMenu); - closeApplet->setIcon(KIcon("edit-delete")); - QObject::connect(closeApplet, SIGNAL(triggered(bool)), applet, SLOT(destroy())); + if (closeApplet) { + desktopMenu.addAction(closeApplet); } - desktopMenu.addAction(closeApplet); } KMenu *containmentMenu = new KMenu(i18nc("%1 is the name of the containment", "%1 Options", q->name()), &desktopMenu); @@ -1611,7 +1608,7 @@ void ContainmentPrivate::requestConfiguration() void Containment::destroy(bool confirm) { - if (immutability() != Mutable) { + if (immutability() != Mutable || Applet::d->transient) { return; }