From 1097149bf3296e7142098a64ff85b459556cc66c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 14 Mar 2013 15:22:23 +0100 Subject: Do NOT save sessions in private browsing windows Oooops... ;) BUG: 316325 --- src/sessionmanager.cpp | 4 ++++ src/tabwindow/rekonqwindow.cpp | 6 ++++++ src/tabwindow/rekonqwindow.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index c4927cbc..537d4453 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -198,6 +198,9 @@ void SessionManager::save() Q_FOREACH(const QWeakPointer &w, wl) { + if (w.data()->isPrivateBrowsingMode()) + continue; + QDomElement window = document.createElement("window"); int tabInserted = 0; @@ -229,6 +232,7 @@ void SessionManager::save() tab.appendChild(historySection); window.appendChild(tab); } + if (tabInserted > 0) session.appendChild(window); } diff --git a/src/tabwindow/rekonqwindow.cpp b/src/tabwindow/rekonqwindow.cpp index 0e6515bd..9d0b0e23 100644 --- a/src/tabwindow/rekonqwindow.cpp +++ b/src/tabwindow/rekonqwindow.cpp @@ -119,6 +119,12 @@ WebWindow *RekonqWindow::currentWebWindow() const } +bool RekonqWindow::isPrivateBrowsingMode() +{ + return _tabWidget->isPrivateBrowsingWindowMode(); +} + + // -------------------------------------------------------------------------------------------------- diff --git a/src/tabwindow/rekonqwindow.h b/src/tabwindow/rekonqwindow.h index 1d46faeb..3c1d3c91 100644 --- a/src/tabwindow/rekonqwindow.h +++ b/src/tabwindow/rekonqwindow.h @@ -64,6 +64,8 @@ public: TabBar *tabBar(); WebWindow *currentWebWindow() const; + bool isPrivateBrowsingMode(); + private: void init(); -- cgit v1.2.1