summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-11-24 17:16:28 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-11-26 00:16:20 +0100
commitc1d1c10af5a89da77a1005bcf28cde2d216bef74 (patch)
treed30041a3b63ac120f09a5a422a2714e870cab277 /src/mainwindow.cpp
parentMoving UA management code to a new UserAgentManager (diff)
downloadrekonq-c1d1c10af5a89da77a1005bcf28cde2d216bef74.tar.xz
clean up UserAgentManager code
This way we got the following gains: - UA Manager is NOT loaded until it is really used - rekonq other code does know ANYTHING about UA Manager (but the app instance) To let this really shine, we should link this directly to the webtab. Another point for moving tabs up :)
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f242439f..ff500b4a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -502,7 +502,9 @@ void MainWindow::setupActions()
// User Agent
a = new KAction(KIcon("preferences-web-browser-identification"), i18n("Browser Identification"), this);
actionCollection()->addAction(QL1S("useragent"), a);
- a->setMenu(rApp->userAgentManager()->userAgentMenu());
+ KMenu *uaMenu = new KMenu(this);
+ a->setMenu(uaMenu);
+ connect(uaMenu, SIGNAL(aboutToShow()), this, SLOT(populateUserAgentMenu()));
// Editable Page
a = new KAction(KIcon("document-edit"), i18n("Set Editable"), this);
@@ -1497,3 +1499,10 @@ void MainWindow::closeEvent(QCloseEvent *event)
kDebug() << "CLOSING WINDOW...";
KXmlGuiWindow::closeEvent(event);
}
+
+
+void MainWindow::populateUserAgentMenu()
+{
+ KMenu *uaMenu = static_cast<KMenu *>(QObject::sender());
+ rApp->userAgentManager()->populateUAMenuForTabUrl(uaMenu, currentTab());
+}