From c3ff1138d5d62e7092abb9d66f7f26097014f6e8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 24 Jul 2009 02:20:44 +0200 Subject: Big Big Big Commit! Refactored loadUrl code to divide UI classes from WEB classes. We now have two loadUrl methods in the Application class to load (hopefully) every kind of (k)url.. --- src/mainwindow.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ef51e1e0..09c36263 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -177,7 +177,7 @@ void MainWindow::postLaunch() connect(m_findBar, SIGNAL(searchString(const QString &)), this, SLOT(slotFind(const QString &))); // bookmarks loading - connect(Application::bookmarkProvider(), SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); + connect(Application::bookmarkProvider(), SIGNAL(openUrl(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&))); // setting up toolbars to NOT have context menu enabled setContextMenuPolicy(Qt::DefaultContextMenu); @@ -350,7 +350,7 @@ void MainWindow::setupSidePanel() { // Setup history side panel m_sidePanel = new SidePanel(i18n("History"), this); - connect(m_sidePanel, SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); + connect(m_sidePanel, SIGNAL(openUrl(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&))); connect(m_sidePanel, SIGNAL(destroyed()), Application::instance(), SLOT(slotSaveConfiguration())); addDockWidget(Qt::LeftDockWidgetArea, m_sidePanel); @@ -367,7 +367,7 @@ void MainWindow::setupSidePanel() void MainWindow::setupHistoryMenu() { HistoryMenu *historyMenu = new HistoryMenu(this); - connect(historyMenu, SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); + connect(historyMenu, SIGNAL(openUrl(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&))); historyMenu->setTitle(i18n("&History")); // setting history menu position @@ -445,12 +445,6 @@ void MainWindow::slotUpdateBrowser() } -void MainWindow::loadUrl(const KUrl &url) -{ - m_view->loadUrl(url); -} - - void MainWindow::slotOpenLocation() { m_view->currentUrlBar()->selectAll(); @@ -725,7 +719,7 @@ void MainWindow::slotViewPageSource() void MainWindow::slotHome() { - loadUrl(KUrl(m_homePage)); + Application::instance()->loadUrl(KUrl(m_homePage)); } -- cgit v1.2.1