summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2009-09-25 11:56:56 (GMT)
committerTor Arne Vestbø <tor.arne.vestbo@nokia.com>2009-09-25 11:58:15 (GMT)
commitf4cbcefc738b6cb8d6676907733f92e06ae33f66 (patch)
tree7a69cdb241fc0171eff6416fd3e23d034ed76353 /demos
parent5b6799dffbd8ffc0c5943bf7dc35c945db0ae5ec (diff)
downloadQt-f4cbcefc738b6cb8d6676907733f92e06ae33f66.zip
Qt-f4cbcefc738b6cb8d6676907733f92e06ae33f66.tar.gz
Qt-f4cbcefc738b6cb8d6676907733f92e06ae33f66.tar.bz2
browser: Don't add closed tabs to the closed-tab history in privacy mode
Task-number: QTBUG-4508 Reviewed-by: Simon Hausmann
Diffstat (limited to 'demos')
-rw-r--r--demos/browser/tabwidget.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/demos/browser/tabwidget.cpp b/demos/browser/tabwidget.cpp
index f2f1b32..8a7ae0b 100644
--- a/demos/browser/tabwidget.cpp
+++ b/demos/browser/tabwidget.cpp
@@ -560,10 +560,13 @@ void TabWidget::closeTab(int index)
}
hasFocus = tab->hasFocus();
- m_recentlyClosedTabsAction->setEnabled(true);
- m_recentlyClosedTabs.prepend(tab->url());
- if (m_recentlyClosedTabs.size() >= TabWidget::m_recentlyClosedTabsSize)
- m_recentlyClosedTabs.removeLast();
+ QWebSettings *globalSettings = QWebSettings::globalSettings();
+ if (!globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) {
+ m_recentlyClosedTabsAction->setEnabled(true);
+ m_recentlyClosedTabs.prepend(tab->url());
+ if (m_recentlyClosedTabs.size() >= TabWidget::m_recentlyClosedTabsSize)
+ m_recentlyClosedTabs.removeLast();
+ }
}
QWidget *lineEdit = m_lineEdits->widget(index);
m_lineEdits->removeWidget(lineEdit);