Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f9679651
Commit
f9679651
authored
Jan 26, 2009
by
hjk
Browse files
Fixes: coreplugin: remove more PluginManager parameters
Details: access PluginManager::instance() instead
parent
f68d6cf0
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/coreimpl.cpp
View file @
f9679651
...
@@ -93,11 +93,6 @@ MessageManager *CoreImpl::messageManager() const
...
@@ -93,11 +93,6 @@ MessageManager *CoreImpl::messageManager() const
return
m_mainwindow
->
messageManager
();
return
m_mainwindow
->
messageManager
();
}
}
ExtensionSystem
::
PluginManager
*
CoreImpl
::
pluginManager
()
const
{
return
m_mainwindow
->
pluginManager
();
}
EditorManager
*
CoreImpl
::
editorManager
()
const
EditorManager
*
CoreImpl
::
editorManager
()
const
{
{
return
m_mainwindow
->
editorManager
();
return
m_mainwindow
->
editorManager
();
...
...
src/plugins/coreplugin/coreimpl.h
View file @
f9679651
...
@@ -58,7 +58,6 @@ public:
...
@@ -58,7 +58,6 @@ public:
FileManager
*
fileManager
()
const
;
FileManager
*
fileManager
()
const
;
UniqueIDManager
*
uniqueIDManager
()
const
;
UniqueIDManager
*
uniqueIDManager
()
const
;
MessageManager
*
messageManager
()
const
;
MessageManager
*
messageManager
()
const
;
ExtensionSystem
::
PluginManager
*
pluginManager
()
const
;
EditorManager
*
editorManager
()
const
;
EditorManager
*
editorManager
()
const
;
ProgressManager
*
progressManager
()
const
;
ProgressManager
*
progressManager
()
const
;
ScriptManager
*
scriptManager
()
const
;
ScriptManager
*
scriptManager
()
const
;
...
...
src/plugins/coreplugin/coreplugin.cpp
View file @
f9679651
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
using
namespace
Core
::
Internal
;
using
namespace
Core
::
Internal
;
CorePlugin
::
CorePlugin
()
:
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()
...
@@ -71,10 +71,10 @@ CorePlugin::~CorePlugin()
delete
m_mainWindow
;
delete
m_mainWindow
;
}
}
bool
CorePlugin
::
initialize
(
const
QStringList
&
/*
arguments
*/
,
QString
*
error
_m
essage
)
bool
CorePlugin
::
initialize
(
const
QStringList
&
arguments
,
QString
*
error
M
essage
)
{
{
m_pm
=
ExtensionSystem
::
PluginManager
::
instance
(
);
Q_UNUSED
(
arguments
);
const
bool
success
=
m_mainWindow
->
init
(
m_pm
,
error
_m
essage
);
const
bool
success
=
m_mainWindow
->
init
(
error
M
essage
);
if
(
success
)
{
if
(
success
)
{
#if !defined(QT_NO_WEBKIT)
#if !defined(QT_NO_WEBKIT)
QWebSettings
*
webSettings
=
QWebSettings
::
globalSettings
();
QWebSettings
*
webSettings
=
QWebSettings
::
globalSettings
();
...
...
src/plugins/coreplugin/coreplugin.h
View file @
f9679651
...
@@ -51,7 +51,7 @@ public:
...
@@ -51,7 +51,7 @@ public:
CorePlugin
();
CorePlugin
();
~
CorePlugin
();
~
CorePlugin
();
bool
initialize
(
const
QStringList
&
arguments
,
QString
*
error
_m
essage
=
0
);
bool
initialize
(
const
QStringList
&
arguments
,
QString
*
error
M
essage
=
0
);
void
extensionsInitialized
();
void
extensionsInitialized
();
public
slots
:
public
slots
:
...
@@ -61,8 +61,6 @@ private:
...
@@ -61,8 +61,6 @@ private:
MainWindow
*
m_mainWindow
;
MainWindow
*
m_mainWindow
;
WelcomeMode
*
m_welcomeMode
;
WelcomeMode
*
m_welcomeMode
;
EditMode
*
m_editMode
;
EditMode
*
m_editMode
;
ExtensionSystem
::
PluginManager
*
m_pm
;
};
};
}
// namespace Internal
}
// namespace Internal
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
f9679651
...
@@ -130,7 +130,6 @@ MainWindow::MainWindow() :
...
@@ -130,7 +130,6 @@ MainWindow::MainWindow() :
m_rightPaneWidget
(
0
),
m_rightPaneWidget
(
0
),
m_versionDialog
(
0
),
m_versionDialog
(
0
),
m_activeContext
(
0
),
m_activeContext
(
0
),
m_pluginManager
(
0
),
m_outputMode
(
0
),
m_outputMode
(
0
),
m_generalSettings
(
new
GeneralSettings
),
m_generalSettings
(
new
GeneralSettings
),
m_shortcutSettings
(
new
ShortcutSettings
),
m_shortcutSettings
(
new
ShortcutSettings
),
...
@@ -225,8 +224,9 @@ void MainWindow::setSuppressNavigationWidget(bool suppress)
...
@@ -225,8 +224,9 @@ void MainWindow::setSuppressNavigationWidget(bool suppress)
MainWindow
::~
MainWindow
()
MainWindow
::~
MainWindow
()
{
{
hide
();
hide
();
m_pluginManager
->
removeObject
(
m_shortcutSettings
);
ExtensionSystem
::
PluginManager
*
pm
=
ExtensionSystem
::
PluginManager
::
instance
();
m_pluginManager
->
removeObject
(
m_generalSettings
);
pm
->
removeObject
(
m_shortcutSettings
);
pm
->
removeObject
(
m_generalSettings
);
delete
m_messageManager
;
delete
m_messageManager
;
m_messageManager
=
0
;
m_messageManager
=
0
;
delete
m_shortcutSettings
;
delete
m_shortcutSettings
;
...
@@ -241,7 +241,7 @@ MainWindow::~MainWindow()
...
@@ -241,7 +241,7 @@ MainWindow::~MainWindow()
m_uniqueIDManager
=
0
;
m_uniqueIDManager
=
0
;
delete
m_vcsManager
;
delete
m_vcsManager
;
m_vcsManager
=
0
;
m_vcsManager
=
0
;
m
_pluginManager
->
removeObject
(
m_outputMode
);
p
m
->
removeObject
(
m_outputMode
);
delete
m_outputMode
;
delete
m_outputMode
;
m_outputMode
=
0
;
m_outputMode
=
0
;
//we need to delete editormanager and viewmanager explicitly before the end of the destructor,
//we need to delete editormanager and viewmanager explicitly before the end of the destructor,
...
@@ -251,7 +251,7 @@ MainWindow::~MainWindow()
...
@@ -251,7 +251,7 @@ MainWindow::~MainWindow()
OutputPaneManager
::
destroy
();
OutputPaneManager
::
destroy
();
// Now that the OutputPaneManager is gone, is a good time to delete the view
// Now that the OutputPaneManager is gone, is a good time to delete the view
m
_pluginManager
->
removeObject
(
m_outputView
);
p
m
->
removeObject
(
m_outputView
);
delete
m_outputView
;
delete
m_outputView
;
delete
m_editorManager
;
delete
m_editorManager
;
...
@@ -260,7 +260,7 @@ MainWindow::~MainWindow()
...
@@ -260,7 +260,7 @@ MainWindow::~MainWindow()
m_viewManager
=
0
;
m_viewManager
=
0
;
delete
m_progressManager
;
delete
m_progressManager
;
m_progressManager
=
0
;
m_progressManager
=
0
;
m
_pluginManager
->
removeObject
(
m_coreImpl
);
p
m
->
removeObject
(
m_coreImpl
);
delete
m_coreImpl
;
delete
m_coreImpl
;
m_coreImpl
=
0
;
m_coreImpl
=
0
;
...
@@ -276,10 +276,12 @@ MainWindow::~MainWindow()
...
@@ -276,10 +276,12 @@ MainWindow::~MainWindow()
m_mimeDatabase
=
0
;
m_mimeDatabase
=
0
;
}
}
bool
MainWindow
::
init
(
ExtensionSystem
::
PluginManager
*
pm
,
QString
*
)
bool
MainWindow
::
init
(
QString
*
errorMessage
)
{
{
m_pluginManager
=
pm
;
Q_UNUSED
(
errorMessage
);
m_pluginManager
->
addObject
(
m_coreImpl
);
ExtensionSystem
::
PluginManager
*
pm
=
ExtensionSystem
::
PluginManager
::
instance
();
pm
->
addObject
(
m_coreImpl
);
m_viewManager
->
init
();
m_viewManager
->
init
();
m_modeManager
->
init
();
m_modeManager
->
init
();
m_progressManager
->
init
();
m_progressManager
->
init
();
...
@@ -301,15 +303,15 @@ bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *)
...
@@ -301,15 +303,15 @@ bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *)
outputModeWidget
->
setFocusProxy
(
oph
);
outputModeWidget
->
setFocusProxy
(
oph
);
m_outputMode
->
setContext
(
m_globalContext
);
m_outputMode
->
setContext
(
m_globalContext
);
m
_pluginManager
->
addObject
(
m_outputMode
);
p
m
->
addObject
(
m_outputMode
);
m
_pluginManager
->
addObject
(
m_generalSettings
);
p
m
->
addObject
(
m_generalSettings
);
m
_pluginManager
->
addObject
(
m_shortcutSettings
);
p
m
->
addObject
(
m_shortcutSettings
);
// Add widget to the bottom, we create the view here instead of inside the
// Add widget to the bottom, we create the view here instead of inside the
// OutputPaneManager, since the ViewManager needs to be initilized before
// OutputPaneManager, since the ViewManager needs to be initilized before
m_outputView
=
new
Core
::
BaseView
(
"OutputWindow.Buttons"
,
m_outputView
=
new
Core
::
BaseView
(
"OutputWindow.Buttons"
,
OutputPaneManager
::
instance
()
->
buttonsWidget
(),
QList
<
int
>
(),
Core
::
IView
::
Second
);
OutputPaneManager
::
instance
()
->
buttonsWidget
(),
QList
<
int
>
(),
Core
::
IView
::
Second
);
m
_pluginManager
->
addObject
(
m_outputView
);
p
m
->
addObject
(
m_outputView
);
return
true
;
return
true
;
}
}
...
@@ -319,7 +321,7 @@ void MainWindow::extensionsInitialized()
...
@@ -319,7 +321,7 @@ void MainWindow::extensionsInitialized()
m_viewManager
->
extensionsInitalized
();
m_viewManager
->
extensionsInitalized
();
m_messageManager
->
init
(
m_pluginManager
);
m_messageManager
->
init
();
OutputPaneManager
::
instance
()
->
init
();
OutputPaneManager
::
instance
()
->
init
();
m_actionManager
->
initialize
();
m_actionManager
->
initialize
();
...
@@ -343,7 +345,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
...
@@ -343,7 +345,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
}
const
QList
<
ICoreListener
*>
listeners
=
const
QList
<
ICoreListener
*>
listeners
=
p
luginManager
()
->
getObjects
<
ICoreListener
>
();
ExtensionSystem
::
P
luginManager
::
instance
()
->
getObjects
<
ICoreListener
>
();
foreach
(
ICoreListener
*
listener
,
listeners
)
{
foreach
(
ICoreListener
*
listener
,
listeners
)
{
if
(
!
listener
->
coreAboutToClose
())
{
if
(
!
listener
->
coreAboutToClose
())
{
event
->
ignore
();
event
->
ignore
();
...
@@ -885,11 +887,6 @@ MimeDatabase *MainWindow::mimeDatabase() const
...
@@ -885,11 +887,6 @@ MimeDatabase *MainWindow::mimeDatabase() const
return
m_mimeDatabase
;
return
m_mimeDatabase
;
}
}
ExtensionSystem
::
PluginManager
*
MainWindow
::
pluginManager
()
const
{
return
m_pluginManager
;
}
IContext
*
MainWindow
::
contextObject
(
QWidget
*
widget
)
IContext
*
MainWindow
::
contextObject
(
QWidget
*
widget
)
{
{
return
m_contextWidgets
.
value
(
widget
);
return
m_contextWidgets
.
value
(
widget
);
...
...
src/plugins/coreplugin/mainwindow.h
View file @
f9679651
...
@@ -49,10 +49,6 @@ class QSettings;
...
@@ -49,10 +49,6 @@ class QSettings;
class
QShortcut
;
class
QShortcut
;
QT_END_NAMESPACE
QT_END_NAMESPACE
namespace
ExtensionSystem
{
class
PluginManager
;
}
namespace
Core
{
namespace
Core
{
class
ActionManager
;
class
ActionManager
;
...
@@ -93,7 +89,7 @@ public:
...
@@ -93,7 +89,7 @@ public:
MainWindow
();
MainWindow
();
~
MainWindow
();
~
MainWindow
();
bool
init
(
ExtensionSystem
::
PluginManager
*
pm
,
QString
*
error
_m
essage
);
bool
init
(
QString
*
error
M
essage
);
void
extensionsInitialized
();
void
extensionsInitialized
();
IContext
*
contextObject
(
QWidget
*
widget
);
IContext
*
contextObject
(
QWidget
*
widget
);
...
@@ -103,12 +99,10 @@ public:
...
@@ -103,12 +99,10 @@ public:
void
openFiles
(
const
QStringList
&
fileNames
);
void
openFiles
(
const
QStringList
&
fileNames
);
inline
ExtensionSystem
::
PluginManager
*
pluginManager
()
{
return
m_pluginManager
;
}
Core
::
ActionManager
*
actionManager
()
const
;
Core
::
ActionManager
*
actionManager
()
const
;
Core
::
FileManager
*
fileManager
()
const
;
Core
::
FileManager
*
fileManager
()
const
;
Core
::
UniqueIDManager
*
uniqueIDManager
()
const
;
Core
::
UniqueIDManager
*
uniqueIDManager
()
const
;
Core
::
MessageManager
*
messageManager
()
const
;
Core
::
MessageManager
*
messageManager
()
const
;
ExtensionSystem
::
PluginManager
*
pluginManager
()
const
;
Core
::
EditorManager
*
editorManager
()
const
;
Core
::
EditorManager
*
editorManager
()
const
;
Core
::
ProgressManager
*
progressManager
()
const
;
Core
::
ProgressManager
*
progressManager
()
const
;
Core
::
ScriptManager
*
scriptManager
()
const
;
Core
::
ScriptManager
*
scriptManager
()
const
;
...
@@ -195,8 +189,6 @@ private:
...
@@ -195,8 +189,6 @@ private:
QMap
<
QWidget
*
,
IContext
*>
m_contextWidgets
;
QMap
<
QWidget
*
,
IContext
*>
m_contextWidgets
;
ExtensionSystem
::
PluginManager
*
m_pluginManager
;
BaseMode
*
m_outputMode
;
BaseMode
*
m_outputMode
;
GeneralSettings
*
m_generalSettings
;
GeneralSettings
*
m_generalSettings
;
ShortcutSettings
*
m_shortcutSettings
;
ShortcutSettings
*
m_shortcutSettings
;
...
...
src/plugins/coreplugin/messagemanager.cpp
View file @
f9679651
...
@@ -44,26 +44,26 @@ using namespace Core;
...
@@ -44,26 +44,26 @@ using namespace Core;
MessageManager
*
MessageManager
::
m_instance
=
0
;
MessageManager
*
MessageManager
::
m_instance
=
0
;
MessageManager
::
MessageManager
()
MessageManager
::
MessageManager
()
:
m_pm
(
0
),
m_messageOutputWindow
(
0
)
:
m_messageOutputWindow
(
0
)
{
{
m_instance
=
this
;
m_instance
=
this
;
}
}
MessageManager
::~
MessageManager
()
MessageManager
::~
MessageManager
()
{
{
if
(
m_pm
&&
m_messageOutputWindow
)
{
ExtensionSystem
::
PluginManager
*
pm
=
ExtensionSystem
::
PluginManager
::
instance
();
m_pm
->
removeObject
(
m_messageOutputWindow
);
if
(
pm
&&
m_messageOutputWindow
)
{
pm
->
removeObject
(
m_messageOutputWindow
);
delete
m_messageOutputWindow
;
delete
m_messageOutputWindow
;
}
}
m_instance
=
0
;
m_instance
=
0
;
}
}
void
MessageManager
::
init
(
ExtensionSystem
::
PluginManager
*
pm
)
void
MessageManager
::
init
()
{
{
m_pm
=
pm
;
m_messageOutputWindow
=
new
Internal
::
MessageOutputWindow
;
m_messageOutputWindow
=
new
Internal
::
MessageOutputWindow
;
pm
->
addObject
(
m_messageOutputWindow
);
ExtensionSystem
::
PluginManager
::
instance
()
->
addObject
(
m_messageOutputWindow
);
}
}
void
MessageManager
::
showOutputPane
()
void
MessageManager
::
showOutputPane
()
...
...
src/plugins/coreplugin/messagemanager.h
View file @
f9679651
...
@@ -37,8 +37,6 @@
...
@@ -37,8 +37,6 @@
#include "core_global.h"
#include "core_global.h"
#include <QtCore/QObject>
#include <QtCore/QObject>
namespace
ExtensionSystem
{
class
PluginManager
;
}
namespace
Core
{
namespace
Core
{
namespace
Internal
{
namespace
Internal
{
...
@@ -53,7 +51,7 @@ public:
...
@@ -53,7 +51,7 @@ public:
MessageManager
();
MessageManager
();
~
MessageManager
();
~
MessageManager
();
void
init
(
ExtensionSystem
::
PluginManager
*
pm
);
void
init
();
static
MessageManager
*
instance
()
{
return
m_instance
;
}
static
MessageManager
*
instance
()
{
return
m_instance
;
}
...
@@ -64,7 +62,6 @@ public slots:
...
@@ -64,7 +62,6 @@ public slots:
void
printToOutputPane
(
const
QString
&
text
,
bool
bringToForeground
=
true
);
void
printToOutputPane
(
const
QString
&
text
,
bool
bringToForeground
=
true
);
private:
private:
ExtensionSystem
::
PluginManager
*
m_pm
;
Internal
::
MessageOutputWindow
*
m_messageOutputWindow
;
Internal
::
MessageOutputWindow
*
m_messageOutputWindow
;
static
MessageManager
*
m_instance
;
static
MessageManager
*
m_instance
;
...
...
src/plugins/coreplugin/viewmanager.cpp
View file @
f9679651
...
@@ -115,7 +115,8 @@ void ViewManager::saveSettings(QSettings *settings)
...
@@ -115,7 +115,8 @@ void ViewManager::saveSettings(QSettings *settings)
IView
*
ViewManager
::
view
(
const
QString
&
id
)
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
)
{
foreach
(
IView
*
view
,
list
)
{
if
(
view
->
uniqueViewName
()
==
id
)
if
(
view
->
uniqueViewName
()
==
id
)
return
view
;
return
view
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment