diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2009-07-31 21:43:28 +0200 |
---|---|---|
committer | megabigbug <megabigbug@arrakis.(none)> | 2009-07-31 21:43:28 +0200 |
commit | 8ee38c561d2fd4d19de8c916139f7c88736636c2 (patch) | |
tree | eced0b78d349ae7ad9c758661272abeec71d117f /src/application.cpp | |
parent | This commit removes rekonq KDEnetwork dependencies. (diff) | |
download | rekonq-8ee38c561d2fd4d19de8c916139f7c88736636c2.tar.xz |
Fix tab in background feature
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 44 |
1 files changed, 17 insertions, 27 deletions
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(); |