From dddfe170077e022f0d428569fe8d5298736a2b68 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 19 Aug 2013 17:48:19 +0200 Subject: 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 Reviewed-by: Andras Becsi --- examples/widgets/browser/browsermainwindow.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'examples/widgets/browser/browsermainwindow.cpp') 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) -- cgit v1.2.1