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
Tobias Hunger
qt-creator
Commits
5f50a6ae
Commit
5f50a6ae
authored
Dec 03, 2010
by
Christian Kamm
Browse files
C++: Move the ModelManagerInterface from CppTools to CPlusPlus.
parent
5de7be5f
Changes
45
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/ModelManagerInterface.cpp
0 → 100644
View file @
5f50a6ae
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include
"ModelManagerInterface.h"
using
namespace
CPlusPlus
;
static
CppModelManagerInterface
*
g_instance
=
0
;
CppModelManagerInterface
::
CppModelManagerInterface
(
QObject
*
parent
)
:
QObject
(
parent
)
{
Q_ASSERT
(
!
g_instance
);
g_instance
=
this
;
}
CppModelManagerInterface
::~
CppModelManagerInterface
()
{
Q_ASSERT
(
g_instance
==
this
);
g_instance
=
0
;
}
CppModelManagerInterface
*
CppModelManagerInterface
::
instance
()
{
return
g_instance
;
}
src/
plugins/cpptools/cppm
odel
m
anager
i
nterface.h
→
src/
libs/cplusplus/M
odel
M
anager
I
nterface.h
View file @
5f50a6ae
...
...
@@ -34,7 +34,6 @@
#ifndef CPPMODELMANAGERINTERFACE_H
#define CPPMODELMANAGERINTERFACE_H
#include
<cpptools/cpptools_global.h>
#include
<cplusplus/CppDocument.h>
#include
<QtCore/QObject>
#include
<QtCore/QHash>
...
...
@@ -59,14 +58,12 @@ namespace TextEditor {
}
namespace
CppTools
{
class
AbstractEditorSupport
;
namespace
Internal
{
class
CppEditorSupport
;
class
AbstractEditorSupport
;
}
class
CPPTOOLS_EXPORT
CppModelManagerInterface
:
public
QObject
namespace
CPlusPlus
{
class
CPLUSPLUS_EXPORT
CppModelManagerInterface
:
public
QObject
{
Q_OBJECT
...
...
@@ -121,8 +118,8 @@ public:
};
public:
CppModelManagerInterface
(
QObject
*
parent
=
0
)
:
QObject
(
parent
)
{}
virtual
~
CppModelManagerInterface
()
{}
CppModelManagerInterface
(
QObject
*
parent
=
0
)
;
virtual
~
CppModelManagerInterface
()
;
static
CppModelManagerInterface
*
instance
();
...
...
@@ -137,8 +134,8 @@ public:
virtual
QStringList
includesInPath
(
const
QString
&
path
)
const
=
0
;
virtual
void
addEditorSupport
(
AbstractEditorSupport
*
editorSupport
)
=
0
;
virtual
void
removeEditorSupport
(
AbstractEditorSupport
*
editorSupport
)
=
0
;
virtual
void
addEditorSupport
(
CppTools
::
AbstractEditorSupport
*
editorSupport
)
=
0
;
virtual
void
removeEditorSupport
(
CppTools
::
AbstractEditorSupport
*
editorSupport
)
=
0
;
virtual
QList
<
int
>
references
(
CPlusPlus
::
Symbol
*
symbol
,
const
CPlusPlus
::
LookupContext
&
context
)
=
0
;
...
...
@@ -153,33 +150,11 @@ Q_SIGNALS:
void
documentUpdated
(
CPlusPlus
::
Document
::
Ptr
doc
);
public
Q_SLOTS
:
void
updateModifiedSourceFiles
();
virtual
void
updateModifiedSourceFiles
()
=
0
;
virtual
QFuture
<
void
>
updateSourceFiles
(
const
QStringList
&
sourceFiles
)
=
0
;
virtual
void
GC
()
=
0
;
};
class
CPPTOOLS_EXPORT
AbstractEditorSupport
{
public:
explicit
AbstractEditorSupport
(
CppModelManagerInterface
*
modelmanager
);
virtual
~
AbstractEditorSupport
();
virtual
QByteArray
contents
()
const
=
0
;
virtual
QString
fileName
()
const
=
0
;
void
updateDocument
();
// TODO: find a better place for common utility functions
static
QString
functionAt
(
const
CppModelManagerInterface
*
mm
,
const
QString
&
fileName
,
int
line
,
int
column
);
static
QString
licenseTemplate
(
const
QString
&
file
=
QString
(),
const
QString
&
className
=
QString
());
private:
CppModelManagerInterface
*
m_modelmanager
;
};
}
// namespace CppTools
}
// namespace CPlusPlus
#endif // CPPMODELMANAGERINTERFACE_H
src/libs/cplusplus/cplusplus-lib.pri
View file @
5f50a6ae
...
...
@@ -50,7 +50,8 @@ HEADERS += \
$$PWD/pp-cctype.h \
$$PWD/pp-engine.h \
$$PWD/pp-macro-expander.h \
$$PWD/pp-scanner.h
$$PWD/pp-scanner.h \
$$PWD/ModelManagerInterface.h
SOURCES += \
$$PWD/SimpleLexer.cpp \
...
...
@@ -76,6 +77,7 @@ SOURCES += \
$$PWD/Macro.cpp \
$$PWD/pp-engine.cpp \
$$PWD/pp-macro-expander.cpp \
$$PWD/pp-scanner.cpp
$$PWD/pp-scanner.cpp \
$$PWD/ModelManagerInterface.cpp
RESOURCES += $$PWD/cplusplus.qrc
src/plugins/classview/classviewmanager.cpp
View file @
5f50a6ae
...
...
@@ -41,7 +41,7 @@
#include
<projectexplorer/projectexplorer.h>
#include
<projectexplorer/session.h>
#include
<texteditor/basetexteditor.h>
#include
<cp
ptools/cppm
odel
m
anager
i
nterface.h>
#include
<cp
lusplus/M
odel
M
anager
I
nterface.h>
#include
<cpptools/cpptoolsconstants.h>
#include
<coreplugin/icore.h>
#include
<coreplugin/progressmanager/progressmanager.h>
...
...
@@ -86,7 +86,7 @@ struct ManagerPrivate
QThread
parserThread
;
//! cpp code model manager
QPointer
<
C
ppTool
s
::
CppModelManagerInterface
>
codeModelManager
;
QPointer
<
C
PlusPlu
s
::
CppModelManagerInterface
>
codeModelManager
;
//! there is some massive operation ongoing so temporary we should wait
bool
disableCodeParser
;
...
...
@@ -167,7 +167,7 @@ void Manager::initialize()
SLOT
(
onAllTasksFinished
(
QString
)),
Qt
::
QueuedConnection
);
// connect to the cpp model manager for signals about document updates
d_ptr
->
codeModelManager
=
C
ppTool
s
::
CppModelManagerInterface
::
instance
();
d_ptr
->
codeModelManager
=
C
PlusPlu
s
::
CppModelManagerInterface
::
instance
();
// when code manager signals that document is updated - handle it by ourselves
connect
(
d_ptr
->
codeModelManager
,
SIGNAL
(
documentUpdated
(
CPlusPlus
::
Document
::
Ptr
)),
...
...
src/plugins/classview/classviewparser.cpp
View file @
5f50a6ae
...
...
@@ -42,9 +42,9 @@
#include
<Name.h>
// other
#include
<cplusplus/ModelManagerInterface.h>
#include
<cplusplus/Overview.h>
#include
<cplusplus/Icons.h>
#include
<cpptools/cppmodelmanagerinterface.h>
#include
<projectexplorer/projectexplorer.h>
#include
<projectexplorer/session.h>
#include
<projectexplorer/project.h>
...
...
@@ -570,7 +570,7 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
void
Parser
::
resetDataToCurrentState
()
{
// get latest data
C
ppTool
s
::
CppModelManagerInterface
*
codeModel
=
C
ppTool
s
::
CppModelManagerInterface
::
instance
();
C
PlusPlu
s
::
CppModelManagerInterface
*
codeModel
=
C
PlusPlu
s
::
CppModelManagerInterface
::
instance
();
if
(
codeModel
)
resetData
(
codeModel
->
snapshot
());
}
...
...
src/plugins/classview/classviewparser.h
View file @
5f50a6ae
...
...
@@ -44,8 +44,8 @@
#include
<QtCore/QSharedPointer>
#include
<CPlusPlusForwardDeclarations.h>
#include
<cplusplus/ModelManagerInterface.h>
#include
<cplusplus/CppDocument.h>
#include
<cpptools/cppmodelmanagerinterface.h>
// might be changed to forward declaration - is not done to be less dependent
#include
<projectexplorer/projectnodes.h>
...
...
src/plugins/cmakeprojectmanager/cmakeproject.cpp
View file @
5f50a6ae
...
...
@@ -47,7 +47,7 @@
#include
<projectexplorer/buildsteplist.h>
#include
<projectexplorer/buildmanager.h>
#include
<projectexplorer/toolchain.h>
#include
<cp
ptools/cppm
odel
m
anager
i
nterface.h>
#include
<cp
lusplus/M
odel
M
anager
I
nterface.h>
#include
<extensionsystem/pluginmanager.h>
#include
<designer/formwindoweditor.h>
#include
<utils/qtcassert.h>
...
...
@@ -95,8 +95,8 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
CMakeProject
::~
CMakeProject
()
{
// Remove CodeModel support
C
ppTool
s
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
C
ppTool
s
::
CppModelManagerInterface
>
();
C
PlusPlu
s
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
C
PlusPlu
s
::
CppModelManagerInterface
>
();
QMap
<
QString
,
CMakeUiCodeModelSupport
*>::
const_iterator
it
,
end
;
it
=
m_uiCodeModelSupport
.
constBegin
();
end
=
m_uiCodeModelSupport
.
constEnd
();
...
...
@@ -282,10 +282,10 @@ bool CMakeProject::parseCMakeLists()
allIncludePaths
.
append
(
projectDirectory
());
allIncludePaths
.
append
(
cbpparser
.
includeFiles
());
C
ppTool
s
::
CppModelManagerInterface
*
modelmanager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
C
ppTool
s
::
CppModelManagerInterface
>
();
C
PlusPlu
s
::
CppModelManagerInterface
*
modelmanager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
C
PlusPlu
s
::
CppModelManagerInterface
>
();
if
(
modelmanager
)
{
C
ppTool
s
::
CppModelManagerInterface
::
ProjectInfo
pinfo
=
modelmanager
->
projectInfo
(
this
);
C
PlusPlu
s
::
CppModelManagerInterface
::
ProjectInfo
pinfo
=
modelmanager
->
projectInfo
(
this
);
if
(
pinfo
.
includePaths
!=
allIncludePaths
||
pinfo
.
sourceFiles
!=
m_files
||
pinfo
.
defines
!=
activeBC
->
toolChain
()
->
predefinedMacros
()
...
...
@@ -608,8 +608,8 @@ QString CMakeProject::uiHeaderFile(const QString &uiFile)
void
CMakeProject
::
createUiCodeModelSupport
()
{
// qDebug()<<"creatUiCodeModelSupport()";
C
ppTool
s
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
C
ppTool
s
::
CppModelManagerInterface
>
();
C
PlusPlu
s
::
CppModelManagerInterface
*
modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
C
PlusPlu
s
::
CppModelManagerInterface
>
();
// First move all to
QMap
<
QString
,
CMakeUiCodeModelSupport
*>
oldCodeModelSupport
;
...
...
src/plugins/cmakeprojectmanager/cmakeuicodemodelsupport.cpp
View file @
5f50a6ae
...
...
@@ -36,12 +36,14 @@
#include
"cmaketarget.h"
#include
"cmakebuildconfiguration.h"
#include
<cplusplus/ModelManagerInterface.h>
#include
<QtCore/QProcess>
using
namespace
CMakeProjectManager
;
using
namespace
Internal
;
CMakeUiCodeModelSupport
::
CMakeUiCodeModelSupport
(
C
ppTool
s
::
CppModelManagerInterface
*
modelmanager
,
CMakeUiCodeModelSupport
::
CMakeUiCodeModelSupport
(
C
PlusPlu
s
::
CppModelManagerInterface
*
modelmanager
,
CMakeProject
*
project
,
const
QString
&
source
,
const
QString
&
uiHeaderFile
)
...
...
src/plugins/cmakeprojectmanager/cmakeuicodemodelsupport.h
View file @
5f50a6ae
...
...
@@ -34,7 +34,7 @@
#ifndef CMAKEUICODEMODELSUPPORT_H
#define CMAKEUICODEMODELSUPPORT_H
#include
<cp
ptools/cppm
odel
m
anager
i
nterface.h>
#include
<cp
lusplus/M
odel
M
anager
I
nterface.h>
#include
<cpptools/uicodecompletionsupport.h>
#include
<QtCore/QDateTime>
...
...
@@ -47,7 +47,7 @@ class CMakeProject;
class
CMakeUiCodeModelSupport
:
public
CppTools
::
UiCodeModelSupport
{
public:
CMakeUiCodeModelSupport
(
C
ppTool
s
::
CppModelManagerInterface
*
modelmanager
,
CMakeUiCodeModelSupport
(
C
PlusPlu
s
::
CppModelManagerInterface
*
modelmanager
,
CMakeProject
*
project
,
const
QString
&
sourceFile
,
const
QString
&
uiHeaderFile
);
...
...
src/plugins/cppeditor/cppclasswizard.cpp
View file @
5f50a6ae
...
...
@@ -35,7 +35,7 @@
#include
"cppeditorconstants.h"
#include
<cpptools/cpptoolsconstants.h>
#include
<cpptools/
cppmodelmanagerinterface
.h>
#include
<cpptools/
abstracteditorsupport
.h>
#include
<coreplugin/icore.h>
#include
<coreplugin/mimedatabase.h>
...
...
src/plugins/cppeditor/cppeditor.cpp
View file @
5f50a6ae
...
...
@@ -54,6 +54,7 @@
#include
<SymbolVisitor.h>
#include
<TranslationUnit.h>
#include
<cplusplus/ASTPath.h>
#include
<cplusplus/ModelManagerInterface.h>
#include
<cplusplus/ExpressionUnderCursor.h>
#include
<cplusplus/TypeOfExpression.h>
#include
<cplusplus/Overview.h>
...
...
@@ -64,7 +65,6 @@
#include
<cplusplus/FastPreprocessor.h>
#include
<cpptools/cpptoolsplugin.h>
#include
<cpptools/cppmodelmanagerinterface.h>
#include
<cpptools/cpptoolsconstants.h>
#include
<cpptools/cppcodeformatter.h>
...
...
@@ -426,7 +426,7 @@ CPPEditor::CPPEditor(QWidget *parent)
baseTextDocument
()
->
setSyntaxHighlighter
(
new
CppHighlighter
);
m_modelManager
=
CppTools
::
CppModelManagerInterface
::
instance
();
m_modelManager
=
CppModelManagerInterface
::
instance
();
if
(
m_modelManager
)
{
connect
(
m_modelManager
,
SIGNAL
(
documentUpdated
(
CPlusPlus
::
Document
::
Ptr
)),
...
...
@@ -558,7 +558,7 @@ void CPPEditor::cut()
finishRename
();
}
CppTools
::
CppModelManagerInterface
*
CPPEditor
::
modelManager
()
const
CppModelManagerInterface
*
CPPEditor
::
modelManager
()
const
{
return
m_modelManager
;
}
...
...
@@ -666,7 +666,7 @@ const Macro *CPPEditor::findCanonicalMacro(const QTextCursor &cursor, Document::
void
CPPEditor
::
findUsages
()
{
SemanticInfo
info
=
m_lastSemanticInfo
;
info
.
snapshot
=
CppTools
::
CppModelManagerInterface
::
instance
()
->
snapshot
();
info
.
snapshot
=
CppModelManagerInterface
::
instance
()
->
snapshot
();
info
.
snapshot
.
insert
(
info
.
doc
);
CanonicalSymbol
cs
(
this
,
info
);
...
...
@@ -682,7 +682,7 @@ void CPPEditor::findUsages()
void
CPPEditor
::
renameUsagesNow
(
const
QString
&
replacement
)
{
SemanticInfo
info
=
m_lastSemanticInfo
;
info
.
snapshot
=
CppTools
::
CppModelManagerInterface
::
instance
()
->
snapshot
();
info
.
snapshot
=
CppModelManagerInterface
::
instance
()
->
snapshot
();
info
.
snapshot
.
insert
(
info
.
doc
);
CanonicalSymbol
cs
(
this
,
info
);
...
...
@@ -778,7 +778,7 @@ static QList<int> lazyFindReferences(Scope *scope, QString code, Document::Ptr d
snapshot
.
insert
(
doc
);
typeOfExpression
.
init
(
doc
,
snapshot
);
if
(
Symbol
*
canonicalSymbol
=
CanonicalSymbol
::
canonicalSymbol
(
scope
,
code
,
typeOfExpression
))
{
return
CppTools
::
CppModelManagerInterface
::
instance
()
->
references
(
canonicalSymbol
,
typeOfExpression
.
context
());
return
CppModelManagerInterface
::
instance
()
->
references
(
canonicalSymbol
,
typeOfExpression
.
context
());
}
return
QList
<
int
>
();
}
...
...
src/plugins/cppeditor/cppeditor.h
View file @
5f50a6ae
...
...
@@ -38,6 +38,7 @@
#include
"cppquickfix.h"
#include
"cppsemanticinfo.h"
#include
<cplusplus/ModelManagerInterface.h>
#include
<cplusplus/CppDocument.h>
#include
<cplusplus/LookupContext.h>
#include
<texteditor/basetexteditor.h>
...
...
@@ -178,7 +179,7 @@ public:
virtual
void
paste
();
// reimplemented from BaseTextEditor
virtual
void
cut
();
// reimplemented from BaseTextEditor
C
ppTool
s
::
CppModelManagerInterface
*
modelManager
()
const
;
C
PlusPlu
s
::
CppModelManagerInterface
*
modelManager
()
const
;
virtual
void
setMimeType
(
const
QString
&
mt
);
...
...
@@ -273,7 +274,7 @@ private:
QModelIndex
indexForPosition
(
int
line
,
int
column
,
const
QModelIndex
&
rootIndex
=
QModelIndex
())
const
;
C
ppTool
s
::
CppModelManagerInterface
*
m_modelManager
;
C
PlusPlu
s
::
CppModelManagerInterface
*
m_modelManager
;
QComboBox
*
m_outlineCombo
;
CPlusPlus
::
OverviewModel
*
m_outlineModel
;
...
...
src/plugins/cppeditor/cppelementevaluator.cpp
View file @
5f50a6ae
...
...
@@ -34,7 +34,6 @@
#include
"cppelementevaluator.h"
#include
<coreplugin/ifile.h>
#include
<cpptools/cppmodelmanagerinterface.h>
#include
<FullySpecifiedType.h>
#include
<Names.h>
...
...
@@ -42,6 +41,7 @@
#include
<Scope.h>
#include
<Symbol.h>
#include
<Symbols.h>
#include
<cplusplus/ModelManagerInterface.h>
#include
<cplusplus/ExpressionUnderCursor.h>
#include
<cplusplus/Overview.h>
#include
<cplusplus/TypeOfExpression.h>
...
...
@@ -86,7 +86,7 @@ namespace {
CppElementEvaluator
::
CppElementEvaluator
(
CPPEditor
*
editor
)
:
m_editor
(
editor
),
m_modelManager
(
CppTools
::
CppModelManagerInterface
::
instance
()),
m_modelManager
(
CppModelManagerInterface
::
instance
()),
m_tc
(
editor
->
textCursor
()),
m_lookupBaseClasses
(
false
)
{}
...
...
src/plugins/cppeditor/cppelementevaluator.h
View file @
5f50a6ae
...
...
@@ -82,7 +82,7 @@ private:
const
CPlusPlus
::
LookupContext
&
lookupContext
);
CPPEditor
*
m_editor
;
C
ppTool
s
::
CppModelManagerInterface
*
m_modelManager
;
C
PlusPlu
s
::
CppModelManagerInterface
*
m_modelManager
;
QTextCursor
m_tc
;
bool
m_lookupBaseClasses
;
QSharedPointer
<
CppElement
>
m_element
;
...
...
src/plugins/cppeditor/cppfilewizard.cpp
View file @
5f50a6ae
...
...
@@ -35,7 +35,7 @@
#include
"cppeditor.h"
#include
"cppeditorconstants.h"
#include
<cpptools/
cppmodelmanagerinterface
.h>
#include
<cpptools/
abstracteditorsupport
.h>
#include
<utils/codegeneration.h>
#include
<QtCore/QTextStream>
...
...
src/plugins/cppeditor/cpphoverhandler.cpp
View file @
5f50a6ae
...
...
@@ -38,7 +38,7 @@
#include
<coreplugin/editormanager/ieditor.h>
#include
<coreplugin/editormanager/editormanager.h>
#include
<coreplugin/helpmanager.h>
#include
<cp
ptools/cppm
odel
m
anager
i
nterface.h>
#include
<cp
lusplus/M
odel
M
anager
I
nterface.h>
#include
<extensionsystem/pluginmanager.h>
#include
<texteditor/itexteditor.h>
#include
<texteditor/basetexteditor.h>
...
...
src/plugins/cppeditor/cppplugin.cpp
View file @
5f50a6ae
...
...
@@ -62,8 +62,8 @@
#include
<texteditor/texteditorplugin.h>
#include
<texteditor/texteditorsettings.h>
#include
<texteditor/texteditorconstants.h>
#include
<cplusplus/ModelManagerInterface.h>
#include
<cpptools/cpptoolsconstants.h>
#include
<cpptools/cppmodelmanagerinterface.h>
#include
<QtCore/QFileInfo>
#include
<QtCore/QSettings>
...
...
@@ -307,7 +307,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
cppToolsMenu
->
addAction
(
createSeparator
(
am
,
this
,
globalContext
,
CppEditor
::
Constants
::
SEPARATOR4
));
m_updateCodeModelAction
=
new
QAction
(
tr
(
"Update Code Model"
),
this
);
cmd
=
am
->
registerAction
(
m_updateCodeModelAction
,
Core
::
Id
(
Constants
::
UPDATE_CODEMODEL
),
globalContext
);
C
ppTool
s
::
CppModelManagerInterface
*
cppModelManager
=
C
ppTool
s
::
CppModelManagerInterface
::
instance
();
C
PlusPlu
s
::
CppModelManagerInterface
*
cppModelManager
=
C
PlusPlu
s
::
CppModelManagerInterface
::
instance
();
connect
(
m_updateCodeModelAction
,
SIGNAL
(
triggered
()),
cppModelManager
,
SLOT
(
updateModifiedSourceFiles
()));
cppToolsMenu
->
addAction
(
cmd
);
...
...
src/plugins/cppeditor/cppquickfixcollector.cpp
View file @
5f50a6ae
...
...
@@ -36,9 +36,9 @@
#include
<extensionsystem/pluginmanager.h>
#include
<cplusplus/ModelManagerInterface.h>
#include
<cpptools/cpprefactoringchanges.h>
#include
<cpptools/cpptoolsconstants.h>
#include
<cpptools/cppmodelmanagerinterface.h>
#include
<AST.h>
#include
<cplusplus/ASTPath.h>
...
...
@@ -56,7 +56,7 @@ CppQuickFixCollector::~CppQuickFixCollector()
bool
CppQuickFixCollector
::
supportsEditor
(
TextEditor
::
ITextEditable
*
editor
)
{
return
C
ppTool
s
::
CppModelManagerInterface
::
instance
()
->
isCppEditor
(
editor
);
return
C
PlusPlu
s
::
CppModelManagerInterface
::
instance
()
->
isCppEditor
(
editor
);
}
TextEditor
::
QuickFixState
*
CppQuickFixCollector
::
initializeCompletion
(
TextEditor
::
BaseTextEditor
*
editor
)
...
...
@@ -78,7 +78,7 @@ TextEditor::QuickFixState *CppQuickFixCollector::initializeCompletion(TextEditor
CppQuickFixState
*
state
=
new
CppQuickFixState
(
editor
);
state
->
_path
=
path
;
state
->
_semanticInfo
=
info
;
state
->
_snapshot
=
C
ppTool
s
::
CppModelManagerInterface
::
instance
()
->
snapshot
();
state
->
_snapshot
=
C
PlusPlu
s
::
CppModelManagerInterface
::
instance
()
->
snapshot
();
state
->
_context
=
CPlusPlus
::
LookupContext
(
info
.
doc
,
state
->
snapshot
());
return
state
;
}
...
...
src/plugins/cpptools/abstracteditorsupport.cpp
View file @
5f50a6ae
...
...
@@ -31,7 +31,7 @@
**
**************************************************************************/
#include
"
cppmodelmanagerinterface
.h"
#include
"
abstracteditorsupport
.h"
#include
"cpptoolsconstants.h"
#include
"cppfilesettingspage.h"
...
...
@@ -46,6 +46,8 @@
#include
<coreplugin/icore.h>
#include
<QtCore/QDebug>
using
namespace
CPlusPlus
;
namespace
CppTools
{
AbstractEditorSupport
::
AbstractEditorSupport
(
CppModelManagerInterface
*
modelmanager
)
:
...
...
src/plugins/cpptools/abstracteditorsupport.h
0 → 100644
View file @
5f50a6ae
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef ABSTRACTEDITORSUPPORT_H
#define ABSTRACTEDITORSUPPORT_H
#include
"cpptools_global.h"
#include
<cplusplus/ModelManagerInterface.h>
namespace
CppTools
{
class
CPPTOOLS_EXPORT
AbstractEditorSupport
{
public:
explicit
AbstractEditorSupport
(
CPlusPlus
::
CppModelManagerInterface
*
modelmanager
);
virtual
~
AbstractEditorSupport
();
virtual
QByteArray
contents
()
const
=
0
;
virtual
QString
fileName
()
const
=
0
;
void
updateDocument
();
// TODO: find a better place for common utility functions
static
QString
functionAt
(
const
CPlusPlus
::
CppModelManagerInterface
*
mm
,
const
QString
&
fileName
,
int
line
,
int
column
);
static
QString
licenseTemplate
(
const
QString
&
file
=
QString
(),
const
QString
&
className
=
QString
());
private:
CPlusPlus
::
CppModelManagerInterface
*
m_modelmanager
;
};
}
#endif // ABSTRACTEDITORSUPPORT_H
Prev
1
2
3
Next
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