summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp167
-rw-r--r--src/bookmarks/bookmarkmanager.cpp3
2 files changed, 84 insertions, 86 deletions
diff --git a/src/application.cpp b/src/application.cpp
index efbfd60a..cbb083cb 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -194,122 +194,121 @@ int Application::newInstance()
kDebug() << "are there arguments? " << areThereArguments;
kDebug() << "is rekonq crashed? " << hasToBeRecovered;
- if (isFirstLoad && isSessionRestored())
- {
- isFirstLoad = false;
- }
- if (areThereArguments)
+ if (!isSessionRestored())
{
- // prepare URLS to load
- KUrl::List urlList;
- for (int i = 0; i < args->count(); ++i)
+ if (areThereArguments)
{
- const KUrl u = args->url(i);
+ // prepare URLS to load
+ KUrl::List urlList;
+ for (int i = 0; i < args->count(); ++i)
+ {
+ const KUrl u = args->url(i);
- if (u.isLocalFile() && QFile::exists(u.toLocalFile())) // "rekonq somefile.html" case
- urlList += u;
+ if (u.isLocalFile() && QFile::exists(u.toLocalFile())) // "rekonq somefile.html" case
+ urlList += u;
+ else
+ {
+ // "rekonq kde.org" || "rekonq kde:kdialog" case
+ UrlResolver res(args->arg(i));
+ UrlSearchList list = res.orderedSearchItems();
+ if (list.isEmpty())
+ {
+ urlList += u;
+ }
+ else
+ {
+ urlList += list.first().url;
+ }
+ }
+ }
+
+ if (isFirstLoad && (ReKonfig::startupBehaviour() == 2) && sessionManager()->restoreSessionFromScratch())
+ {
+ isFirstLoad = false;
+ }
+
+ // first argument: 99% of the time we have just that...
+ if (isFirstLoad)
+ {
+ // No windows in the current desktop? No windows at all?
+ // Create a new one and load there sites...
+ loadUrl(urlList.at(0), Rekonq::NewWindow);
+ }
else
{
- // "rekonq kde.org" || "rekonq kde:kdialog" case
- UrlResolver res(args->arg(i));
- UrlSearchList list = res.orderedSearchItems();
- if (list.isEmpty())
+ if (!ReKonfig::openExternalLinksInNewWindow())
{
- urlList += u;
+ loadUrl(urlList.at(0), Rekonq::NewFocusedTab);
}
else
{
- urlList += list.first().url;
+ loadUrl(urlList.at(0), Rekonq::NewWindow);
}
- }
- }
- if (isFirstLoad && (ReKonfig::startupBehaviour() == 2) && sessionManager()->restoreSessionFromScratch())
- {
- isFirstLoad = false;
- }
+ if (!mainWindow()->isActiveWindow())
+ KWindowSystem::demandAttention(mainWindow()->winId(), true);
+ }
- // first argument: 99% of the time we have just that...
- if (isFirstLoad)
- {
- // No windows in the current desktop? No windows at all?
- // Create a new one and load there sites...
- loadUrl(urlList.at(0), Rekonq::NewWindow);
- }
- else
- {
+ // following arguments: what's best behavior here?
+ // I'm pretty sure no one has real opinion about...
if (!ReKonfig::openExternalLinksInNewWindow())
{
- loadUrl(urlList.at(0), Rekonq::NewFocusedTab);
+ for (int i = 1; i < urlList.count(); ++i)
+ loadUrl(urlList.at(i), Rekonq::NewFocusedTab);
}
else
{
- loadUrl(urlList.at(0), Rekonq::NewWindow);
+ for (int i = 1; i < urlList.count(); ++i)
+ loadUrl(urlList.at(i), Rekonq::NewWindow);
}
-
- if (!mainWindow()->isActiveWindow())
- KWindowSystem::demandAttention(mainWindow()->winId(), true);
- }
-
- // following arguments: what's best behavior here?
- // I'm pretty sure no one has real opinion about...
- if (!ReKonfig::openExternalLinksInNewWindow())
- {
- for (int i = 1; i < urlList.count(); ++i)
- loadUrl(urlList.at(i), Rekonq::NewFocusedTab);
}
else
{
- for (int i = 1; i < urlList.count(); ++i)
- loadUrl(urlList.at(i), Rekonq::NewWindow);
- }
- }
- else
- {
- if (isFirstLoad)
- {
- if (hasToBeRecovered)
+ if (isFirstLoad)
{
- loadUrl(KUrl("about:closedTabs"), Rekonq::NewWindow);
+ if (hasToBeRecovered)
+ {
+ loadUrl(KUrl("about:closedTabs"), Rekonq::NewWindow);
+ }
+ else
+ {
+ switch (ReKonfig::startupBehaviour())
+ {
+ case 0: // open home page
+ newMainWindow()->homePage();
+ break;
+ case 1: // open new tab page
+ loadUrl(KUrl("about:home"), Rekonq::NewWindow);
+ break;
+ case 2: // restore session
+ if (sessionManager()->restoreSessionFromScratch())
+ {
+ break;
+ }
+ default:
+ newMainWindow()->homePage();
+ break;
+ }
+ }
}
else
{
- switch (ReKonfig::startupBehaviour())
+ switch (ReKonfig::newTabsBehaviour())
{
- case 0: // open home page
- newMainWindow()->homePage();
+ case 0: // new tab page
+ loadUrl(KUrl("about:home") , Rekonq::NewWindow);
break;
- case 1: // open new tab page
- loadUrl(KUrl("about:home"), Rekonq::NewWindow);
+ case 2: // homepage
+ loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewWindow);
break;
- case 2: // restore session
- if (sessionManager()->restoreSessionFromScratch())
- {
- break;
- }
+ case 1: // blank page
default:
- newMainWindow()->homePage();
+ loadUrl(KUrl("about:blank") , Rekonq::NewWindow);
break;
}
}
}
- else
- {
- switch (ReKonfig::newTabsBehaviour())
- {
- case 0: // new tab page
- loadUrl(KUrl("about:home") , Rekonq::NewWindow);
- break;
- case 2: // homepage
- loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewWindow);
- break;
- case 1: // blank page
- default:
- loadUrl(KUrl("about:blank") , Rekonq::NewWindow);
- break;
- }
- }
}
if (isFirstLoad)
@@ -333,10 +332,6 @@ int Application::newInstance()
historyManager();
- // bookmarks loading
- connect(bookmarkManager(), SIGNAL(openUrl(KUrl, Rekonq::OpenType)),
- instance(), SLOT(loadUrl(KUrl, Rekonq::OpenType)));
-
ReKonfig::setRecoverOnCrash(ReKonfig::recoverOnCrash() + 1);
saveConfiguration();
}
diff --git a/src/bookmarks/bookmarkmanager.cpp b/src/bookmarks/bookmarkmanager.cpp
index 43f4dd3a..3ccb09a5 100644
--- a/src/bookmarks/bookmarkmanager.cpp
+++ b/src/bookmarks/bookmarkmanager.cpp
@@ -76,6 +76,9 @@ BookmarkManager::BookmarkManager(QObject *parent)
connect(m_owner, SIGNAL(openUrl(KUrl, Rekonq::OpenType)),
this, SIGNAL(openUrl(KUrl, Rekonq::OpenType)));
+ // bookmarks loading
+ connect(this, SIGNAL(openUrl(KUrl, Rekonq::OpenType)), rApp, SLOT(loadUrl(KUrl, Rekonq::OpenType)));
+
KAction *a = KStandardAction::addBookmark(m_owner, SLOT(bookmarkCurrentPage()), this);
m_actionCollection->addAction(QL1S("rekonq_add_bookmark"), a);
}