diff options
author | hjk <qtc-committer@nokia.com> | 2009-01-20 15:31:33 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2009-01-20 15:31:33 +0100 |
commit | 897c05f57c64d07c1361c7170495641ece42c7c3 (patch) | |
tree | 8ccf5b7874d25af2bc47a3fb6ea1cb63b93a6a72 /src/plugins/qt4projectmanager | |
parent | 67437acf498fe74baadd07a59a8180dca8314f43 (diff) | |
download | qt-creator-897c05f57c64d07c1361c7170495641ece42c7c3.tar.gz |
replace Core::ICore::instance()->pluginManager() by ExtensionSystem::PluginManager::instance()
Diffstat (limited to 'src/plugins/qt4projectmanager')
14 files changed, 64 insertions, 82 deletions
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index e771109d06..a8fdc907cd 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -381,9 +381,10 @@ void Qt4Project::updateCodeModel() qDebug()<<"Qt4Project::updateCodeModel()"; CppTools::CppModelManagerInterface *modelmanager = - m_manager->pluginManager()->getObject<CppTools::CppModelManagerInterface>(); + ExtensionSystem::PluginManager::instance() + ->getObject<CppTools::CppModelManagerInterface>(); - if (! modelmanager) + if (!modelmanager) return; QStringList allIncludePaths; @@ -644,7 +645,7 @@ void Qt4Project::newBuildConfiguration(const QString &buildConfiguration) void Qt4Project::proFileParseError(const QString &errorMessage) { - m_manager->core()->messageManager()->printToOutputPane(errorMessage); + Core::ICore::instance()->messageManager()->printToOutputPane(errorMessage); } Qt4ProFileNode *Qt4Project::rootProjectNode() const diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index 35fd609b11..8d44d81df2 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -54,13 +54,13 @@ #include <projectexplorer/projectexplorerconstants.h> #include <utils/listutils.h> -#include <QtCore/QVariant> -#include <QtCore/QFileInfo> -#include <QtCore/QDir> #include <QtCore/QCoreApplication> +#include <QtCore/QDir> +#include <QtCore/QFileInfo> #include <QtCore/QLinkedList> -#include <QtGui/QMenu> +#include <QtCore/QVariant> #include <QtGui/QFileDialog> +#include <QtGui/QMenu> #include <QtGui/QMessageBox> using namespace Qt4ProjectManager; @@ -82,15 +82,14 @@ static const char* qt4FileTypes[] = { "Qt4ResourceFiles" }; -Qt4Manager::Qt4Manager(Qt4ProjectManagerPlugin *plugin, Core::ICore *core) : - m_mimeType(QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)), +Qt4Manager::Qt4Manager(Qt4ProjectManagerPlugin *plugin) + : m_mimeType(QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)), m_plugin(plugin), - m_core(core), m_projectExplorer(0), m_contextProject(0), m_languageID(0) { - m_languageID = m_core->uniqueIDManager()-> + m_languageID = Core::ICore::instance()->uniqueIDManager()-> uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); } @@ -116,7 +115,8 @@ void Qt4Manager::notifyChanged(const QString &name) void Qt4Manager::init() { - m_projectExplorer = m_core->pluginManager()->getObject<ProjectExplorer::ProjectExplorerPlugin>(); + m_projectExplorer = ExtensionSystem::PluginManager::instance() + ->getObject<ProjectExplorer::ProjectExplorerPlugin>(); } int Qt4Manager::projectContext() const @@ -143,7 +143,8 @@ ProjectExplorer::Project* Qt4Manager::openProject(const QString &fileName) QString errorMessage; - m_core->messageManager()->displayStatusBarMessage(tr("Loading project %1 ...").arg(fileName), 50000); + Core::MessageManager *messageManager = Core::ICore::instance()->messageManager(); + messageManager->displayStatusBarMessage(tr("Loading project %1 ...").arg(fileName), 50000); // TODO Make all file paths relative & remove this hack // We convert the path to an absolute one here because qt4project.cpp @@ -152,25 +153,25 @@ ProjectExplorer::Project* Qt4Manager::openProject(const QString &fileName) QString canonicalFilePath = QFileInfo(fileName).canonicalFilePath(); if (canonicalFilePath.isEmpty()) { - m_core->messageManager()->printToOutputPane(tr("Failed opening project '%1': Project file does not exist").arg(canonicalFilePath)); - m_core->messageManager()->displayStatusBarMessage(tr("Failed opening project"), 5000); + messageManager->printToOutputPane(tr("Failed opening project '%1': Project file does not exist").arg(canonicalFilePath)); + messageManager->displayStatusBarMessage(tr("Failed opening project"), 5000); return 0; } foreach (ProjectExplorer::Project *pi, projectExplorer()->session()->projects()) { if (canonicalFilePath == pi->file()->fileName()) { - m_core->messageManager()->printToOutputPane(tr("Failed opening project '%1': Project already open").arg(canonicalFilePath)); - m_core->messageManager()->displayStatusBarMessage(tr("Failed opening project"), 5000); + messageManager->printToOutputPane(tr("Failed opening project '%1': Project already open").arg(canonicalFilePath)); + messageManager->displayStatusBarMessage(tr("Failed opening project"), 5000); return 0; } } - m_core->messageManager()->displayStatusBarMessage(tr("Opening %1 ...").arg(fileName)); + messageManager->displayStatusBarMessage(tr("Opening %1 ...").arg(fileName)); QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); Qt4Project *pro = new Qt4Project(this, canonicalFilePath); - m_core->messageManager()->displayStatusBarMessage(tr("Done opening project"), 5000); + messageManager->displayStatusBarMessage(tr("Done opening project"), 5000); return pro; } @@ -179,16 +180,6 @@ ProjectExplorer::ProjectExplorerPlugin *Qt4Manager::projectExplorer() const return m_projectExplorer; } -Core::ICore *Qt4Manager::core() const -{ - return m_core; -} - -ExtensionSystem::PluginManager *Qt4Manager::pluginManager() const -{ - return m_core->pluginManager(); -} - ProjectExplorer::Node *Qt4Manager::contextNode() const { return m_contextNode; diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.h b/src/plugins/qt4projectmanager/qt4projectmanager.h index 4bb4d6eaf1..b6fc317362 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.h +++ b/src/plugins/qt4projectmanager/qt4projectmanager.h @@ -44,10 +44,6 @@ namespace ExtensionSystem { class PluginManager; } -namespace Core { -class ICore; -} - namespace ProjectExplorer { class Project; class ProjectExplorerPlugin; @@ -64,13 +60,12 @@ class QtVersionManager; class Qt4Project; -class Qt4Manager - : public ProjectExplorer::IProjectManager +class Qt4Manager : public ProjectExplorer::IProjectManager { Q_OBJECT public: - Qt4Manager(Internal::Qt4ProjectManagerPlugin *plugin, Core::ICore *core); + Qt4Manager(Internal::Qt4ProjectManagerPlugin *plugin); ~Qt4Manager(); void init(); @@ -80,10 +75,8 @@ public: void notifyChanged(const QString &name); ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const; - ExtensionSystem::PluginManager *pluginManager() const; - Core::ICore *core() const; - //ProjectExplorer::IProjectManager + // ProjectExplorer::IProjectManager int projectContext() const; int projectLanguage() const; @@ -111,7 +104,6 @@ private: const QString m_mimeType; Internal::Qt4ProjectManagerPlugin *m_plugin; - Core::ICore *m_core; ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer; ProjectExplorer::Node *m_contextNode; diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index f5c2a78ec7..0d90983aa8 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -48,6 +48,7 @@ #include "profilereader.h" #include "gdbmacrosbuildstep.h" +#include <coreplugin/icore.h> #include <extensionsystem/pluginmanager.h> #include <projectexplorer/buildmanager.h> #include <projectexplorer/project.h> @@ -59,9 +60,9 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <texteditor/texteditoractionhandler.h> -#include <QtCore/qplugin.h> +#include <QtCore/QDebug> +#include <QtCore/QtPlugin> #include <QtGui/QMenu> -#include <QDebug> #ifdef WITH_TESTS #include <QTest> @@ -95,33 +96,37 @@ static Core::Command *createSeparator(Core::ActionManager *am, return am->registerAction(tmpaction, name, context); } */ -bool Qt4ProjectManagerPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage) + +bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage) { + Q_UNUSED(arguments); + Core::ICore *core = Core::ICore::instance(); if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":qt4projectmanager/Qt4ProjectManager.mimetypes.xml"), errorMessage)) return false; - m_projectExplorer = core->pluginManager()->getObject<ProjectExplorer::ProjectExplorerPlugin>(); + m_projectExplorer = ExtensionSystem::PluginManager::instance() + ->getObject<ProjectExplorer::ProjectExplorerPlugin>(); Core::ActionManager *am = core->actionManager(); //create and register objects - m_qt4ProjectManager = new Qt4Manager(this, core); + m_qt4ProjectManager = new Qt4Manager(this); addObject(m_qt4ProjectManager); TextEditor::TextEditorActionHandler *editorHandler - = new TextEditor::TextEditorActionHandler(core, Constants::C_PROFILEEDITOR); + = new TextEditor::TextEditorActionHandler(Constants::C_PROFILEEDITOR); m_proFileEditorFactory = new ProFileEditorFactory(m_qt4ProjectManager, editorHandler); addObject(m_proFileEditorFactory); - GuiAppWizard *guiWizard = new GuiAppWizard(core); + GuiAppWizard *guiWizard = new GuiAppWizard; addAutoReleasedObject(guiWizard); - ConsoleAppWizard *consoleWizard = new ConsoleAppWizard(core); + ConsoleAppWizard *consoleWizard = new ConsoleAppWizard; addAutoReleasedObject(consoleWizard); - LibraryWizard *libWizard = new LibraryWizard(core); + LibraryWizard *libWizard = new LibraryWizard; addAutoReleasedObject(libWizard); addAutoReleasedObject(new QMakeBuildStepFactory); diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp b/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp index 73884791fe..402ba7a2ff 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp @@ -58,8 +58,8 @@ static const char *mainSourceFileC = "main"; namespace Qt4ProjectManager { namespace Internal { -ConsoleAppWizard::ConsoleAppWizard(Core::ICore *core) : - QtWizard(core, tr("Qt4 Console Application"), +ConsoleAppWizard::ConsoleAppWizard() + : QtWizard(tr("Qt4 Console Application"), tr("Creates a Qt4 console application."), QIcon(":/wizards/images/console.png")) { diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizard.h b/src/plugins/qt4projectmanager/wizards/consoleappwizard.h index 36fff218dd..be080c0850 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizard.h @@ -46,7 +46,7 @@ class ConsoleAppWizard : public QtWizard Q_OBJECT public: - explicit ConsoleAppWizard(Core::ICore *core); + ConsoleAppWizard(); protected: virtual QWizard *createWizardDialog(QWidget *parent, diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp index 14df3821cc..d0a626aecc 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp @@ -70,12 +70,10 @@ static inline QStringList baseClasses() } namespace Qt4ProjectManager { - namespace Internal { -GuiAppWizard::GuiAppWizard(Core::ICore *core) : - QtWizard(core, - tr("Qt4 Gui Application"), +GuiAppWizard::GuiAppWizard() + : QtWizard(tr("Qt4 Gui Application"), tr("Creates a Qt4 Gui Application with one form."), QIcon(":/wizards/images/gui.png")) { diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.h b/src/plugins/qt4projectmanager/wizards/guiappwizard.h index dd7d7e7d02..d3ce961b2f 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.h @@ -47,7 +47,7 @@ class GuiAppWizard : public QtWizard Q_OBJECT public: - explicit GuiAppWizard(Core::ICore *core); + GuiAppWizard(); protected: virtual QWizard *createWizardDialog(QWidget *parent, diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp index 0bc379ecbe..0c3c6513eb 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp @@ -91,7 +91,7 @@ void GuiAppWizardDialog::setBaseClasses(const QStringList &baseClasses) m_filesPage->setBaseClassName(baseClasses.front()); } -void GuiAppWizardDialog::setSuffixes(const QString &header, const QString &source, const QString &form) +void GuiAppWizardDialog::setSuffixes(const QString &header, const QString &source, const QString &form) { m_filesPage->setSuffixes(header, source, form); } diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h index 080cf802c2..dbd2b69a42 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h +++ b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h @@ -37,10 +37,12 @@ #include <QtGui/QWizard> namespace Core { - namespace Utils { - class ProjectIntroPage; - } -} +namespace Utils { + +class ProjectIntroPage; + +} // namespace Utils +} // namespace Core namespace Qt4ProjectManager { namespace Internal { @@ -50,7 +52,8 @@ class ModulesPage; class FilesPage; // Additional parameters required besides QtProjectParameters -struct GuiAppParameters { +struct GuiAppParameters +{ GuiAppParameters(); QString className; QString baseClassName; diff --git a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp index e79cd1b658..788563f5cc 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp @@ -50,8 +50,8 @@ namespace Qt4ProjectManager { namespace Internal { -LibraryWizard::LibraryWizard(Core::ICore *core) : - QtWizard(core, tr("C++ Library"), +LibraryWizard::LibraryWizard() + : QtWizard(tr("C++ Library"), tr("Creates a C++ Library."), QIcon(":/wizards/images/lib.png")) { @@ -69,8 +69,9 @@ QWizard *LibraryWizard::createWizardDialog(QWidget *parent, Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w, - QString * /*errorMessage*/) const + QString *errorMessage) const { + Q_UNUSED(errorMessage); const LibraryWizardDialog *dialog = qobject_cast<const LibraryWizardDialog *>(w); const QtProjectParameters projectParams = dialog->parameters(); const QString projectPath = projectParams.projectPath(); diff --git a/src/plugins/qt4projectmanager/wizards/librarywizard.h b/src/plugins/qt4projectmanager/wizards/librarywizard.h index 203179d4c9..f5e6b2af84 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizard.h +++ b/src/plugins/qt4projectmanager/wizards/librarywizard.h @@ -48,7 +48,7 @@ class LibraryWizard : public QtWizard Q_OBJECT public: - explicit LibraryWizard(Core::ICore *core); + LibraryWizard(); protected: virtual QWizard *createWizardDialog(QWidget *parent, diff --git a/src/plugins/qt4projectmanager/wizards/qtwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtwizard.cpp index b61861a8e6..a8fd467f80 100644 --- a/src/plugins/qt4projectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtwizard.cpp @@ -63,9 +63,8 @@ static inline Core::BaseFileWizardParameters } // -------------------- QtWizard -QtWizard::QtWizard(Core::ICore *core, const QString &name, - const QString &description, const QIcon &icon) : - Core::BaseFileWizard(wizardParameters(name, description, icon), core), +QtWizard::QtWizard(const QString &name, const QString &description, const QIcon &icon) : + Core::BaseFileWizard(wizardParameters(name, description, icon)), m_projectExplorer(ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::ProjectExplorerPlugin>()) { } @@ -103,7 +102,7 @@ bool QtWizard::postGenerateFiles(const Core::GeneratedFiles &l, QString *errorMe QString QtWizard::templateDir() const { - QString rc = core()->resourcePath(); + QString rc = Core::ICore::instance()->resourcePath(); rc += QLatin1String("/templates/qt4project"); return rc; } diff --git a/src/plugins/qt4projectmanager/wizards/qtwizard.h b/src/plugins/qt4projectmanager/wizards/qtwizard.h index 9858251a9d..dd031ef7e0 100644 --- a/src/plugins/qt4projectmanager/wizards/qtwizard.h +++ b/src/plugins/qt4projectmanager/wizards/qtwizard.h @@ -38,13 +38,8 @@ #include <coreplugin/basefilewizard.h> -QT_BEGIN_NAMESPACE -class QTextStream; -class QDir; -QT_END_NAMESPACE - namespace ProjectExplorer { - class ProjectExplorerPlugin; +class ProjectExplorerPlugin; } namespace Qt4ProjectManager { @@ -60,14 +55,11 @@ namespace Internal { class QtWizard : public Core::BaseFileWizard { - Q_DISABLE_COPY(QtWizard) Q_OBJECT - -public: + Q_DISABLE_COPY(QtWizard) protected: - explicit QtWizard(Core::ICore *core, const QString &name, - const QString &description, const QIcon &icon); + QtWizard(const QString &name, const QString &description, const QIcon &icon); QString templateDir() const; |