From bbe0cd68fa589f45a90f8f25820601e19a7d14c3 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 23 Jan 2019 16:27:29 +0100 Subject: [PATCH] Help: Remove unused method and related code Change-Id: I4c4641290eceb441339cc237ee74a52c1018e3ae Reviewed-by: David Schulz --- src/plugins/help/helpplugin.cpp | 25 +++---------------------- src/plugins/help/helpviewer.h | 1 - src/plugins/help/macwebkithelpviewer.h | 1 - 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index c91e739b1b9..20dc5f13928 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -131,7 +131,6 @@ public: void setupHelpEngineIfNeeded(); - void highlightSearchTermsInContextHelp(); HelpViewer *showHelpUrl(const QUrl &url, Core::HelpManager::HelpViewerLocation location); void slotSystemInformation(); @@ -164,8 +163,6 @@ public: LocalHelpManager m_localHelpManager; OpenPagesManager m_openPagesManager; - QString m_contextHelpHighlightId; - QPointer m_externalWindow; QRect m_externalWindowState; @@ -408,8 +405,6 @@ HelpWidget *HelpPluginPrivate::createHelpWidget(const Context &context, HelpWidg { auto widget = new HelpWidget(context, style); - connect(widget->currentViewer(), &HelpViewer::loadFinished, - this, &HelpPluginPrivate::highlightSearchTermsInContextHelp); connect(widget, &HelpWidget::openHelpMode, this, [this](const QUrl &url) { showHelpUrl(url, Core::HelpManager::HelpModeAlways); }); @@ -624,10 +619,8 @@ HelpViewer *HelpPluginPrivate::viewerForContextHelp() return viewerForHelpViewerLocation(LocalHelpManager::contextHelpOption()); } -static QUrl findBestLink(const QMap &links, QString *highlightId) +static QUrl findBestLink(const QMap &links) { - if (highlightId) - highlightId->clear(); if (links.isEmpty()) return QUrl(); QUrl source = links.constBegin().value(); @@ -643,8 +636,6 @@ static QUrl findBestLink(const QMap &links, QString *highlightId) if (tmpVersion > version) { source = link; version = tmpVersion; - if (highlightId) - *highlightId = source.fragment(); } } } @@ -670,7 +661,7 @@ void HelpPluginPrivate::showContextHelp(const QString &contextHelpId) if (links.isEmpty() && LocalHelpManager::isValidUrl(contextHelpId)) links.insert(contextHelpId, contextHelpId); - QUrl source = findBestLink(links, &m_contextHelpHighlightId); + QUrl source = findBestLink(links); if (!source.isValid()) { // No link found or no context object HelpViewer *viewer = showHelpUrl(QUrl(Help::Constants::AboutBlank), @@ -688,7 +679,7 @@ void HelpPluginPrivate::showContextHelp(const QString &contextHelpId) .arg(HelpPlugin::tr("No documentation available."))); } } else { - showHelpUrl(source, LocalHelpManager::contextHelpOption()); // triggers loadFinished which triggers id highlighting + showHelpUrl(source, LocalHelpManager::contextHelpOption()); } } @@ -704,16 +695,6 @@ void HelpPluginPrivate::activateContents() m_centralWidget->activateSideBarItem(Constants::HELP_CONTENTS); } -void HelpPluginPrivate::highlightSearchTermsInContextHelp() -{ - if (m_contextHelpHighlightId.isEmpty()) - return; - HelpViewer *viewer = viewerForContextHelp(); - QTC_ASSERT(viewer, return); - viewer->highlightId(m_contextHelpHighlightId); - m_contextHelpHighlightId.clear(); -} - HelpViewer *HelpPluginPrivate::showHelpUrl(const QUrl &url, Core::HelpManager::HelpViewerLocation location) { static const QString qtcreatorUnversionedID = "org.qt-project.qtcreator"; diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h index 9369fd72ca0..0a24fb7222d 100644 --- a/src/plugins/help/helpviewer.h +++ b/src/plugins/help/helpviewer.h @@ -62,7 +62,6 @@ public: virtual QUrl source() const = 0; // metacall in HelpPlugin::updateSideBarSource Q_INVOKABLE virtual void setSource(const QUrl &url) = 0; - virtual void highlightId(const QString &id) { Q_UNUSED(id) } virtual void setHtml(const QString &html) = 0; diff --git a/src/plugins/help/macwebkithelpviewer.h b/src/plugins/help/macwebkithelpviewer.h index 82bc8570194..1d1990ad331 100644 --- a/src/plugins/help/macwebkithelpviewer.h +++ b/src/plugins/help/macwebkithelpviewer.h @@ -81,7 +81,6 @@ public: QUrl source() const override; void setSource(const QUrl &url) override; void scrollToAnchor(const QString &anchor); - void highlightId(const QString &id) override { Q_UNUSED(id) } void setHtml(const QString &html) override;