summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-11-08 21:37:08 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-11-08 21:37:08 +0100
commitc880b7fc68dc061367ad340535a75ffe92f771af (patch)
tree380bf359a9f9b645ad22d30c9d4180b484038604 /src
parentString changes (diff)
downloadrekonq-c880b7fc68dc061367ad340535a75ffe92f771af.tar.xz
Changed loadUrl behaviour to let rekonq being more UI responsive
and try fixing UI spared hangs
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 8e65b394..30781609 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -357,6 +357,37 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
return;
}
+ // first, create the webview(s) to not let hangs UI..
+ WebView *webView = 0;
+ MainWindow *w = 0;
+
+ if(type == Rekonq::NewWindow)
+ {
+ w = newMainWindow();
+ }
+ else
+ {
+ w = mainWindow();
+ }
+
+ switch(type)
+ {
+ case Rekonq::SettingOpenTab:
+ webView = w->mainView()->newWebView(!ReKonfig::openTabsBack(),
+ ReKonfig::openTabsNearCurrent());
+ break;
+ case Rekonq::NewCurrentTab:
+ webView = w->mainView()->newWebView(true);
+ break;
+ case Rekonq::NewBackTab:
+ webView = w->mainView()->newWebView(false, ReKonfig::openTabsNearCurrent());
+ break;
+ case Rekonq::NewWindow:
+ case Rekonq::CurrentTab:
+ webView = w->mainView()->currentWebView();
+ break;
+ };
+
// WARNING this is just a temporary hack waiting for the new "awesome bar" (rekonq 0.4 target)
// and it may not work in all cases.
// Known issues are (add that here to test the awesome bar code):
@@ -387,46 +418,15 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
// are considered as executables
if (KUriFilter::self()->filterUri(data))
{
- loadingUrl = data.uri().url();
+ loadingUrl = data.uri().url();
}
// ------------------- END WARNING --------------------------------------
- WebView *webView = 0;
- MainWindow *w = 0;
-
- if(type == Rekonq::NewWindow)
- {
- w = newMainWindow();
- }
- else
+ if (!ReKonfig::openTabsBack())
{
- w = mainWindow();
+ w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl());
}
- switch(type)
- {
- case Rekonq::SettingOpenTab:
- webView = w->mainView()->newWebView(!ReKonfig::openTabsBack(),
- ReKonfig::openTabsNearCurrent());
- if (!ReKonfig::openTabsBack())
- {
- w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl());
- }
- break;
- case Rekonq::NewCurrentTab:
- webView = w->mainView()->newWebView(true);
- w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl());
- break;
- case Rekonq::NewBackTab:
- webView = w->mainView()->newWebView(false, ReKonfig::openTabsNearCurrent());
- break;
- case Rekonq::NewWindow:
- case Rekonq::CurrentTab:
- webView = w->mainView()->currentWebView();
- w->mainView()->urlBar()->setUrl(loadingUrl.prettyUrl());
- break;
- };
-
if (webView)
{
webView->setFocus();