From 5123f48b0a53ade2ee5a0e2d78944c35101fcafd Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Tue, 12 May 2009 19:46:40 +0200
Subject: [PATCH] Register as handler for qthelp://, remove obsolete started
 action slot.

---
 src/plugins/help/helpplugin.cpp | 9 ++++-----
 src/plugins/help/helpplugin.h   | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 84147647f80..6440d483422 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -356,6 +356,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
 
     createRightPaneSideBar();
 
+    QDesktopServices::setUrlHandler("qthelp", this, "openHelpPage");
+
     return true;
 }
 
@@ -523,7 +525,6 @@ void HelpPlugin::extensionsInitialized()
     m_bookmarkManager->setupBookmarkModels();
 
     if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(m_core->modeManager()->mode(Core::Constants::MODE_WELCOME))) {
-        connect(welcomeMode, SIGNAL(requestHelp()), this, SLOT(openGettingStarted()));
         connect(welcomeMode, SIGNAL(openHelpPage(const QString&)), this, SLOT(openHelpPage(const QString&)));
     }
 }
@@ -722,11 +723,9 @@ void HelpPlugin::addNewBookmark(const QString &title, const QString &url)
     m_bookmarkManager->showBookmarkDialog(m_centralWidget, title, url);
 }
 
-void HelpPlugin::openGettingStarted()
+void HelpPlugin::openHelpPage(const QUrl& url)
 {
-    openHelpPage(
-        QString("qthelp://com.nokia.qtcreator.%1%2/doc/index.html")
-        .arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR));
+    openHelpPage(url.toString());
 }
 
 void HelpPlugin::openHelpPage(const QString& url)
diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h
index fae6172e321..316d3742c2d 100644
--- a/src/plugins/help/helpplugin.h
+++ b/src/plugins/help/helpplugin.h
@@ -128,7 +128,7 @@ private slots:
     void slotHideRightPane();
     void copyFromSideBar();
 
-    void openGettingStarted();
+    void openHelpPage(const QUrl& url);
     void openHelpPage(const QString& url);
 
 private:
-- 
GitLab