summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-08-19 17:48:19 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-08-20 18:16:15 +0200
commitdddfe170077e022f0d428569fe8d5298736a2b68 (patch)
tree87d6045362ce89da7427b7b385b56a4619aab0f5 /examples
parent75d9159924fcb2b4c11a43c87e8e62332fdf38fd (diff)
Implement the basic parts of QWebEngineHistory.
Mark the remaining methods as not implemented to allow enabling most of the dependent code in the demo browser and in API tests. Add two new tests to cover cases that might be problematic with the index-based implementation. This also renames WebContentsAdapter::navigateHistory to navigateToOffset in order to avoid confusion with navigateToIndex. Change-Id: I7c5cb9f5f878e34206fdfe48334a2dc7d9d95a1d Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/browser/browsermainwindow.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/examples/widgets/browser/browsermainwindow.cpp b/examples/widgets/browser/browsermainwindow.cpp
index c7679fbe1..2d6c02288 100644
--- a/examples/widgets/browser/browsermainwindow.cpp
+++ b/examples/widgets/browser/browsermainwindow.cpp
@@ -891,7 +891,6 @@ void BrowserMainWindow::slotAboutToShowBackMenu()
m_historyBackMenu->clear();
if (!currentTab())
return;
-#if defined(QWEBENGINEHISTORY)
QWebEngineHistory *history = currentTab()->history();
int historyCount = history->count();
for (int i = history->backItems(historyCount).count() - 1; i >= 0; --i) {
@@ -903,7 +902,6 @@ void BrowserMainWindow::slotAboutToShowBackMenu()
action->setText(item.title());
m_historyBackMenu->addAction(action);
}
-#endif
}
void BrowserMainWindow::slotAboutToShowForwardMenu()
@@ -911,7 +909,6 @@ void BrowserMainWindow::slotAboutToShowForwardMenu()
m_historyForwardMenu->clear();
if (!currentTab())
return;
-#if defined(QWEBENGINEHISTORY)
QWebEngineHistory *history = currentTab()->history();
int historyCount = history->count();
for (int i = 0; i < history->forwardItems(history->count()).count(); ++i) {
@@ -923,7 +920,6 @@ void BrowserMainWindow::slotAboutToShowForwardMenu()
action->setText(item.title());
m_historyForwardMenu->addAction(action);
}
-#endif
}
void BrowserMainWindow::slotAboutToShowWindowMenu()
@@ -961,15 +957,12 @@ void BrowserMainWindow::slotShowWindow()
void BrowserMainWindow::slotOpenActionUrl(QAction *action)
{
-#if defined(QWEBENGINEHISTORY)
-
int offset = action->data().toInt();
QWebEngineHistory *history = currentTab()->history();
if (offset < 0)
history->goToItem(history->backItems(-1*offset).first()); // back
else if (offset > 0)
history->goToItem(history->forwardItems(history->count() - offset + 1).back()); // forward
-#endif
}
void BrowserMainWindow::geometryChangeRequested(const QRect &geometry)