summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application.cpp4
-rw-r--r--src/sessionmanager.cpp21
2 files changed, 21 insertions, 4 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 4f6f9651..1ac66188 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -146,8 +146,8 @@ int Application::newInstance()
{
restoreOk = SessionManager::self()->restoreJustThePinnedTabs();
}
-
- isFirstLoad = restoreOk;
+
+ isFirstLoad = !restoreOk;
}
// first argument: 99% of the time we have just that...
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 7e13388e..58e9f19e 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -82,7 +82,7 @@ int loadTabs(TabWindow *tw, QDomElement & window, bool useFirstTab, bool justThe
{
QDomElement tab = window.elementsByTagName("tab").at(tabNo).toElement();
bool tabIsPinned = tab.hasAttribute("pinned");
- kDebug() << "Tab # " << tabNo << " is pinned? " << tabIsPinned;
+ kDebug() << "Tab #" << tabNo << " is pinned? " << tabIsPinned;
if (!justThePinnedOnes || tabIsPinned)
{
@@ -118,6 +118,20 @@ int loadTabs(TabWindow *tw, QDomElement & window, bool useFirstTab, bool justThe
}
+bool areTherePinnedTabs(QDomElement & window)
+{
+ bool b = false;
+
+ for (unsigned int tabNo = 0; tabNo < window.elementsByTagName("tab").length(); tabNo++)
+ {
+ QDomElement tab = window.elementsByTagName("tab").at(tabNo).toElement();
+ b = tab.hasAttribute("pinned");
+ }
+
+ return b;
+}
+
+
// -------------------------------------------------------------------------------------------------
@@ -256,9 +270,12 @@ bool SessionManager::restoreJustThePinnedTabs()
bool done = false;
for (unsigned int winNo = 0; winNo < document.elementsByTagName("window").length(); winNo++)
{
- done = true;
QDomElement window = document.elementsByTagName("window").at(winNo).toElement();
+ if (!areTherePinnedTabs(window))
+ continue;
+
+ done = true;
TabWindow *tw = rApp->newTabWindow();
int currentTab = loadTabs(tw, window, true, true);