summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-01-26 14:25:03 +0100
committerhjk <qtc-committer@nokia.com>2009-01-26 14:25:03 +0100
commitf9679651e1b8862db38f3a474e58e602faa8cd4f (patch)
treec80a36426124bff481564e876414326d940fb385
parentf68d6cf0a041f266508b1e25894352bfe0dbdaf0 (diff)
downloadqt-creator-f9679651e1b8862db38f3a474e58e602faa8cd4f.tar.gz
Fixes: coreplugin: remove more PluginManager parameters
Details: access PluginManager::instance() instead
-rw-r--r--src/plugins/coreplugin/coreimpl.cpp5
-rw-r--r--src/plugins/coreplugin/coreimpl.h1
-rw-r--r--src/plugins/coreplugin/coreplugin.cpp8
-rw-r--r--src/plugins/coreplugin/coreplugin.h4
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp37
-rw-r--r--src/plugins/coreplugin/mainwindow.h10
-rw-r--r--src/plugins/coreplugin/messagemanager.cpp12
-rw-r--r--src/plugins/coreplugin/messagemanager.h5
-rw-r--r--src/plugins/coreplugin/viewmanager.cpp3
9 files changed, 32 insertions, 53 deletions
diff --git a/src/plugins/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp
index e9a3799d62..626eca5877 100644
--- a/src/plugins/coreplugin/coreimpl.cpp
+++ b/src/plugins/coreplugin/coreimpl.cpp
@@ -93,11 +93,6 @@ MessageManager *CoreImpl::messageManager() const
return m_mainwindow->messageManager();
}
-ExtensionSystem::PluginManager *CoreImpl::pluginManager() const
-{
- return m_mainwindow->pluginManager();
-}
-
EditorManager *CoreImpl::editorManager() const
{
return m_mainwindow->editorManager();
diff --git a/src/plugins/coreplugin/coreimpl.h b/src/plugins/coreplugin/coreimpl.h
index a845a4b990..25e8878d10 100644
--- a/src/plugins/coreplugin/coreimpl.h
+++ b/src/plugins/coreplugin/coreimpl.h
@@ -58,7 +58,6 @@ public:
FileManager *fileManager() const ;
UniqueIDManager *uniqueIDManager() const;
MessageManager *messageManager() const;
- ExtensionSystem::PluginManager *pluginManager() const;
EditorManager *editorManager() const;
ProgressManager *progressManager() const;
ScriptManager *scriptManager() const;
diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp
index c6bc596b28..db58f7d721 100644
--- a/src/plugins/coreplugin/coreplugin.cpp
+++ b/src/plugins/coreplugin/coreplugin.cpp
@@ -50,7 +50,7 @@
using namespace Core::Internal;
CorePlugin::CorePlugin() :
- m_mainWindow(new MainWindow), m_welcomeMode(0), m_editMode(0), m_pm(0)
+ m_mainWindow(new MainWindow), m_welcomeMode(0), m_editMode(0)
{
}
@@ -71,10 +71,10 @@ CorePlugin::~CorePlugin()
delete m_mainWindow;
}
-bool CorePlugin::initialize(const QStringList & /*arguments*/, QString *error_message)
+bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
- m_pm = ExtensionSystem::PluginManager::instance();
- const bool success = m_mainWindow->init(m_pm, error_message);
+ Q_UNUSED(arguments);
+ const bool success = m_mainWindow->init(errorMessage);
if (success) {
#if !defined(QT_NO_WEBKIT)
QWebSettings *webSettings = QWebSettings::globalSettings();
diff --git a/src/plugins/coreplugin/coreplugin.h b/src/plugins/coreplugin/coreplugin.h
index 020f407829..b2aff60bca 100644
--- a/src/plugins/coreplugin/coreplugin.h
+++ b/src/plugins/coreplugin/coreplugin.h
@@ -51,7 +51,7 @@ public:
CorePlugin();
~CorePlugin();
- bool initialize(const QStringList &arguments, QString *error_message = 0);
+ bool initialize(const QStringList &arguments, QString *errorMessage = 0);
void extensionsInitialized();
public slots:
@@ -61,8 +61,6 @@ private:
MainWindow *m_mainWindow;
WelcomeMode *m_welcomeMode;
EditMode *m_editMode;
-
- ExtensionSystem::PluginManager *m_pm;
};
} // namespace Internal
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index f83d63f7a1..fb5ac9c3ae 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -130,7 +130,6 @@ MainWindow::MainWindow() :
m_rightPaneWidget(0),
m_versionDialog(0),
m_activeContext(0),
- m_pluginManager(0),
m_outputMode(0),
m_generalSettings(new GeneralSettings),
m_shortcutSettings(new ShortcutSettings),
@@ -225,8 +224,9 @@ void MainWindow::setSuppressNavigationWidget(bool suppress)
MainWindow::~MainWindow()
{
hide();
- m_pluginManager->removeObject(m_shortcutSettings);
- m_pluginManager->removeObject(m_generalSettings);
+ ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
+ pm->removeObject(m_shortcutSettings);
+ pm->removeObject(m_generalSettings);
delete m_messageManager;
m_messageManager = 0;
delete m_shortcutSettings;
@@ -241,7 +241,7 @@ MainWindow::~MainWindow()
m_uniqueIDManager = 0;
delete m_vcsManager;
m_vcsManager = 0;
- m_pluginManager->removeObject(m_outputMode);
+ pm->removeObject(m_outputMode);
delete m_outputMode;
m_outputMode = 0;
//we need to delete editormanager and viewmanager explicitly before the end of the destructor,
@@ -251,7 +251,7 @@ MainWindow::~MainWindow()
OutputPaneManager::destroy();
// Now that the OutputPaneManager is gone, is a good time to delete the view
- m_pluginManager->removeObject(m_outputView);
+ pm->removeObject(m_outputView);
delete m_outputView;
delete m_editorManager;
@@ -260,7 +260,7 @@ MainWindow::~MainWindow()
m_viewManager = 0;
delete m_progressManager;
m_progressManager = 0;
- m_pluginManager->removeObject(m_coreImpl);
+ pm->removeObject(m_coreImpl);
delete m_coreImpl;
m_coreImpl = 0;
@@ -276,10 +276,12 @@ MainWindow::~MainWindow()
m_mimeDatabase = 0;
}
-bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *)
+bool MainWindow::init(QString *errorMessage)
{
- m_pluginManager = pm;
- m_pluginManager->addObject(m_coreImpl);
+ Q_UNUSED(errorMessage);
+
+ ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
+ pm->addObject(m_coreImpl);
m_viewManager->init();
m_modeManager->init();
m_progressManager->init();
@@ -301,15 +303,15 @@ bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *)
outputModeWidget->setFocusProxy(oph);
m_outputMode->setContext(m_globalContext);
- m_pluginManager->addObject(m_outputMode);
- m_pluginManager->addObject(m_generalSettings);
- m_pluginManager->addObject(m_shortcutSettings);
+ pm->addObject(m_outputMode);
+ pm->addObject(m_generalSettings);
+ pm->addObject(m_shortcutSettings);
// Add widget to the bottom, we create the view here instead of inside the
// OutputPaneManager, since the ViewManager needs to be initilized before
m_outputView = new Core::BaseView("OutputWindow.Buttons",
OutputPaneManager::instance()->buttonsWidget(), QList<int>(), Core::IView::Second);
- m_pluginManager->addObject(m_outputView);
+ pm->addObject(m_outputView);
return true;
}
@@ -319,7 +321,7 @@ void MainWindow::extensionsInitialized()
m_viewManager->extensionsInitalized();
- m_messageManager->init(m_pluginManager);
+ m_messageManager->init();
OutputPaneManager::instance()->init();
m_actionManager->initialize();
@@ -343,7 +345,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
const QList<ICoreListener *> listeners =
- pluginManager()->getObjects<ICoreListener>();
+ ExtensionSystem::PluginManager::instance()->getObjects<ICoreListener>();
foreach (ICoreListener *listener, listeners) {
if (!listener->coreAboutToClose()) {
event->ignore();
@@ -885,11 +887,6 @@ MimeDatabase *MainWindow::mimeDatabase() const
return m_mimeDatabase;
}
-ExtensionSystem::PluginManager *MainWindow::pluginManager() const
-{
- return m_pluginManager;
-}
-
IContext *MainWindow::contextObject(QWidget *widget)
{
return m_contextWidgets.value(widget);
diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h
index 32513092dc..c0203a2af3 100644
--- a/src/plugins/coreplugin/mainwindow.h
+++ b/src/plugins/coreplugin/mainwindow.h
@@ -49,10 +49,6 @@ class QSettings;
class QShortcut;
QT_END_NAMESPACE
-namespace ExtensionSystem {
-class PluginManager;
-}
-
namespace Core {
class ActionManager;
@@ -93,7 +89,7 @@ public:
MainWindow();
~MainWindow();
- bool init(ExtensionSystem::PluginManager *pm, QString *error_message);
+ bool init(QString *errorMessage);
void extensionsInitialized();
IContext *contextObject(QWidget *widget);
@@ -103,12 +99,10 @@ public:
void openFiles(const QStringList &fileNames);
- inline ExtensionSystem::PluginManager *pluginManager() { return m_pluginManager; }
Core::ActionManager *actionManager() const;
Core::FileManager *fileManager() const;
Core::UniqueIDManager *uniqueIDManager() const;
Core::MessageManager *messageManager() const;
- ExtensionSystem::PluginManager *pluginManager() const;
Core::EditorManager *editorManager() const;
Core::ProgressManager *progressManager() const;
Core::ScriptManager *scriptManager() const;
@@ -195,8 +189,6 @@ private:
QMap<QWidget *, IContext *> m_contextWidgets;
- ExtensionSystem::PluginManager *m_pluginManager;
-
BaseMode *m_outputMode;
GeneralSettings *m_generalSettings;
ShortcutSettings *m_shortcutSettings;
diff --git a/src/plugins/coreplugin/messagemanager.cpp b/src/plugins/coreplugin/messagemanager.cpp
index 1b74995ef4..255a92de08 100644
--- a/src/plugins/coreplugin/messagemanager.cpp
+++ b/src/plugins/coreplugin/messagemanager.cpp
@@ -44,26 +44,26 @@ using namespace Core;
MessageManager *MessageManager::m_instance = 0;
MessageManager::MessageManager()
- : m_pm(0), m_messageOutputWindow(0)
+ : m_messageOutputWindow(0)
{
m_instance = this;
}
MessageManager::~MessageManager()
{
- if (m_pm && m_messageOutputWindow) {
- m_pm->removeObject(m_messageOutputWindow);
+ ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
+ if (pm && m_messageOutputWindow) {
+ pm->removeObject(m_messageOutputWindow);
delete m_messageOutputWindow;
}
m_instance = 0;
}
-void MessageManager::init(ExtensionSystem::PluginManager *pm)
+void MessageManager::init()
{
- m_pm = pm;
m_messageOutputWindow = new Internal::MessageOutputWindow;
- pm->addObject(m_messageOutputWindow);
+ ExtensionSystem::PluginManager::instance()->addObject(m_messageOutputWindow);
}
void MessageManager::showOutputPane()
diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h
index 12a1524cb4..7f9716b78e 100644
--- a/src/plugins/coreplugin/messagemanager.h
+++ b/src/plugins/coreplugin/messagemanager.h
@@ -37,8 +37,6 @@
#include "core_global.h"
#include <QtCore/QObject>
-namespace ExtensionSystem { class PluginManager; }
-
namespace Core {
namespace Internal {
@@ -53,7 +51,7 @@ public:
MessageManager();
~MessageManager();
- void init(ExtensionSystem::PluginManager *pm);
+ void init();
static MessageManager *instance() { return m_instance; }
@@ -64,7 +62,6 @@ public slots:
void printToOutputPane(const QString &text, bool bringToForeground = true);
private:
- ExtensionSystem::PluginManager *m_pm;
Internal::MessageOutputWindow *m_messageOutputWindow;
static MessageManager *m_instance;
diff --git a/src/plugins/coreplugin/viewmanager.cpp b/src/plugins/coreplugin/viewmanager.cpp
index 052e2dee52..b0663d63f4 100644
--- a/src/plugins/coreplugin/viewmanager.cpp
+++ b/src/plugins/coreplugin/viewmanager.cpp
@@ -115,7 +115,8 @@ void ViewManager::saveSettings(QSettings *settings)
IView *ViewManager::view(const QString &id)
{
- QList<IView *> list = m_mainWnd->pluginManager()->getObjects<IView>();
+ QList<IView *> list =
+ ExtensionSystem::PluginManager::instance()->getObjects<IView>();
foreach (IView *view, list) {
if (view->uniqueViewName() == id)
return view;