diff options
Diffstat (limited to 'src/sessionmanager.cpp')
-rw-r--r-- | src/sessionmanager.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
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); |