diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 13a6b13ecbde575d18352c42d32c94803c73dad8..7bec07881e83853c67bf7b5f9b00fcf8d95f2165 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -407,6 +407,11 @@ void HelpPlugin::createRightPaneSideBar() << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR), this)); + connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this, + SLOT(updateSideBarSource(QUrl))); + connect(m_centralWidget, SIGNAL(currentViewerChanged()), this, + SLOT(updateSideBarSource())); + QAction *copyActionSideBar = new QAction(this); Core::Command *cmd = m_core->actionManager()->registerAction(copyActionSideBar, Core::Constants::COPY, QList<int>() @@ -565,6 +570,19 @@ void HelpPlugin::openContextHelpPage(const QString &url) m_helpViewerForSideBar->setSource(QUrl(url)); } +void HelpPlugin::updateSideBarSource() +{ + const QUrl &url = m_centralWidget->currentSource(); + if (url.isValid()) + updateSideBarSource(url); +} + +void HelpPlugin::updateSideBarSource(const QUrl &newUrl) +{ + if (m_helpViewerForSideBar) + m_helpViewerForSideBar->setSource(newUrl); +} + void HelpPlugin::activateContext() { using namespace Core; diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h index b66765177bd89b5703948834291e919063eb4444..f95e0f0ece41c4bbd1707694ba38cb4fc3be4a6c 100644 --- a/src/plugins/help/helpplugin.h +++ b/src/plugins/help/helpplugin.h @@ -132,6 +132,9 @@ private slots: void openHelpPage(const QString& url); void openContextHelpPage(const QString &url); + void updateSideBarSource(); + void updateSideBarSource(const QUrl &newUrl); + private: QToolBar *createToolBar(); void createRightPaneSideBar();