From af4bbb87a353d8bd5886e29246ba7c65b24b8c34 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 12 Feb 2013 10:44:45 +0100 Subject: Properly manage MainToolBar actions by referring to its parent actions REVIEW: 108888 --- src/webwindow/maintoolbar.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/webwindow/maintoolbar.cpp b/src/webwindow/maintoolbar.cpp index ee667ec1..336b38d7 100644 --- a/src/webwindow/maintoolbar.cpp +++ b/src/webwindow/maintoolbar.cpp @@ -28,6 +28,8 @@ #include "maintoolbar.moc" +#include "webwindow.h" + #include #include #include @@ -48,24 +50,18 @@ void MainToolBar::showCustomContextMenu(QPoint p) { KMenu menu(this); - QList lac = KActionCollection::allCollections(); - - int lac_count = lac.count(); - for (int i = lac_count - 1; i >= 0; i--) + WebWindow *w = qobject_cast(parent()); + QAction *a; + a = w->actionByName("show_bookmarks_toolbar"); + if (a) { - KActionCollection *ac = lac.at(i); - - QAction *a = ac->action("show_bookmarks_toolbar"); - if (a) - { - menu.addAction(a); - } + menu.addAction(a); + } - QAction *b = ac->action("configure_main_toolbar"); - if (b) - { - menu.addAction(b); - } + a = w->actionByName("configure_main_toolbar"); + if (a) + { + menu.addAction(a); } // finally launch the menu... -- cgit v1.2.1