summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-14 10:30:16 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-14 10:30:16 +0200
commit85dec247bde3a46298d0b9a9a6b7faa5e8d33bf8 (patch)
tree459a2cb8791e6cff703856dc0cdf877110e507b7 /src
parentLionel's fixes to the UI. (diff)
downloadrekonq-85dec247bde3a46298d0b9a9a6b7faa5e8d33bf8.tar.xz
Finally cleaning Application class, getting rid of loadUrl(string) slot
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp82
-rw-r--r--src/application.h6
2 files changed, 33 insertions, 55 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 48264440..db6d3c32 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -154,7 +154,7 @@ int Application::newInstance()
// Create a new one and load there sites...
loadUrl(args->arg(0), Rekonq::CurrentTab);
for (int i = 1; i < args->count(); ++i)
- loadUrl(args->arg(i), Rekonq::SettingOpenTab);
+ loadUrl( KUrl( args->arg(i) ), Rekonq::SettingOpenTab);
}
else
{
@@ -165,7 +165,7 @@ int Application::newInstance()
MainWindow *m = m_mainWindows.at(index - 1).data();
m->activateWindow();
for (int i = 0; i < args->count(); ++i)
- loadUrl(args->arg(i), Rekonq::NewCurrentTab);
+ loadUrl( KUrl( args->arg(i) ), Rekonq::NewCurrentTab);
}
}
}
@@ -295,17 +295,37 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
return;
}
- prepareLoading(url.pathOrUrl(), type);
-}
-
-
-
-void Application::loadUrl(const QString& urlString, const Rekonq::OpenType& type)
-{
- if(urlString.isEmpty())
- return;
-
- prepareLoading(urlString, type);
+ // first, create the webview(s) to not let hangs UI..
+ WebTab *tab = 0;
+ MainWindow *w = 0;
+ w = (type == Rekonq::NewWindow)
+ ? newMainWindow()
+ : mainWindow();
+
+ switch(type)
+ {
+ case Rekonq::SettingOpenTab:
+ tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent());
+ break;
+ case Rekonq::NewCurrentTab:
+ tab = w->mainView()->newWebTab(true);
+ break;
+ case Rekonq::NewBackTab:
+ tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent());
+ break;
+ case Rekonq::NewWindow:
+ case Rekonq::CurrentTab:
+ tab = w->mainView()->currentWebTab();
+ break;
+ };
+
+ WebView *view = tab->view();
+
+ if (view)
+ {
+ FilterUrlJob *job = new FilterUrlJob(view, url.pathOrUrl(), this);
+ Weaver::instance()->enqueue(job);
+ }
}
@@ -370,39 +390,3 @@ void Application::newWindow()
loadUrl( KUrl("about:home"), Rekonq::NewWindow );
mainWindow()->mainView()->urlBarWidget()->setFocus();
}
-
-
-void Application::prepareLoading(const QString& urlString, const Rekonq::OpenType& type)
-{
- // first, create the webview(s) to not let hangs UI..
- WebTab *tab = 0;
- MainWindow *w = 0;
- w = (type == Rekonq::NewWindow)
- ? newMainWindow()
- : mainWindow();
-
- switch(type)
- {
- case Rekonq::SettingOpenTab:
- tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent());
- break;
- case Rekonq::NewCurrentTab:
- tab = w->mainView()->newWebTab(true);
- break;
- case Rekonq::NewBackTab:
- tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent());
- break;
- case Rekonq::NewWindow:
- case Rekonq::CurrentTab:
- tab = w->mainView()->currentWebTab();
- break;
- };
-
- WebView *view = tab->view();
-
- if (view)
- {
- FilterUrlJob *job = new FilterUrlJob(view, urlString, this);
- Weaver::instance()->enqueue(job);
- }
-}
diff --git a/src/application.h b/src/application.h
index 760f7943..c268d586 100644
--- a/src/application.h
+++ b/src/application.h
@@ -123,10 +123,6 @@ public slots:
void loadUrl( const KUrl& url,
const Rekonq::OpenType& type = Rekonq::CurrentTab
);
-
- void loadUrl( const QString& urlString,
- const Rekonq::OpenType& type = Rekonq::CurrentTab
- );
void newWindow();
void removeMainWindow(MainWindow *window);
@@ -141,8 +137,6 @@ private slots:
void loadResolvedUrl(ThreadWeaver::Job *);
private:
- void prepareLoading(const QString& urlString, const Rekonq::OpenType& type);
-
static QWeakPointer<HistoryManager> s_historyManager;
static QWeakPointer<BookmarkProvider> s_bookmarkProvider;
static QWeakPointer<SessionManager> s_sessionManager;