From 43aef88835fd1ffbbfb18c810a869b18b5990f55 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 31 Jul 2010 01:22:19 +0200 Subject: Don't save sessions && closed tabs if Private Browsing is enabled BUG:246268 --- src/mainview.cpp | 4 +++- src/sessionmanager.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mainview.cpp b/src/mainview.cpp index a771e3d7..335bcfae 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -494,7 +494,9 @@ void MainView::closeTab(int index, bool del) return; } - if (!tab->url().isEmpty()) + if (!tab->url().isEmpty() + && !QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled) + ) { QString title = tab->view()->title(); QString url = tab->url().prettyUrl(); diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index 8832878b..fbab2d82 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -64,6 +64,10 @@ void SessionManager::saveSession() if (!m_safe) return; m_safe = false; + + if( QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled) ) + return; + QFile sessionFile(m_sessionFilePath); if (!sessionFile.open(QFile::WriteOnly | QFile::Truncate)) { -- cgit v1.2.1