diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-29 12:15:17 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-29 12:15:17 +0200 |
commit | 40ced90916c742bd813be8bfaf7c17490a75a3e0 (patch) | |
tree | 750cbc86b076b1dc24a6d9c80d627f00ad54f892 /src/application.cpp | |
parent | Implementing a new about: protocol, 1st bunch (diff) | |
download | rekonq-40ced90916c742bd813be8bfaf7c17490a75a3e0.tar.xz |
Implemented about protocol to load home page(s)
and changed its layout
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/application.cpp b/src/application.cpp index 9bbf7792..9b7d175f 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -42,6 +42,7 @@ #include "webview.h" #include "urlbar.h" #include "sessionmanager.h" +#include "homepage.h" // KDE Includes #include <KCmdLineArgs> @@ -303,6 +304,13 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) KMessageBox::error(0, i18n("Malformed URL:\n%1", url.url())); return; } + + // loading home pages + if (url.scheme() == QLatin1String("about")) + { + homePage(url); + return; + } if (url.scheme() == QLatin1String("mailto")) { @@ -416,3 +424,15 @@ MainWindowList Application::mainWindowList() { return m_mainWindows; } + + +void Application::homePage(const KUrl &url) +{ + kDebug() << "loading home: " << url; + MainView *view = mainWindow()->mainView(); + WebView *w = view->currentWebView(); + HomePage p(w); + w->setHtml( p.rekonqHomePage(url), url); + view->urlBar()->setFocus(); + return; +} |