diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-10-02 15:22:00 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-10-02 15:22:00 +0200 |
commit | 1dfe3d1058f8fe9a4201eff27ceb79002654e6c6 (patch) | |
tree | 0cbef44fbd8b06bc49ea1bfac09dd37e6596d290 /src | |
parent | no more strange windows opened while loading previews :) (diff) | |
parent | Fixing Application::homePage behaviour (diff) | |
download | rekonq-1dfe3d1058f8fe9a4201eff27ceb79002654e6c6.tar.xz |
Merge branch 'DEVS'
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('.'); |