diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-10-02 12:01:58 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-10-02 12:01:58 +0200 |
commit | 03e600a1390d61a99ac2a393c9ab1500d8972e9e (patch) | |
tree | 8b1fb8988bcebf60fac693541c4aa152eef1adcc /src | |
parent | Changin (again) layout and fixing last Visited page counter.. :) (diff) | |
download | rekonq-03e600a1390d61a99ac2a393c9ab1500d8972e9e.tar.xz |
Fixing Application::homePage behaviour
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 28 | ||||
-rw-r--r-- | src/application.h | 2 | ||||
-rw-r--r-- | src/previewimage.cpp | 1 |
3 files changed, 19 insertions, 12 deletions
diff --git a/src/application.cpp b/src/application.cpp index ba456d2c..bffcb2ae 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -301,11 +301,8 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) } // loading home pages - if (url.scheme() == QLatin1String("about")) - { - homePage(url); + if (homePage(url)) return; - } if (url.scheme() == QLatin1String("mailto")) { @@ -421,12 +418,21 @@ MainWindowList Application::mainWindowList() } -void Application::homePage(const KUrl &url) +bool 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); - return; + if ( url == KUrl("about:lastSites") + || url == KUrl("about:history") + || url == KUrl("about:bookmarks") + || url == KUrl("about:favorites") + || url == KUrl("about:home") + ) + { + kDebug() << "loading home: " << url; + MainView *view = mainWindow()->mainView(); + WebView *w = view->currentWebView(); + HomePage p(w); + w->setHtml( p.rekonqHomePage(url), url); + return true; + } + return false; } diff --git a/src/application.h b/src/application.h index f886982c..7a0e884c 100644 --- a/src/application.h +++ b/src/application.h @@ -101,7 +101,7 @@ public: MainWindow *mainWindow(); MainWindowList mainWindowList(); - void homePage(const KUrl &url = KUrl("about:home")); + bool homePage(const KUrl &url = KUrl("about:home")); static KIcon icon(const KUrl &url); diff --git a/src/previewimage.cpp b/src/previewimage.cpp index 44c0850a..60207fb3 100644 --- a/src/previewimage.cpp +++ b/src/previewimage.cpp @@ -93,6 +93,7 @@ QString PreviewImage::guessNameFromUrl(QUrl url) QString name = url.toString( QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::StripTrailingSlash ); // TODO learn Regular Expressions :) + // and implement something better here.. name.remove('/'); name.remove('&'); name.remove('.'); |