summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-22 20:23:42 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commitaa41772f7bc6ab59bc32010f233cdb21431fb110 (patch)
tree899bc7cf93fd39d259221b009c397731b9826d5a
parentFix "new window" menu action (diff)
downloadrekonq-aa41772f7bc6ab59bc32010f233cdb21431fb110.tar.xz
Fix tabs restore when some of them were pinned
-rw-r--r--src/application.cpp23
-rw-r--r--src/sessionmanager.cpp6
-rw-r--r--src/tabwindow/tabwindow.cpp6
3 files changed, 18 insertions, 17 deletions
diff --git a/src/application.cpp b/src/application.cpp
index b8e0ca5c..fc12c17d 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -111,12 +111,9 @@ int Application::newInstance()
bool incognito = args->isSet("incognito");
bool webapp = args->isSet("webapp");
- kDebug() << "INCOGNITO: " << incognito;
- kDebug() << "WEBAPPS: " << webapp;
- kDebug() << "ARGS COUNT: " << args->count();
-
if (webapp)
{
+ kDebug() << "WEBAPP MODE...";
if (args->count() == 0)
{
KMessageBox::error(0, i18n("Error"), i18n("Cannot launch webapp mode without an URL to load"));
@@ -152,7 +149,7 @@ int Application::newInstance()
// just create History Manager...
HistoryManager::self();
- // FIXME: should this be removed?
+ // WARNING: should this be removed?
AdBlockManager::self();
}
@@ -163,6 +160,8 @@ int Application::newInstance()
if (areThereArguments)
{
+ kDebug() << "DEFAULT MODE, WITH ARGUMENTS...";
+
// prepare URLS to load
KUrl::List urlList;
for (int i = 0; i < args->count(); ++i)
@@ -243,13 +242,13 @@ int Application::newInstance()
}
else // ok, NO arguments
{
+ kDebug() << "DEFAULT MODE, NO ARGUMENTS...";
if (isFirstLoad)
{
// NOTE: just load new tabs/windows without arguments
// if NOT is Session restored...
if (!isSessionRestored())
{
- bool restoreOk = false;
switch (ReKonfig::startupBehaviour())
{
case 0: // open home page
@@ -258,10 +257,7 @@ int Application::newInstance()
loadUrl(KUrl(ReKonfig::homePage()), Rekonq::NewPrivateWindow);
break;
}
- restoreOk = SessionManager::self()->restoreJustThePinnedTabs();
- if (restoreOk)
- loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewTab);
- else
+ if (!SessionManager::self()->restoreJustThePinnedTabs())
loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewWindow);
break;
case 1: // open new tab page
@@ -270,11 +266,8 @@ int Application::newInstance()
loadUrl(KUrl("about:home"), Rekonq::NewPrivateWindow);
break;
}
- restoreOk = SessionManager::self()->restoreJustThePinnedTabs();
- if (restoreOk)
- loadUrl(KUrl("about:home"), Rekonq::NewTab);
- else
- loadUrl(KUrl("about:home"), Rekonq::NewWindow);
+ if (!SessionManager::self()->restoreJustThePinnedTabs())
+ loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewWindow);
break;
case 2: // restore session
if (incognito)
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 58e9f19e..4903360c 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -126,6 +126,8 @@ bool areTherePinnedTabs(QDomElement & window)
{
QDomElement tab = window.elementsByTagName("tab").at(tabNo).toElement();
b = tab.hasAttribute("pinned");
+ if (b)
+ return true;
}
return b;
@@ -276,9 +278,9 @@ bool SessionManager::restoreJustThePinnedTabs()
continue;
done = true;
- TabWindow *tw = rApp->newTabWindow();
+ TabWindow *tw = rApp->newTabWindow(false);
- int currentTab = loadTabs(tw, window, true, true);
+ int currentTab = loadTabs(tw, window, false, true);
tw->setCurrentIndex(currentTab);
}
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp
index d2692d3d..99c4aa40 100644
--- a/src/tabwindow/tabwindow.cpp
+++ b/src/tabwindow/tabwindow.cpp
@@ -349,7 +349,13 @@ void TabWindow::tabLoadFinished(bool ok)
label->setPixmap(ic.pixmap(16, 16));
if (!tabBar()->tabData(index).toBool())
+ {
setTabText(index, tab->title());
+ }
+ else
+ {
+ setTabText(index, QString());
+ }
}