diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-27 16:52:21 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-27 16:52:35 +0200 |
commit | ec5a99b0515779ff5ec3df6bd657127b4e037823 (patch) | |
tree | c5dc52e8892b6740123469276dcb303a81d9fd56 /examples/webenginewidgets/demobrowser/history.cpp | |
parent | 56bea56b2d8fabc4b09d41531177a22d9297ce2c (diff) | |
parent | 722732d1f089630ad517aef8f94325a51186b274 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: Ic6686df8f82f710a3441501b7eeaffe69fbcbdf7
Diffstat (limited to 'examples/webenginewidgets/demobrowser/history.cpp')
-rw-r--r-- | examples/webenginewidgets/demobrowser/history.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/webenginewidgets/demobrowser/history.cpp b/examples/webenginewidgets/demobrowser/history.cpp index 188490aca..bce65b917 100644 --- a/examples/webenginewidgets/demobrowser/history.cpp +++ b/examples/webenginewidgets/demobrowser/history.cpp @@ -137,7 +137,7 @@ void HistoryManager::setHistory(const QList<HistoryItem> &history, bool loadedAn if (!loadedAndSorted) qSort(m_history.begin(), m_history.end()); - checkForExpired(); + checkForExpired(loadedAndSorted); if (loadedAndSorted) { m_lastSavedUrl = m_history.value(0).url; @@ -163,7 +163,7 @@ HistoryTreeModel *HistoryManager::historyTreeModel() const return m_historyTreeModel; } -void HistoryManager::checkForExpired() +void HistoryManager::checkForExpired(bool removeEntriesDirectly) { if (m_historyLimit < 0 || m_history.isEmpty()) return; @@ -185,7 +185,11 @@ void HistoryManager::checkForExpired() const HistoryItem& item = m_history.last(); // remove from saved file also m_lastSavedUrl = QString(); - emit entryRemoved(item); + + if (removeEntriesDirectly) + m_history.takeLast(); + else + emit entryRemoved(item); } if (nextTimeout > 0) |