summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-02-12 10:44:45 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-02-12 10:44:45 +0100
commitaf4bbb87a353d8bd5886e29246ba7c65b24b8c34 (patch)
tree90ef60dfce85ef175ba7dbb4eefe2b7330e1af7a
parentOpen new tabs in the foreground. (diff)
downloadrekonq-af4bbb87a353d8bd5886e29246ba7c65b24b8c34.tar.xz
Properly manage MainToolBar actions by referring to its parent actions
REVIEW: 108888
-rw-r--r--src/webwindow/maintoolbar.cpp28
1 files 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 <KAction>
#include <KActionCollection>
#include <KMenu>
@@ -48,24 +50,18 @@ void MainToolBar::showCustomContextMenu(QPoint p)
{
KMenu menu(this);
- QList<KActionCollection *> lac = KActionCollection::allCollections();
-
- int lac_count = lac.count();
- for (int i = lac_count - 1; i >= 0; i--)
+ WebWindow *w = qobject_cast<WebWindow *>(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...