summaryrefslogtreecommitdiff
path: root/src/webwindow/maintoolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webwindow/maintoolbar.cpp')
-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...