summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-24 10:32:27 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-24 10:32:27 +0200
commit8133bde2b48b8a9881812e9d04e58ae41697698f (patch)
treee1c36a2fd06ce8068212b13ca51f3658c875e680 /src/application.cpp
parentrekonq 0.1.10 with last news. (diff)
downloadrekonq-8133bde2b48b8a9881812e9d04e58ae41697698f.tar.xz
Trivial fix. Yesterday was late night ;)
This patch lets rekonq to load url in.. the current page instead of loading infinite new tabs... :)
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/src/application.cpp b/src/application.cpp
index e7ea9f23..8581c56d 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -97,12 +97,13 @@ int Application::newInstance()
{
for (int i = 0; i < args->count(); ++i)
{
- loadUrl(args->arg(i), Rekonq::New);
+ loadUrl(args->arg(i), Rekonq::NewTab);
}
args->clear();
}
else
{
+ m_mainWindow->mainView()->newTab();
m_mainWindow->slotHome();
}
@@ -310,25 +311,35 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
loadingUrl.setUrl( QString("http://en.wikipedia.org/wiki/%1").arg(str) );
}
-
- WebView *webView = m_mainWindow->mainView()->newTab();
- m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl());
-
- switch(type)
+ WebView *webView;
+ if( type == Rekonq::CurrentTab )
+ {
+ webView = m_mainWindow->currentTab();
+ m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl());
+ }
+ else
{
- case Rekonq::Default:
- if (!ReKonfig::openTabsBack())
+ webView = m_mainWindow->mainView()->newTab();
+ 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::New:
- m_mainWindow->mainView()->setCurrentWidget(webView); // this method does NOT take ownership of webView
- break;
- case Rekonq::Background:
- break;
- };
-
+ 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();