From 0985f9c1c48e07a1f89eda1e53027ce99cfec595 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 16 Nov 2010 14:15:23 +0100 Subject: Fix ambiguity with help manager by renaming the file to match class. Task-number: QTCREATORBUG-3090 Reviewed-by: ck --- src/plugins/help/centralwidget.cpp | 2 +- src/plugins/help/generalsettingspage.cpp | 2 +- src/plugins/help/help.pro | 4 +- src/plugins/help/helpmanager.cpp | 111 --------------------- src/plugins/help/helpmanager.h | 70 ------------- src/plugins/help/helpplugin.cpp | 2 +- src/plugins/help/helpviewer.cpp | 2 +- src/plugins/help/helpviewer_qtb.cpp | 2 +- src/plugins/help/helpviewer_qwv.cpp | 2 +- src/plugins/help/localhelpmanager.cpp | 111 +++++++++++++++++++++ src/plugins/help/localhelpmanager.h | 70 +++++++++++++ src/plugins/help/openpagesmanager.cpp | 2 +- src/plugins/help/searchwidget.cpp | 2 +- src/plugins/qt4projectmanager/qtversionmanager.cpp | 1 - 14 files changed, 191 insertions(+), 192 deletions(-) delete mode 100644 src/plugins/help/helpmanager.cpp delete mode 100644 src/plugins/help/helpmanager.h create mode 100644 src/plugins/help/localhelpmanager.cpp create mode 100644 src/plugins/help/localhelpmanager.h (limited to 'src/plugins') diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index 34e234e1f9..89bf1fea44 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -29,8 +29,8 @@ #include "centralwidget.h" -#include "helpmanager.h" #include "helpviewer.h" +#include "localhelpmanager.h" #include "topicchooser.h" #include diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp index 04eccbc02b..dc4daff803 100644 --- a/src/plugins/help/generalsettingspage.cpp +++ b/src/plugins/help/generalsettingspage.cpp @@ -32,8 +32,8 @@ #include "bookmarkmanager.h" #include "centralwidget.h" #include "helpconstants.h" -#include "helpmanager.h" #include "helpviewer.h" +#include "localhelpmanager.h" #include "xbelsupport.h" #include diff --git a/src/plugins/help/help.pro b/src/plugins/help/help.pro index a52de6ff3b..c5616d2df1 100644 --- a/src/plugins/help/help.pro +++ b/src/plugins/help/help.pro @@ -19,7 +19,7 @@ HEADERS += \ helpconstants.h \ helpfindsupport.h \ helpindexfilter.h \ - helpmanager.h \ + localhelpmanager.h \ helpmode.h \ helpplugin.h \ helpviewer.h \ @@ -40,7 +40,7 @@ SOURCES += \ generalsettingspage.cpp \ helpfindsupport.cpp \ helpindexfilter.cpp \ - helpmanager.cpp \ + localhelpmanager.cpp \ helpmode.cpp \ helpplugin.cpp \ helpviewer.cpp \ diff --git a/src/plugins/help/helpmanager.cpp b/src/plugins/help/helpmanager.cpp deleted file mode 100644 index 10f4197ab9..0000000000 --- a/src/plugins/help/helpmanager.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "helpmanager.h" -#include "bookmarkmanager.h" - -#include -#include - -#include - -#include - -using namespace Help::Internal; - -QMutex LocalHelpManager::m_guiMutex; -QHelpEngine* LocalHelpManager::m_guiEngine = 0; - -QMutex LocalHelpManager::m_bkmarkMutex; -BookmarkManager* LocalHelpManager::m_bookmarkManager = 0; - -LocalHelpManager::LocalHelpManager(QObject *parent) - : QObject(parent) - , m_guiNeedsSetup(true) - , m_needsCollectionFile(true) -{ -} - -LocalHelpManager::~LocalHelpManager() -{ - if (m_bookmarkManager) { - m_bookmarkManager->saveBookmarks(); - delete m_bookmarkManager; - m_bookmarkManager = 0; - } - - delete m_guiEngine; - m_guiEngine = 0; -} - -void LocalHelpManager::setupGuiHelpEngine() -{ - if (m_needsCollectionFile) { - m_needsCollectionFile = false; - helpEngine().setCollectionFile(Core::HelpManager::collectionFilePath()); - } - - if (m_guiNeedsSetup) { - m_guiNeedsSetup = false; - helpEngine().setupData(); - } -} - -void LocalHelpManager::setEngineNeedsUpdate() -{ - m_guiNeedsSetup = true; -} - -QHelpEngine &LocalHelpManager::helpEngine() -{ - if (!m_guiEngine) { - QMutexLocker _(&m_guiMutex); - if (!m_guiEngine) { - m_guiEngine = new QHelpEngine(""); - m_guiEngine->setAutoSaveFilter(false); - } - } - return *m_guiEngine; -} - -BookmarkManager& LocalHelpManager::bookmarkManager() -{ - if (!m_bookmarkManager) { - QMutexLocker _(&m_bkmarkMutex); - if (!m_bookmarkManager) { - m_bookmarkManager = new BookmarkManager; - m_bookmarkManager->setupBookmarkModels(); - const QString &url = QString::fromLatin1("qthelp://com.nokia.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; -} diff --git a/src/plugins/help/helpmanager.h b/src/plugins/help/helpmanager.h deleted file mode 100644 index 3dc333d405..0000000000 --- a/src/plugins/help/helpmanager.h +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef LOCALHELPMANAGER_H -#define LOCALHELPMANAGER_H - -#include -#include - -QT_FORWARD_DECLARE_CLASS(QHelpEngine) - -class BookmarkManager; - -namespace Help { - namespace Internal { - -class LocalHelpManager : public QObject -{ - Q_OBJECT - -public: - LocalHelpManager(QObject *parent = 0); - ~LocalHelpManager(); - - void setupGuiHelpEngine(); - void setEngineNeedsUpdate(); - - static QHelpEngine& helpEngine(); - static BookmarkManager& bookmarkManager(); - -private: - bool m_guiNeedsSetup; - bool m_needsCollectionFile; - - static QMutex m_guiMutex; - static QHelpEngine *m_guiEngine; - - static QMutex m_bkmarkMutex; - static BookmarkManager *m_bookmarkManager; -}; - } // Internal -} // Help - -#endif // LOCALHELPMANAGER_H diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 5a7b6fe567..b51cb16f68 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -39,10 +39,10 @@ #include "helpconstants.h" #include "helpfindsupport.h" #include "helpindexfilter.h" -#include "helpmanager.h" #include "helpmode.h" #include "helpviewer.h" #include "indexwindow.h" +#include "localhelpmanager.h" #include "openpagesmanager.h" #include "openpagesmodel.h" #include "remotehelpfilter.h" diff --git a/src/plugins/help/helpviewer.cpp b/src/plugins/help/helpviewer.cpp index 15a53da81c..fe0799b0e4 100644 --- a/src/plugins/help/helpviewer.cpp +++ b/src/plugins/help/helpviewer.cpp @@ -29,7 +29,7 @@ #include "helpviewer.h" #include "helpconstants.h" -#include "helpmanager.h" +#include "localhelpmanager.h" #include #include diff --git a/src/plugins/help/helpviewer_qtb.cpp b/src/plugins/help/helpviewer_qtb.cpp index 7cef9c543c..34e233efd2 100644 --- a/src/plugins/help/helpviewer_qtb.cpp +++ b/src/plugins/help/helpviewer_qtb.cpp @@ -33,7 +33,7 @@ #include "helpconstants.h" #include "helpviewer_p.h" -#include "helpmanager.h" +#include "localhelpmanager.h" #include #include diff --git a/src/plugins/help/helpviewer_qwv.cpp b/src/plugins/help/helpviewer_qwv.cpp index 993afb09a1..402160cf67 100644 --- a/src/plugins/help/helpviewer_qwv.cpp +++ b/src/plugins/help/helpviewer_qwv.cpp @@ -33,7 +33,7 @@ #include "centralwidget.h" #include "helpconstants.h" -#include "helpmanager.h" +#include "localhelpmanager.h" #include "openpagesmanager.h" #include diff --git a/src/plugins/help/localhelpmanager.cpp b/src/plugins/help/localhelpmanager.cpp new file mode 100644 index 0000000000..b1eef36e67 --- /dev/null +++ b/src/plugins/help/localhelpmanager.cpp @@ -0,0 +1,111 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#include "localhelpmanager.h" +#include "bookmarkmanager.h" + +#include +#include + +#include + +#include + +using namespace Help::Internal; + +QMutex LocalHelpManager::m_guiMutex; +QHelpEngine* LocalHelpManager::m_guiEngine = 0; + +QMutex LocalHelpManager::m_bkmarkMutex; +BookmarkManager* LocalHelpManager::m_bookmarkManager = 0; + +LocalHelpManager::LocalHelpManager(QObject *parent) + : QObject(parent) + , m_guiNeedsSetup(true) + , m_needsCollectionFile(true) +{ +} + +LocalHelpManager::~LocalHelpManager() +{ + if (m_bookmarkManager) { + m_bookmarkManager->saveBookmarks(); + delete m_bookmarkManager; + m_bookmarkManager = 0; + } + + delete m_guiEngine; + m_guiEngine = 0; +} + +void LocalHelpManager::setupGuiHelpEngine() +{ + if (m_needsCollectionFile) { + m_needsCollectionFile = false; + helpEngine().setCollectionFile(Core::HelpManager::collectionFilePath()); + } + + if (m_guiNeedsSetup) { + m_guiNeedsSetup = false; + helpEngine().setupData(); + } +} + +void LocalHelpManager::setEngineNeedsUpdate() +{ + m_guiNeedsSetup = true; +} + +QHelpEngine &LocalHelpManager::helpEngine() +{ + if (!m_guiEngine) { + QMutexLocker _(&m_guiMutex); + if (!m_guiEngine) { + m_guiEngine = new QHelpEngine(""); + m_guiEngine->setAutoSaveFilter(false); + } + } + return *m_guiEngine; +} + +BookmarkManager& LocalHelpManager::bookmarkManager() +{ + if (!m_bookmarkManager) { + QMutexLocker _(&m_bkmarkMutex); + if (!m_bookmarkManager) { + m_bookmarkManager = new BookmarkManager; + m_bookmarkManager->setupBookmarkModels(); + const QString &url = QString::fromLatin1("qthelp://com.nokia.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; +} diff --git a/src/plugins/help/localhelpmanager.h b/src/plugins/help/localhelpmanager.h new file mode 100644 index 0000000000..3dc333d405 --- /dev/null +++ b/src/plugins/help/localhelpmanager.h @@ -0,0 +1,70 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef LOCALHELPMANAGER_H +#define LOCALHELPMANAGER_H + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QHelpEngine) + +class BookmarkManager; + +namespace Help { + namespace Internal { + +class LocalHelpManager : public QObject +{ + Q_OBJECT + +public: + LocalHelpManager(QObject *parent = 0); + ~LocalHelpManager(); + + void setupGuiHelpEngine(); + void setEngineNeedsUpdate(); + + static QHelpEngine& helpEngine(); + static BookmarkManager& bookmarkManager(); + +private: + bool m_guiNeedsSetup; + bool m_needsCollectionFile; + + static QMutex m_guiMutex; + static QHelpEngine *m_guiEngine; + + static QMutex m_bkmarkMutex; + static BookmarkManager *m_bookmarkManager; +}; + } // Internal +} // Help + +#endif // LOCALHELPMANAGER_H diff --git a/src/plugins/help/openpagesmanager.cpp b/src/plugins/help/openpagesmanager.cpp index fb602b9798..d1be11c00d 100644 --- a/src/plugins/help/openpagesmanager.cpp +++ b/src/plugins/help/openpagesmanager.cpp @@ -31,8 +31,8 @@ #include "centralwidget.h" #include "helpconstants.h" -#include "helpmanager.h" #include "helpviewer.h" +#include "localhelpmanager.h" #include "openpagesmodel.h" #include "openpagesswitcher.h" #include "openpageswidget.h" diff --git a/src/plugins/help/searchwidget.cpp b/src/plugins/help/searchwidget.cpp index b24889248d..b491abeef5 100644 --- a/src/plugins/help/searchwidget.cpp +++ b/src/plugins/help/searchwidget.cpp @@ -28,7 +28,7 @@ **************************************************************************/ #include "searchwidget.h" -#include "helpmanager.h" +#include "localhelpmanager.h" #include "openpagesmanager.h" #include diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 08317057d4..ff9fb7ad4d 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #ifdef Q_OS_WIN # include -- cgit v1.2.1