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
12018c89
Commit
12018c89
authored
Mar 04, 2009
by
hjk
Browse files
Fixes: simplify ProjectExplorerPlugin::instance() access
parent
4deb3668
Changes
16
Hide whitespace changes
Inline
Side-by-side
src/plugins/bookmarks/bookmarkmanager.cpp
View file @
12018c89
...
...
@@ -36,7 +36,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <texteditor/basetexteditor.h>
#include <utils/qtcassert.h>
...
...
@@ -306,18 +305,15 @@ QWidget *BookmarkContext::widget()
// BookmarkManager
////
BookmarkManager
::
BookmarkManager
()
:
m_bookmarkIcon
(
QIcon
(
QLatin1String
(
":/bookmarks/images/bookmark.png"
)))
BookmarkManager
::
BookmarkManager
()
:
m_bookmarkIcon
(
QIcon
(
QLatin1String
(
":/bookmarks/images/bookmark.png"
)))
{
m_selectionModel
=
new
QItemSelectionModel
(
this
,
this
);
connect
(
Core
::
ICore
::
instance
(),
SIGNAL
(
contextChanged
(
Core
::
IContext
*
)),
this
,
SLOT
(
updateActionStatus
()));
ExtensionSystem
::
PluginManager
*
pm
=
ExtensionSystem
::
PluginManager
::
instance
();
ProjectExplorerPlugin
*
projectExplorer
=
pm
->
getObject
<
ProjectExplorerPlugin
>
();
connect
(
projectExplorer
->
session
(),
SIGNAL
(
sessionLoaded
()),
connect
(
ProjectExplorerPlugin
::
instance
()
->
session
(),
SIGNAL
(
sessionLoaded
()),
this
,
SLOT
(
loadBookmarks
()));
updateActionStatus
();
...
...
@@ -559,9 +555,7 @@ TextEditor::ITextEditor *BookmarkManager::currentTextEditor() const
/* Returns the current session. */
SessionManager
*
BookmarkManager
::
sessionManager
()
const
{
ExtensionSystem
::
PluginManager
*
pm
=
ExtensionSystem
::
PluginManager
::
instance
();
ProjectExplorerPlugin
*
pe
=
pm
->
getObject
<
ProjectExplorerPlugin
>
();
return
pe
->
session
();
return
ProjectExplorerPlugin
::
instance
()
->
session
();
}
BookmarkManager
::
State
BookmarkManager
::
state
()
const
...
...
src/plugins/cpaster/cpasterplugin.cpp
View file @
12018c89
...
...
@@ -42,7 +42,6 @@
#include <coreplugin/messagemanager.h>
#include <coreplugin/messageoutputwindow.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/itexteditor.h>
#include <QtCore/QtPlugin>
...
...
@@ -116,8 +115,6 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
void
CodepasterPlugin
::
extensionsInitialized
()
{
m_projectExplorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
}
QString
CodepasterPlugin
::
serverUrl
()
const
...
...
src/plugins/cpaster/cpasterplugin.h
View file @
12018c89
...
...
@@ -37,7 +37,6 @@
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/icorelistener.h>
#include <extensionsystem/iplugin.h>
#include <projectexplorer/projectexplorer.h>
#include <QtCore/QObject>
...
...
@@ -70,7 +69,6 @@ private:
QAction
*
m_postAction
;
QAction
*
m_fetchAction
;
ProjectExplorer
::
ProjectExplorerPlugin
*
m_projectExplorer
;
SettingsPage
*
m_settingsPage
;
CustomFetcher
*
m_fetcher
;
CustomPoster
*
m_poster
;
...
...
src/plugins/cpptools/cppmodelmanager.cpp
View file @
12018c89
...
...
@@ -48,7 +48,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <TranslationUnit.h>
...
...
@@ -545,12 +544,12 @@ CppModelManager::CppModelManager(QObject *parent)
m_core
=
Core
::
ICore
::
instance
();
// FIXME
m_dirty
=
true
;
m_p
rojectExplorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
P
rojectExplorer
::
ProjectExplorerPlugin
*
pe
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
QTC_ASSERT
(
m_projectExplorer
,
return
);
QTC_ASSERT
(
pe
,
return
);
ProjectExplorer
::
SessionManager
*
session
=
m_projectExplorer
->
session
();
ProjectExplorer
::
SessionManager
*
session
=
pe
->
session
();
QTC_ASSERT
(
session
,
return
);
m_updateEditorSelectionsTimer
=
new
QTimer
(
this
);
...
...
@@ -586,7 +585,9 @@ CppModelManager::~CppModelManager()
{
}
Snapshot
CppModelManager
::
snapshot
()
const
{
return
m_snapshot
;
}
{
return
m_snapshot
;
}
void
CppModelManager
::
ensureUpdated
()
{
...
...
src/plugins/cpptools/cppmodelmanager.h
View file @
12018c89
...
...
@@ -148,7 +148,6 @@ private:
private:
Core
::
ICore
*
m_core
;
ProjectExplorer
::
ProjectExplorerPlugin
*
m_projectExplorer
;
CPlusPlus
::
Snapshot
m_snapshot
;
// cache
...
...
src/plugins/cpptools/cpptoolsplugin.cpp
View file @
12018c89
...
...
@@ -44,7 +44,6 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <cppeditor/cppeditorconstants.h>
#include <extensionsystem/pluginmanager.h>
#include <QtCore/QtPlugin>
#include <QtCore/QFileInfo>
...
...
@@ -219,7 +218,7 @@ QString CppToolsPlugin::correspondingHeaderOrSourceI(const QString &fileName) co
const
Core
::
ICore
*
core
=
Core
::
ICore
::
instance
();
const
Core
::
MimeDatabase
*
mimeDatase
=
core
->
mimeDatabase
();
ProjectExplorer
::
ProjectExplorerPlugin
*
explorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
ProjectExplorer
::
Project
*
project
=
(
explorer
?
explorer
->
currentProject
()
:
0
);
const
QFileInfo
fi
(
fileName
);
...
...
src/plugins/debugger/stackwindow.cpp
View file @
12018c89
...
...
@@ -66,6 +66,7 @@ StackWindow::StackWindow(QWidget *parent)
void
StackWindow
::
resizeEvent
(
QResizeEvent
*
event
)
{
QHeaderView
*
hv
=
header
();
int
totalSize
=
event
->
size
().
width
()
-
120
;
if
(
totalSize
>
10
)
{
hv
->
resizeSection
(
0
,
45
);
...
...
src/plugins/git/gitplugin.cpp
View file @
12018c89
...
...
@@ -45,7 +45,6 @@
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
...
...
@@ -439,7 +438,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
void
GitPlugin
::
extensionsInitialized
()
{
m_projectExplorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
m_projectExplorer
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
}
void
GitPlugin
::
submitEditorDiff
(
const
QStringList
&
unstaged
,
const
QStringList
&
staged
)
...
...
src/plugins/perforce/perforceplugin.cpp
View file @
12018c89
...
...
@@ -47,7 +47,6 @@
#include <coreplugin/messagemanager.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <utils/synchronousprocess.h>
#include <vcsbase/basevcseditorfactory.h>
...
...
@@ -386,7 +385,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
void
PerforcePlugin
::
extensionsInitialized
()
{
m_projectExplorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
m_projectExplorer
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
if
(
m_projectExplorer
)
{
connect
(
m_projectExplorer
,
SIGNAL
(
currentProjectChanged
(
ProjectExplorer
::
Project
*
)),
...
...
src/plugins/projectexplorer/projectwindow.cpp
View file @
12018c89
...
...
@@ -62,9 +62,8 @@ ProjectWindow::ProjectWindow(QWidget *parent) : QWidget(parent)
setWindowTitle
(
tr
(
"Project Explorer"
));
setWindowIcon
(
QIcon
(
":/projectexplorer/images/projectexplorer.png"
));
ExtensionSystem
::
PluginManager
*
pm
=
ExtensionSystem
::
PluginManager
::
instance
();
ProjectExplorerPlugin
*
projectExplorer
=
m_projectExplorer
=
pm
->
getObject
<
ProjectExplorerPlugin
>
();
m_session
=
projectExplorer
->
session
();
m_projectExplorer
=
ProjectExplorerPlugin
::
instance
();
m_session
=
m_projectExplorer
->
session
();
connect
(
m_session
,
SIGNAL
(
sessionLoaded
()),
this
,
SLOT
(
restoreStatus
()));
connect
(
m_session
,
SIGNAL
(
aboutToSaveSession
()),
this
,
SLOT
(
saveStatus
()));
...
...
src/plugins/qt4projectmanager/qt4projectmanager.cpp
View file @
12018c89
...
...
@@ -37,7 +37,6 @@
#include "qtversionmanager.h"
#include "qmakestep.h"
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/basefilewizard.h>
#include <coreplugin/messagemanager.h>
...
...
@@ -111,8 +110,7 @@ void Qt4Manager::notifyChanged(const QString &name)
void
Qt4Manager
::
init
()
{
m_projectExplorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
m_projectExplorer
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
}
int
Qt4Manager
::
projectContext
()
const
...
...
src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
View file @
12018c89
...
...
@@ -100,8 +100,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
if
(
!
core
->
mimeDatabase
()
->
addMimeTypes
(
QLatin1String
(
":qt4projectmanager/Qt4ProjectManager.mimetypes.xml"
),
errorMessage
))
return
false
;
m_projectExplorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
m_projectExplorer
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
Core
::
ActionManager
*
am
=
core
->
actionManager
();
...
...
src/plugins/qt4projectmanager/wizards/qtwizard.cpp
View file @
12018c89
...
...
@@ -32,7 +32,6 @@
#include "qt4projectmanagerconstants.h"
#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <QtCore/QByteArray>
...
...
@@ -60,8 +59,7 @@ static inline Core::BaseFileWizardParameters
// -------------------- QtWizard
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
>
())
Core
::
BaseFileWizard
(
wizardParameters
(
name
,
description
,
icon
))
{
}
...
...
@@ -89,7 +87,7 @@ bool QtWizard::postGenerateFiles(const Core::GeneratedFiles &l, QString *errorMe
{
// Post-Generate: Open the project
const
QString
proFileName
=
l
.
back
().
path
();
if
(
!
m_projectExplorer
->
openProject
(
proFileName
))
{
if
(
!
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
()
->
openProject
(
proFileName
))
{
*
errorMessage
=
tr
(
"The project %1 could not be opened."
).
arg
(
proFileName
);
return
false
;
}
...
...
src/plugins/qt4projectmanager/wizards/qtwizard.h
View file @
12018c89
...
...
@@ -34,9 +34,6 @@
#include <coreplugin/basefilewizard.h>
namespace
ProjectExplorer
{
class
ProjectExplorerPlugin
;
}
namespace
Qt4ProjectManager
{
namespace
Internal
{
...
...
@@ -66,8 +63,6 @@ protected:
private:
bool
postGenerateFiles
(
const
Core
::
GeneratedFiles
&
l
,
QString
*
errorMessage
);
ProjectExplorer
::
ProjectExplorerPlugin
*
m_projectExplorer
;
};
}
// namespace Internal
...
...
src/plugins/subversion/subversionplugin.cpp
View file @
12018c89
...
...
@@ -50,7 +50,6 @@
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <utils/qtcassert.h>
...
...
@@ -432,10 +431,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
void
SubversionPlugin
::
extensionsInitialized
()
{
using
namespace
ExtensionSystem
;
using
namespace
ProjectExplorer
;
m_projectExplorer
=
PluginManager
::
instance
()
->
getObject
<
ProjectExplorerPlugin
>
();
m_projectExplorer
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
if
(
m_projectExplorer
)
{
connect
(
m_projectExplorer
,
SIGNAL
(
currentProjectChanged
(
ProjectExplorer
::
Project
*
)),
...
...
src/plugins/vcsbase/vcsbasesubmiteditor.cpp
View file @
12018c89
...
...
@@ -30,10 +30,10 @@
#include "vcsbasesubmiteditor.h"
#include "submiteditorfile.h"
#include <aggregation/aggregate.h>
#include <coreplugin/ifile.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/submiteditorwidget.h>
#include <find/basetextfind.h>
...
...
@@ -316,23 +316,24 @@ QIcon VCSBaseSubmitEditor::submitIcon()
QStringList
VCSBaseSubmitEditor
::
currentProjectFiles
(
bool
nativeSeparators
,
QString
*
name
)
{
using
namespace
ProjectExplorer
;
if
(
name
)
name
->
clear
();
ProjectExplorer
::
ProjectExplorerPlugin
*
projectExplorer
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
ProjectExplorer
::
ProjectExplorerPlugin
>
();
if
(
!
p
rojectExplorer
)
ProjectExplorerPlugin
*
p
e
=
P
rojectExplorer
Plugin
::
instance
();
if
(
!
p
e
)
return
QStringList
();
QStringList
files
;
if
(
const
ProjectExplorer
::
Project
*
currentProject
=
p
rojectExplorer
->
currentProject
())
{
files
<<
currentProject
->
files
(
ProjectExplorer
::
Project
::
ExcludeGeneratedFiles
);
if
(
const
Project
*
currentProject
=
p
e
->
currentProject
())
{
files
<<
currentProject
->
files
(
Project
::
ExcludeGeneratedFiles
);
if
(
name
)
*
name
=
currentProject
->
name
();
}
else
{
if
(
const
ProjectExplorer
::
SessionManager
*
session
=
p
rojectExplorer
->
session
())
{
if
(
const
SessionManager
*
session
=
p
e
->
session
())
{
if
(
name
)
*
name
=
session
->
file
()
->
fileName
();
const
QList
<
Project
Explorer
::
Project
*>
projects
=
session
->
projects
();
foreach
(
Project
Explorer
::
Project
*
project
,
projects
)
files
<<
project
->
files
(
ProjectExplorer
::
Project
::
ExcludeGeneratedFiles
);
const
QList
<
Project
*>
projects
=
session
->
projects
();
foreach
(
Project
*
project
,
projects
)
files
<<
project
->
files
(
Project
::
ExcludeGeneratedFiles
);
}
}
if
(
nativeSeparators
&&
!
files
.
empty
())
{
...
...
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