summaryrefslogtreecommitdiff
path: root/src/sessionmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-14 20:59:18 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit2809822c951ac8c835fea5e218c6fe1a8126f3eb (patch)
treeb656af9280debe34c212da464697c630cbdde771 /src/sessionmanager.cpp
parentdocument mode (diff)
downloadrekonq-2809822c951ac8c835fea5e218c6fe1a8126f3eb.tar.xz
Fix opening when there are no pinned tabs
Diffstat (limited to 'src/sessionmanager.cpp')
-rw-r--r--src/sessionmanager.cpp21
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);