forked from qt-creator/qt-creator
Help: Remove unused method and related code
Change-Id: I4c4641290eceb441339cc237ee74a52c1018e3ae Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -131,7 +131,6 @@ public:
|
|||||||
|
|
||||||
void setupHelpEngineIfNeeded();
|
void setupHelpEngineIfNeeded();
|
||||||
|
|
||||||
void highlightSearchTermsInContextHelp();
|
|
||||||
HelpViewer *showHelpUrl(const QUrl &url, Core::HelpManager::HelpViewerLocation location);
|
HelpViewer *showHelpUrl(const QUrl &url, Core::HelpManager::HelpViewerLocation location);
|
||||||
|
|
||||||
void slotSystemInformation();
|
void slotSystemInformation();
|
||||||
@@ -164,8 +163,6 @@ public:
|
|||||||
LocalHelpManager m_localHelpManager;
|
LocalHelpManager m_localHelpManager;
|
||||||
OpenPagesManager m_openPagesManager;
|
OpenPagesManager m_openPagesManager;
|
||||||
|
|
||||||
QString m_contextHelpHighlightId;
|
|
||||||
|
|
||||||
QPointer<HelpWidget> m_externalWindow;
|
QPointer<HelpWidget> m_externalWindow;
|
||||||
QRect m_externalWindowState;
|
QRect m_externalWindowState;
|
||||||
|
|
||||||
@@ -408,8 +405,6 @@ HelpWidget *HelpPluginPrivate::createHelpWidget(const Context &context, HelpWidg
|
|||||||
{
|
{
|
||||||
auto widget = new HelpWidget(context, style);
|
auto widget = new HelpWidget(context, style);
|
||||||
|
|
||||||
connect(widget->currentViewer(), &HelpViewer::loadFinished,
|
|
||||||
this, &HelpPluginPrivate::highlightSearchTermsInContextHelp);
|
|
||||||
connect(widget, &HelpWidget::openHelpMode, this, [this](const QUrl &url) {
|
connect(widget, &HelpWidget::openHelpMode, this, [this](const QUrl &url) {
|
||||||
showHelpUrl(url, Core::HelpManager::HelpModeAlways);
|
showHelpUrl(url, Core::HelpManager::HelpModeAlways);
|
||||||
});
|
});
|
||||||
@@ -624,10 +619,8 @@ HelpViewer *HelpPluginPrivate::viewerForContextHelp()
|
|||||||
return viewerForHelpViewerLocation(LocalHelpManager::contextHelpOption());
|
return viewerForHelpViewerLocation(LocalHelpManager::contextHelpOption());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QUrl findBestLink(const QMap<QString, QUrl> &links, QString *highlightId)
|
static QUrl findBestLink(const QMap<QString, QUrl> &links)
|
||||||
{
|
{
|
||||||
if (highlightId)
|
|
||||||
highlightId->clear();
|
|
||||||
if (links.isEmpty())
|
if (links.isEmpty())
|
||||||
return QUrl();
|
return QUrl();
|
||||||
QUrl source = links.constBegin().value();
|
QUrl source = links.constBegin().value();
|
||||||
@@ -643,8 +636,6 @@ static QUrl findBestLink(const QMap<QString, QUrl> &links, QString *highlightId)
|
|||||||
if (tmpVersion > version) {
|
if (tmpVersion > version) {
|
||||||
source = link;
|
source = link;
|
||||||
version = tmpVersion;
|
version = tmpVersion;
|
||||||
if (highlightId)
|
|
||||||
*highlightId = source.fragment();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -670,7 +661,7 @@ void HelpPluginPrivate::showContextHelp(const QString &contextHelpId)
|
|||||||
if (links.isEmpty() && LocalHelpManager::isValidUrl(contextHelpId))
|
if (links.isEmpty() && LocalHelpManager::isValidUrl(contextHelpId))
|
||||||
links.insert(contextHelpId, contextHelpId);
|
links.insert(contextHelpId, contextHelpId);
|
||||||
|
|
||||||
QUrl source = findBestLink(links, &m_contextHelpHighlightId);
|
QUrl source = findBestLink(links);
|
||||||
if (!source.isValid()) {
|
if (!source.isValid()) {
|
||||||
// No link found or no context object
|
// No link found or no context object
|
||||||
HelpViewer *viewer = showHelpUrl(QUrl(Help::Constants::AboutBlank),
|
HelpViewer *viewer = showHelpUrl(QUrl(Help::Constants::AboutBlank),
|
||||||
@@ -688,7 +679,7 @@ void HelpPluginPrivate::showContextHelp(const QString &contextHelpId)
|
|||||||
.arg(HelpPlugin::tr("No documentation available.")));
|
.arg(HelpPlugin::tr("No documentation available.")));
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
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)
|
HelpViewer *HelpPluginPrivate::showHelpUrl(const QUrl &url, Core::HelpManager::HelpViewerLocation location)
|
||||||
{
|
{
|
||||||
static const QString qtcreatorUnversionedID = "org.qt-project.qtcreator";
|
static const QString qtcreatorUnversionedID = "org.qt-project.qtcreator";
|
||||||
|
@@ -62,7 +62,6 @@ public:
|
|||||||
virtual QUrl source() const = 0;
|
virtual QUrl source() const = 0;
|
||||||
// metacall in HelpPlugin::updateSideBarSource
|
// metacall in HelpPlugin::updateSideBarSource
|
||||||
Q_INVOKABLE virtual void setSource(const QUrl &url) = 0;
|
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;
|
virtual void setHtml(const QString &html) = 0;
|
||||||
|
|
||||||
|
@@ -81,7 +81,6 @@ public:
|
|||||||
QUrl source() const override;
|
QUrl source() const override;
|
||||||
void setSource(const QUrl &url) override;
|
void setSource(const QUrl &url) override;
|
||||||
void scrollToAnchor(const QString &anchor);
|
void scrollToAnchor(const QString &anchor);
|
||||||
void highlightId(const QString &id) override { Q_UNUSED(id) }
|
|
||||||
|
|
||||||
void setHtml(const QString &html) override;
|
void setHtml(const QString &html) override;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user