summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/application.cpp b/src/application.cpp
index e3c06a5b..6719d456 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -87,6 +87,16 @@ int Application::newInstance()
{
KCmdLineArgs::setCwd(QDir::currentPath().toUtf8());
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+
+ // we share one process for several mainwindows,
+ // so initialize only once
+ static bool first = true;
+
+ if (first)
+ {
+ QTimer::singleShot(0, this, SLOT(postLaunch()));
+ first = false;
+ }
// is your app session restored? restore session...
// this mechanism also falls back to load usual plain rekonq
@@ -151,6 +161,10 @@ void Application::postLaunch()
Application::historyManager();
Application::sessionManager();
+
+ // bookmarks loading
+ connect(Application::bookmarkProvider(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)),
+ Application::instance(), SLOT(loadUrl(const KUrl&, const Rekonq::OpenType&)));
}
@@ -229,9 +243,16 @@ SessionManager *Application::sessionManager()
KIcon Application::icon(const KUrl &url)
{
+ if(url.scheme() == "rekonq" ||
+ (url.isEmpty() // Urlbar is empty for homepage, but we want an icon
+ && !Application::instance()->mainWindowList().isEmpty() // avoid infinite loop at startup
+ && Application::instance()->mainWindow()->currentTab()->url().scheme() == "rekonq")
+ )
+ return KIcon("go-home");
+
if(url.isEmpty())
return KIcon("text-html");
-
+
KIcon icon = KIcon(QWebSettings::iconForUrl(url));
if (icon.isNull())
{
@@ -393,7 +414,6 @@ MainWindow *Application::newMainWindow()
m_mainWindows.prepend(w);
w->show();
- QTimer::singleShot(0, this, SLOT(postLaunch()));
return w;
}
@@ -413,7 +433,7 @@ MainWindowList Application::mainWindowList()
bool Application::homePage(const KUrl &url)
{
- if ( url == KUrl("rekonq:lastSites")
+ if ( url == KUrl("rekonq:closedTabs")
|| url == KUrl("rekonq:history")
|| url == KUrl("rekonq:bookmarks")
|| url == KUrl("rekonq:favorites")