From 8ee38c561d2fd4d19de8c916139f7c88736636c2 Mon Sep 17 00:00:00 2001 From: megabigbug Date: Fri, 31 Jul 2009 21:43:28 +0200 Subject: Fix tab in background feature --- src/application.cpp | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) (limited to 'src/application.cpp') diff --git a/src/application.cpp b/src/application.cpp index 623c3034..06e67218 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -283,35 +283,25 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) // this should let rekonq to support the beautiful KDE web browsing shortcuts loadingUrl = KUriFilter::self()->filteredUri(loadingUrl); - WebView *webView; - if( type == Rekonq::CurrentTab ) - { - webView = m_mainWindow->currentTab(); - m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl()); - } - else + WebView *webView=m_mainWindow->mainView()->currentWebView(); + + switch(type) { - webView = m_mainWindow->mainView()->newTab(); - m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl()); + case Rekonq::SettingOpenTab: + webView = m_mainWindow->mainView()->newTab(!ReKonfig::openTabsBack()); + break; + case Rekonq::NewTab: + webView = m_mainWindow->mainView()->newTab(true); + break; + case Rekonq::BackgroundTab: + webView = m_mainWindow->mainView()->newTab(false); + break; + case Rekonq::CurrentTab: // nothing to do here.. just to save a warning!! + break; + }; + + m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl()); - switch(type) - { - case Rekonq::SettingOpenTab: - if (!ReKonfig::openTabsBack()) - { - m_mainWindow->mainView()->setCurrentWidget(webView); // this method does NOT take ownership of webView - } - break; - case Rekonq::NewTab: - m_mainWindow->mainView()->setCurrentWidget(webView); // this method does NOT take ownership of webView - break; - case Rekonq::BackgroundTab: // no need for focus here - break; - case Rekonq::CurrentTab: // nothing to do here.. just to save a warning!! - break; - }; - } - if (webView) { webView->setFocus(); -- cgit v1.2.1