From a115d91564f58e7a698dae02d35c932aff2fd50c Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 25 Sep 2015 17:45:47 +0200 Subject: [PATCH] Remove Caret Browsing option No longer available with QtWebEngine --- src/lib/app/browserwindow.cpp | 11 ----------- src/lib/app/browserwindow.h | 1 - src/lib/app/mainmenu.cpp | 14 -------------- src/lib/app/mainmenu.h | 1 - src/lib/other/macmenureceiver.cpp | 5 ----- src/lib/other/macmenureceiver.h | 1 - src/lib/preferences/preferences.cpp | 2 -- src/lib/preferences/preferences.ui | 11 ++--------- src/plugins/TestPlugin/testplugin.cpp | 2 ++ 9 files changed, 4 insertions(+), 44 deletions(-) diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index 81b704967..3deb44675 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -780,17 +780,6 @@ void BrowserWindow::toggleTabsOnTop(bool enable) m_navigationContainer->toggleTabsOnTop(enable); } -void BrowserWindow::toggleCaretBrowsing() -{ -#if QTWEBENGINE_DISABLED - bool enable = !QWebEngineSettings::globalSettings()->testAttribute(QWebEngineSettings::CaretBrowsingEnabled); - - Settings().setValue("Web-Browser-Settings/CaretBrowsing", enable); - - QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::CaretBrowsingEnabled, enable); -#endif -} - void BrowserWindow::toggleFullScreen() { if (isFullScreen()) { diff --git a/src/lib/app/browserwindow.h b/src/lib/app/browserwindow.h index 3932858b2..971658457 100644 --- a/src/lib/app/browserwindow.h +++ b/src/lib/app/browserwindow.h @@ -129,7 +129,6 @@ public slots: void toggleShowNavigationToolbar(); void toggleTabsOnTop(bool enable); - void toggleCaretBrowsing(); void toggleFullScreen(); void toggleOfflineMode(); diff --git a/src/lib/app/mainmenu.cpp b/src/lib/app/mainmenu.cpp index 5e2826801..e7e714348 100644 --- a/src/lib/app/mainmenu.cpp +++ b/src/lib/app/mainmenu.cpp @@ -282,11 +282,6 @@ void MainMenu::zoomReset() } } -void MainMenu::toggleCaretBrowsing() -{ - callSlot("toggleCaretBrowsing"); -} - void MainMenu::showPageSource() { callSlot("showSource"); @@ -400,10 +395,6 @@ void MainMenu::aboutToShowViewMenu() m_actions[QSL("View/ShowStatusBar")]->setChecked(m_window->statusBar()->isVisible()); m_actions[QSL("View/FullScreen")]->setChecked(m_window->isFullScreen()); m_actions[QSL("View/PageSource")]->setEnabled(true); - -#if QTWEBENGINE_DISABLED - m_actions[QSL("View/CaretBrowsing")]->setChecked(m_window->weView()->settings()->testAttribute(QWebEngineSettings::CaretBrowsingEnabled)); -#endif } void MainMenu::aboutToHideViewMenu() @@ -596,7 +587,6 @@ void MainMenu::init() ADD_ACTION("View/ZoomOut", m_menuView, QIcon::fromTheme(QSL("zoom-out")), tr("Zoom &Out"), SLOT(zoomOut()), "Ctrl+-"); ADD_ACTION("View/ZoomReset", m_menuView, QIcon::fromTheme(QSL("zoom-original")), tr("Reset"), SLOT(zoomReset()), "Ctrl+0"); m_menuView->addSeparator(); - ADD_CHECKABLE_ACTION("View/CaretBrowsing", m_menuView, QIcon(), tr("&Caret Browsing"), SLOT(toggleCaretBrowsing()), "F7"); m_menuView->addMenu(encodingMenu); m_menuView->addSeparator(); ADD_ACTION("View/PageSource", m_menuView, QIcon::fromTheme(QSL("text-html")), tr("&Page Source"), SLOT(showPageSource()), "Ctrl+U"); @@ -670,10 +660,6 @@ void MainMenu::init() m_menuTools->addAction(m_actions[QSL("Standard/Preferences")]); #endif -#ifndef QTWEBKIT_FROM_2_3 - m_actions[QSL("View/CaretBrowsing")]->setVisible(false); -#endif - // Menus are hidden by default aboutToHideFileMenu(); aboutToHideViewMenu(); diff --git a/src/lib/app/mainmenu.h b/src/lib/app/mainmenu.h index 02ed8ef95..bedc6983f 100644 --- a/src/lib/app/mainmenu.h +++ b/src/lib/app/mainmenu.h @@ -80,7 +80,6 @@ private slots: void zoomIn(); void zoomOut(); void zoomReset(); - void toggleCaretBrowsing(); void showPageSource(); void showFullScreen(); diff --git a/src/lib/other/macmenureceiver.cpp b/src/lib/other/macmenureceiver.cpp index 15eee379c..aca09f6cd 100644 --- a/src/lib/other/macmenureceiver.cpp +++ b/src/lib/other/macmenureceiver.cpp @@ -304,11 +304,6 @@ void MacMenuReceiver::changeEncoding(QObject* obj) callSlot("changeEncoding", false, Q_ARG(QObject*, obj)); } -void MacMenuReceiver::triggerCaretBrowsing() -{ - callSlot("triggerCaretBrowsing"); -} - void MacMenuReceiver::triggerTabsOnTop(bool enable) { callSlot("triggerTabsOnTop", false, Q_ARG(bool, enable)); diff --git a/src/lib/other/macmenureceiver.h b/src/lib/other/macmenureceiver.h index 9dd3f2c57..286f4d5b2 100644 --- a/src/lib/other/macmenureceiver.h +++ b/src/lib/other/macmenureceiver.h @@ -120,7 +120,6 @@ private slots: void toggleFullScreen(); void changeEncoding(QObject* obj = 0); - void triggerCaretBrowsing(); void triggerTabsOnTop(bool enable); void closeWindow(); diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index 87d9f37a1..ad84b0833 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -281,7 +281,6 @@ Preferences::Preferences(BrowserWindow* window, QWidget* parent) ui->linksInFocusChain->setChecked(settings.value("IncludeLinkInFocusChain", false).toBool()); ui->zoomTextOnly->setChecked(settings.value("zoomTextOnly", false).toBool()); ui->spatialNavigation->setChecked(settings.value("SpatialNavigation", false).toBool()); - ui->caretBrowsing->setChecked(settings.value("CaretBrowsing", false).toBool()); ui->animateScrolling->setChecked(settings.value("AnimateScrolling", true).toBool()); ui->printEBackground->setChecked(settings.value("PrintElementBackground", true).toBool()); ui->wheelScroll->setValue(settings.value("wheelScrollLines", qApp->wheelScrollLines()).toInt()); @@ -981,7 +980,6 @@ void Preferences::saveSettings() settings.setValue("IncludeLinkInFocusChain", ui->linksInFocusChain->isChecked()); settings.setValue("zoomTextOnly", ui->zoomTextOnly->isChecked()); settings.setValue("SpatialNavigation", ui->spatialNavigation->isChecked()); - settings.setValue("CaretBrowsing", ui->caretBrowsing->isChecked()); settings.setValue("AnimateScrolling", ui->animateScrolling->isChecked()); settings.setValue("PrintElementBackground", ui->printEBackground->isChecked()); settings.setValue("wheelScrollLines", ui->wheelScroll->value()); diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index 300475d3e..98d8eb538 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -140,8 +140,8 @@ 0 0 - 602 - 466 + 596 + 470 @@ -1152,13 +1152,6 @@ - - - - Enable caret browsing - - - diff --git a/src/plugins/TestPlugin/testplugin.cpp b/src/plugins/TestPlugin/testplugin.cpp index 23945d8ec..45ab8b6d4 100644 --- a/src/plugins/TestPlugin/testplugin.cpp +++ b/src/plugins/TestPlugin/testplugin.cpp @@ -141,6 +141,8 @@ void TestPlugin::showSettings(QWidget* parent) void TestPlugin::populateWebViewMenu(QMenu* menu, WebView* view, const QWebHitTestResult &r) { + Q_UNUSED(r) + // Called from WebView when creating context menu m_view = view;