Skip to content
GitLab
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
d6a459c3
Commit
d6a459c3
authored
Jan 04, 2011
by
hjk
Browse files
cppmodelmanagerinterface: use singleton instead of object pool
parent
9d72c553
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/cmakeprojectmanager/cmakeproject.cpp
View file @
d6a459c3
...
...
@@ -96,7 +96,7 @@ CMakeProject::~CMakeProject()
{
// Remove CodeModel support
CPlusPlus
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
=
CPlusPlus
::
CppModelManagerInterface
::
instance
();
QMap
<
QString
,
CMakeUiCodeModelSupport
*>::
const_iterator
it
,
end
;
it
=
m_uiCodeModelSupport
.
constBegin
();
end
=
m_uiCodeModelSupport
.
constEnd
();
...
...
@@ -283,7 +283,7 @@ bool CMakeProject::parseCMakeLists()
allIncludePaths
.
append
(
cbpparser
.
includeFiles
());
CPlusPlus
::
CppModelManagerInterface
*
modelmanager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
CPlusPlus
::
CppModelManagerInterface
::
instance
();
if
(
modelmanager
)
{
CPlusPlus
::
CppModelManagerInterface
::
ProjectInfo
pinfo
=
modelmanager
->
projectInfo
(
this
);
if
(
pinfo
.
includePaths
!=
allIncludePaths
...
...
@@ -609,7 +609,7 @@ void CMakeProject::createUiCodeModelSupport()
{
// qDebug()<<"creatUiCodeModelSupport()";
CPlusPlus
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
=
CPlusPlus
::
CppModelManagerInterface
::
instance
();
// First move all to
QMap
<
QString
,
CMakeUiCodeModelSupport
*>
oldCodeModelSupport
;
...
...
src/plugins/debugger/watchutils.cpp
View file @
d6a459c3
...
...
@@ -710,16 +710,6 @@ bool currentTextEditorPosition(QString *fileNameIn /* = 0 */,
return
!
fileName
.
isEmpty
();
}
static
CPlusPlus
::
CppModelManagerInterface
*
cppModelManager
()
{
using
namespace
CPlusPlus
;
static
QPointer
<
CppModelManagerInterface
>
modelManager
;
if
(
!
modelManager
.
data
())
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
return
modelManager
.
data
();
}
// Return the Cpp expression, and, if desired, the function
QString
cppExpressionAt
(
TextEditor
::
ITextEditor
*
editor
,
int
pos
,
int
*
line
,
int
*
column
,
QString
*
function
/* = 0 */
)
...
...
@@ -735,7 +725,7 @@ QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
return
QByteArray
();
QString
expr
=
plaintext
->
textCursor
().
selectedText
();
CppModelManagerInterface
*
modelManager
=
c
ppModelManager
();
CppModelManagerInterface
*
modelManager
=
C
ppModelManager
Interface
::
instance
();
if
(
expr
.
isEmpty
()
&&
modelManager
)
{
QTextCursor
tc
(
plaintext
->
document
());
tc
.
setPosition
(
pos
);
...
...
src/plugins/designer/qtcreatorintegration.cpp
View file @
d6a459c3
...
...
@@ -89,12 +89,6 @@ static QString msgClassNotFound(const QString &uiClassName, const QList<Document
return
QtCreatorIntegration
::
tr
(
"The class definition of '%1' could not be found in %2."
).
arg
(
uiClassName
,
files
);
}
static
inline
CppModelManagerInterface
*
cppModelManagerInstance
()
{
return
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CppModelManagerInterface
>
();
}
QtCreatorIntegration
::
QtCreatorIntegration
(
QDesignerFormEditorInterface
*
core
,
FormEditorW
*
parent
)
:
qdesigner_internal
::
QDesignerIntegration
(
core
,
::
qobject_cast
<
QObject
*>
(
parent
)),
m_few
(
parent
)
...
...
@@ -259,7 +253,7 @@ static Function *findDeclaration(const Class *cl, const QString &functionName)
// TODO: remove me, this is taken from cppeditor.cpp. Find some common place for this method
static
Document
::
Ptr
findDefinition
(
Function
*
functionDeclaration
,
int
*
line
)
{
if
(
CppModelManagerInterface
*
cppModelManager
=
c
ppModelManagerInstance
())
{
if
(
CppModelManagerInterface
*
cppModelManager
=
C
ppModelManagerIn
terface
::
in
stance
())
{
const
Snapshot
snapshot
=
cppModelManager
->
snapshot
();
if
(
Symbol
*
def
=
snapshot
.
findMatchingDefinition
(
functionDeclaration
))
{
...
...
@@ -537,7 +531,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
*
errorMessage
=
tr
(
"Internal error: No project could be found for %1."
).
arg
(
currentUiFile
);
return
false
;
}
CPlusPlus
::
Snapshot
docTable
=
c
ppModelManagerInstance
()
->
snapshot
();
CPlusPlus
::
Snapshot
docTable
=
C
ppModelManagerIn
terface
::
in
stance
()
->
snapshot
();
CPlusPlus
::
Snapshot
newDocTable
;
for
(
CPlusPlus
::
Snapshot
::
iterator
it
=
docTable
.
begin
();
it
!=
docTable
.
end
();
++
it
)
{
...
...
@@ -606,7 +600,8 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
}
}
else
{
// add function declaration to cl
CppModelManagerInterface
::
WorkingCopy
workingCopy
=
cppModelManagerInstance
()
->
workingCopy
();
CppModelManagerInterface
::
WorkingCopy
workingCopy
=
CppModelManagerInterface
::
instance
()
->
workingCopy
();
const
QString
fileName
=
doc
->
fileName
();
getParsedDocument
(
fileName
,
workingCopy
,
docTable
);
addDeclaration
(
docTable
,
fileName
,
cl
,
functionNameWithParameterNames
);
...
...
src/plugins/genericprojectmanager/genericproject.cpp
View file @
d6a459c3
...
...
@@ -204,7 +204,7 @@ void GenericProject::refresh(RefreshOptions options)
m_rootNode
->
refresh
();
CPlusPlus
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
CPlusPlus
::
CppModelManagerInterface
::
instance
();
if
(
m_toolChain
&&
modelManager
)
{
const
QByteArray
predefinedMacros
=
m_toolChain
->
predefinedMacros
();
...
...
src/plugins/qt4projectmanager/qt4nodes.cpp
View file @
d6a459c3
...
...
@@ -1329,7 +1329,7 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project,
Qt4ProFileNode
::~
Qt4ProFileNode
()
{
CPlusPlus
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
=
CPlusPlus
::
CppModelManagerInterface
::
instance
();
QMap
<
QString
,
Qt4UiCodeModelSupport
*>::
const_iterator
it
,
end
;
end
=
m_uiCodeModelSupport
.
constEnd
();
for
(
it
=
m_uiCodeModelSupport
.
constBegin
();
it
!=
end
;
++
it
)
{
...
...
@@ -1891,7 +1891,7 @@ QStringList Qt4ProFileNode::updateUiFiles()
}
CPlusPlus
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
CPlusPlus
::
CppModelManagerInterface
::
instance
();
if
(
!
toAdd
.
isEmpty
())
{
foreach
(
FileNode
*
file
,
toAdd
)
{
...
...
@@ -2193,7 +2193,7 @@ void Qt4ProFileNode::createUiCodeModelSupport()
{
// qDebug()<<"creatUiCodeModelSupport()";
CPlusPlus
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
=
CPlusPlus
::
CppModelManagerInterface
::
instance
();
// First move all to
QMap
<
QString
,
Qt4UiCodeModelSupport
*>
oldCodeModelSupport
;
...
...
src/plugins/qt4projectmanager/qt4project.cpp
View file @
d6a459c3
...
...
@@ -422,8 +422,7 @@ void Qt4Project::updateCppCodeModel()
Qt4BuildConfiguration
*
activeBC
=
activeTarget
()
->
activeBuildConfiguration
();
CPlusPlus
::
CppModelManagerInterface
*
modelmanager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
CPlusPlus
::
CppModelManagerInterface
>
();
CPlusPlus
::
CppModelManagerInterface
::
instance
();
if
(
!
modelmanager
)
return
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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