From 1b945b8aff66f87dc3d7fa3cf8d2e6260bfe753b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 3 Nov 2009 13:10:19 +0000 Subject: [PATCH] removeIconAction(0) clears the actions svn path=/trunk/KDE/kdelibs/; revision=1044330 --- widgets/iconwidget.cpp | 2 +- widgets/iconwidget.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index c550bae80..fe917c2c4 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -377,7 +377,7 @@ void IconWidget::removeIconAction(QAction *action) foreach (IconAction *iconAction, d->cornerActions) { if (found) { iconAction->setRect(d->actionRect((IconWidgetPrivate::ActionPosition)count)); - } else if (iconAction->action() == action) { + } else if (!action || iconAction->action() == action) { delete iconAction; d->cornerActions.removeAll(iconAction); } diff --git a/widgets/iconwidget.h b/widgets/iconwidget.h index c4a2a9326..672bf3518 100644 --- a/widgets/iconwidget.h +++ b/widgets/iconwidget.h @@ -173,6 +173,8 @@ public: /** * Removes a previously set iconAction. The action will be removed from the widget * but will not be deleted. + * + * @param the QAction to be removed, if 0 all actions will be removed */ void removeIconAction(QAction *action);