summaryrefslogtreecommitdiff
path: root/src/webwindow/rekonqfactory.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-04-25 08:59:47 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-04-25 09:02:06 +0200
commit072490b92b33bd37672e4ac34d3b7df0705c84ae (patch)
tree493d44450ba062e80aad2048e41e8fd0ce74a91a /src/webwindow/rekonqfactory.cpp
parentChanges order of link actions for link context menu (diff)
downloadrekonq-072490b92b33bd37672e4ac34d3b7df0705c84ae.tar.xz
appmenu-qt support :)
BUG: 309148
Diffstat (limited to 'src/webwindow/rekonqfactory.cpp')
-rw-r--r--src/webwindow/rekonqfactory.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/webwindow/rekonqfactory.cpp b/src/webwindow/rekonqfactory.cpp
index 75fd0baa..03711464 100644
--- a/src/webwindow/rekonqfactory.cpp
+++ b/src/webwindow/rekonqfactory.cpp
@@ -38,6 +38,7 @@
#include <KToolBar>
#include <QFile>
+#include <QMenuBar>
#include <QString>
#include <QWidget>
@@ -177,6 +178,47 @@ QWidget *RekonqFactory::createWidget(const QString &name, QWidget *parent)
}
+ // MenuBar ----------------------------------------------------------------------
+ QDomNodeList elementMenuBarList = document.elementsByTagName(QL1S("MenuBar"));
+ if (elementMenuBarList.isEmpty())
+ {
+ kDebug() << "ELEMENT MENUBAR LIST EMPTY. RETURNING NULL";
+ return 0;
+ }
+
+ if (name == QL1S("menuBar"))
+ {
+ QDomNode node = elementMenuBarList.at(0);
+ QDomNodeList menuNodes = node.childNodes();
+
+ QMenuBar *menuBar = new QMenuBar(parent);
+ for (unsigned int i = 0; i < menuNodes.length(); ++i)
+ {
+ QDomNode node = menuNodes.at(i);
+ if (node.isComment())
+ continue;
+
+ QDomElement element = node.toElement();
+
+ if (element.attribute("deleted").toLower() == "true")
+ continue;
+
+ if (element.attribute("name") == QL1S("help"))
+ {
+ KHelpMenu *m = new KHelpMenu(parent, KCmdLineArgs::aboutData());
+ menuBar->addMenu(m->menu());
+ continue;
+ }
+
+ KMenu *m = new KMenu(parent);
+ fillMenu(m, node);
+ menuBar->addMenu(m);
+ }
+
+ menuBar->hide();
+ return menuBar;
+ }
+
kDebug() << "NO WIDGET RETURNED";
return 0;
}