diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2014-10-22 14:47:04 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2014-10-22 16:07:53 +0200 |
commit | 0fb6e31c20813e564126dc27c0ed434f2f372daf (patch) | |
tree | 3576a774551e33400e1741752d122ac6c608d80c /src/plugins/help/localhelpmanager.cpp | |
parent | 6f570684e04cb7f10b6636868a7c3e4a34862a71 (diff) |
Help: Save home page in Qt Creator settings instead of help collection
And do not save the default page anywhere at all.
This simplifies the logic, and makes the setting independent of help
engine initialization.
Change-Id: I264903229e274a0bf25c18b33734d36432aa525f
Task-number: QTCREATORBUG-13198
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/help/localhelpmanager.cpp')
-rw-r--r-- | src/plugins/help/localhelpmanager.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/plugins/help/localhelpmanager.cpp b/src/plugins/help/localhelpmanager.cpp index 38107951f41..9bbe007456f 100644 --- a/src/plugins/help/localhelpmanager.cpp +++ b/src/plugins/help/localhelpmanager.cpp @@ -35,6 +35,7 @@ #include "helpviewer.h" #include <app/app_version.h> +#include <coreplugin/icore.h> #include <coreplugin/helpmanager.h> #include <utils/qtcassert.h> @@ -56,6 +57,8 @@ QStandardItemModel *LocalHelpManager::m_filterModel = 0; QString LocalHelpManager::m_currentFilter = QString(); int LocalHelpManager::m_currentFilterIndex = -1; +static char kHelpHomePageKey[] = "Help/HomePage"; + LocalHelpManager::LocalHelpManager(QObject *parent) : QObject(parent) , m_guiNeedsSetup(true) @@ -83,6 +86,25 @@ LocalHelpManager *LocalHelpManager::instance() return m_instance; } +QString LocalHelpManager::defaultHomePage() +{ + static const QString url = QString::fromLatin1("qthelp://org.qt-project.qtcreator." + "%1%2%3/doc/index.html").arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR) + .arg(IDE_VERSION_RELEASE); + return url; +} + +QString LocalHelpManager::homePage() +{ + return Core::ICore::settings()->value(QLatin1String(kHelpHomePageKey), + defaultHomePage()).toString(); +} + +void LocalHelpManager::setHomePage(const QString &page) +{ + Core::ICore::settings()->setValue(QLatin1String(kHelpHomePageKey), page); +} + void LocalHelpManager::setupGuiHelpEngine() { if (m_needsCollectionFile) { @@ -120,10 +142,6 @@ BookmarkManager& LocalHelpManager::bookmarkManager() if (!m_bookmarkManager) { m_bookmarkManager = new BookmarkManager; m_bookmarkManager->setupBookmarkModels(); - const QString &url = QString::fromLatin1("qthelp://org.qt-project.qtcreator." - "%1%2%3/doc/index.html").arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR) - .arg(IDE_VERSION_RELEASE); - helpEngine().setCustomValue(QLatin1String("DefaultHomePage"), url); } } return *m_bookmarkManager; |