Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
14ddfc45
Commit
14ddfc45
authored
Dec 08, 2008
by
hjk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta
parents
8d3a774f
bf7486c0
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
226 additions
and
181 deletions
+226
-181
src/libs/cplusplus/CppDocument.cpp
src/libs/cplusplus/CppDocument.cpp
+2
-17
src/libs/cplusplus/CppDocument.h
src/libs/cplusplus/CppDocument.h
+9
-6
src/libs/cplusplus/TypeOfExpression.cpp
src/libs/cplusplus/TypeOfExpression.cpp
+1
-0
src/libs/cplusplus/TypeOfExpression.h
src/libs/cplusplus/TypeOfExpression.h
+3
-0
src/libs/cplusplus/cplusplus.pro
src/libs/cplusplus/cplusplus.pro
+14
-2
src/libs/cplusplus/pp-cctype.h
src/libs/cplusplus/pp-cctype.h
+8
-6
src/libs/cplusplus/pp-client.h
src/libs/cplusplus/pp-client.h
+6
-4
src/libs/cplusplus/pp-engine.cpp
src/libs/cplusplus/pp-engine.cpp
+5
-17
src/libs/cplusplus/pp-engine.h
src/libs/cplusplus/pp-engine.h
+4
-4
src/libs/cplusplus/pp-environment.cpp
src/libs/cplusplus/pp-environment.cpp
+3
-3
src/libs/cplusplus/pp-environment.h
src/libs/cplusplus/pp-environment.h
+7
-5
src/libs/cplusplus/pp-fwd.h
src/libs/cplusplus/pp-fwd.h
+0
-0
src/libs/cplusplus/pp-internal.h
src/libs/cplusplus/pp-internal.h
+2
-2
src/libs/cplusplus/pp-macro-expander.cpp
src/libs/cplusplus/pp-macro-expander.cpp
+1
-1
src/libs/cplusplus/pp-macro-expander.h
src/libs/cplusplus/pp-macro-expander.h
+2
-2
src/libs/cplusplus/pp-macro.h
src/libs/cplusplus/pp-macro.h
+25
-24
src/libs/cplusplus/pp-scanner.h
src/libs/cplusplus/pp-scanner.h
+2
-2
src/libs/cplusplus/pp.h
src/libs/cplusplus/pp.h
+0
-0
src/plugins/cmakeprojectmanager/cmakeproject.cpp
src/plugins/cmakeprojectmanager/cmakeproject.cpp
+45
-3
src/plugins/cmakeprojectmanager/cmakeproject.h
src/plugins/cmakeprojectmanager/cmakeproject.h
+5
-0
src/plugins/cmakeprojectmanager/cmakestep.cpp
src/plugins/cmakeprojectmanager/cmakestep.cpp
+1
-1
src/plugins/cpptools/cppcodecompletion.cpp
src/plugins/cpptools/cppcodecompletion.cpp
+7
-1
src/plugins/cpptools/cppmodelmanager.cpp
src/plugins/cpptools/cppmodelmanager.cpp
+16
-18
src/plugins/cpptools/cpptools.pro
src/plugins/cpptools/cpptools.pro
+1
-1
src/plugins/cpptools/rpp/rpp.pri
src/plugins/cpptools/rpp/rpp.pri
+0
-18
src/plugins/cpptools/searchsymbols.cpp
src/plugins/cpptools/searchsymbols.cpp
+1
-1
src/plugins/projectexplorer/projectexplorer.cpp
src/plugins/projectexplorer/projectexplorer.cpp
+3
-3
src/plugins/projectexplorer/projectexplorer.h
src/plugins/projectexplorer/projectexplorer.h
+1
-1
src/plugins/projectexplorer/session.cpp
src/plugins/projectexplorer/session.cpp
+18
-18
src/plugins/projectexplorer/session.h
src/plugins/projectexplorer/session.h
+2
-1
src/plugins/qt4projectmanager/qt4project.cpp
src/plugins/qt4projectmanager/qt4project.cpp
+3
-0
src/plugins/qt4projectmanager/qtversionmanager.cpp
src/plugins/qt4projectmanager/qtversionmanager.cpp
+27
-20
src/plugins/qt4projectmanager/qtversionmanager.h
src/plugins/qt4projectmanager/qtversionmanager.h
+2
-0
No files found.
src/libs/cplusplus/CppDocument.cpp
View file @
14ddfc45
...
...
@@ -138,19 +138,9 @@ void Document::addIncludeFile(const QString &fileName)
_includedFiles
.
append
(
fileName
);
}
QByteArray
Document
::
definedMacros
()
const
void
Document
::
appendMacro
(
const
Macro
&
macro
)
{
return
_definedMacros
;
}
void
Document
::
appendMacro
(
const
QByteArray
&
macroName
,
const
QByteArray
&
text
)
{
int
index
=
macroName
.
indexOf
(
'('
);
if
(
index
==
-
1
)
_macroNames
.
insert
(
macroName
);
else
_macroNames
.
insert
(
macroName
.
left
(
index
));
_definedMacros
+=
text
;
_definedMacros
.
append
(
macro
);
}
void
Document
::
addMacroUse
(
unsigned
offset
,
unsigned
length
)
...
...
@@ -251,11 +241,6 @@ void Document::stopSkippingBlocks(unsigned stop)
_skippedBlocks
.
back
()
=
Block
(
start
,
stop
);
}
QSet
<
QByteArray
>
Document
::
macroNames
()
const
{
return
_macroNames
;
}
bool
Document
::
parse
(
ParseMode
mode
)
{
TranslationUnit
::
ParseMode
m
=
TranslationUnit
::
ParseTranlationUnit
;
...
...
src/libs/cplusplus/CppDocument.h
View file @
14ddfc45
...
...
@@ -36,6 +36,8 @@
#include <CPlusPlusForwardDeclarations.h>
#include "pp-macro.h"
#include <QByteArray>
#include <QList>
#include <QSet>
...
...
@@ -45,6 +47,8 @@
namespace
CPlusPlus
{
class
Macro
;
class
CPLUSPLUS_EXPORT
Document
{
Document
(
const
Document
&
other
);
...
...
@@ -63,10 +67,7 @@ public:
QStringList
includedFiles
()
const
;
void
addIncludeFile
(
const
QString
&
fileName
);
QByteArray
definedMacros
()
const
;
QSet
<
QByteArray
>
macroNames
()
const
;
void
appendMacro
(
const
QByteArray
&
macroName
,
const
QByteArray
&
text
);
void
appendMacro
(
const
Macro
&
macro
);
void
addMacroUse
(
unsigned
offset
,
unsigned
length
);
...
...
@@ -81,6 +82,9 @@ public:
Scope
*
globalSymbols
()
const
;
// ### deprecate?
Namespace
*
globalNamespace
()
const
;
QList
<
Macro
>
definedMacros
()
const
{
return
_definedMacros
;
}
Symbol
*
findSymbolAt
(
unsigned
line
,
unsigned
column
)
const
;
void
setSource
(
const
QByteArray
&
source
);
...
...
@@ -191,8 +195,7 @@ private:
TranslationUnit
*
_translationUnit
;
Namespace
*
_globalNamespace
;
QList
<
DiagnosticMessage
>
_diagnosticMessages
;
QByteArray
_definedMacros
;
QSet
<
QByteArray
>
_macroNames
;
QList
<
Macro
>
_definedMacros
;
QList
<
Block
>
_skippedBlocks
;
QList
<
Block
>
_macroUses
;
};
...
...
src/libs/cplusplus/TypeOfExpression.cpp
View file @
14ddfc45
...
...
@@ -48,6 +48,7 @@ TypeOfExpression::TypeOfExpression():
void
TypeOfExpression
::
setDocuments
(
const
QMap
<
QString
,
Document
::
Ptr
>
&
documents
)
{
m_documents
=
documents
;
m_lookupContext
=
LookupContext
();
}
QList
<
TypeOfExpression
::
Result
>
TypeOfExpression
::
operator
()(
const
QString
&
expression
,
...
...
src/libs/cplusplus/TypeOfExpression.h
View file @
14ddfc45
...
...
@@ -54,6 +54,9 @@ public:
/**
* Sets the documents used to evaluate expressions. Should be set before
* calling this functor.
*
* Also clears the lookup context, so can be used to make sure references
* to the documents previously used are removed.
*/
void
setDocuments
(
const
QMap
<
QString
,
Document
::
Ptr
>
&
documents
);
...
...
src/libs/cplusplus/cplusplus.pro
View file @
14ddfc45
...
...
@@ -21,7 +21,16 @@ HEADERS += \
TypeOfExpression
.
h
\
TypePrettyPrinter
.
h
\
ResolveExpression
.
h
\
LookupContext
.
h
LookupContext
.
h
\
pp
-
cctype
.
h
\
pp
-
engine
.
h
\
pp
-
fwd
.
h
\
pp
-
macro
-
expander
.
h
\
pp
-
scanner
.
h
\
pp
-
client
.
h
\
pp
-
environment
.
h
\
pp
-
internal
.
h
\
pp
-
macro
.
h
SOURCES
+=
\
SimpleLexer
.
cpp
\
...
...
@@ -35,6 +44,9 @@ SOURCES += \
TypeOfExpression
.
cpp
\
TypePrettyPrinter
.
cpp
\
ResolveExpression
.
cpp
\
LookupContext
.
cpp
LookupContext
.
cpp
\
pp
-
engine
.
cpp
\
pp
-
environment
.
cpp
\
pp
-
macro
-
expander
.
cpp
RESOURCES
+=
cplusplus
.
qrc
src/
plugins/cpptools/rpp
/pp-cctype.h
→
src/
libs/cplusplus
/pp-cctype.h
View file @
14ddfc45
...
...
@@ -53,22 +53,24 @@
#ifndef PP_CCTYPE_H
#define PP_CCTYPE_H
#include <CPlusPlusForwardDeclarations.h>
#include <cctype>
namespace
rpp
{
namespace
CPlusPlus
{
inline
bool
pp_isalpha
(
int
__ch
)
inline
bool
CPLUSPLUS_EXPORT
pp_isalpha
(
int
__ch
)
{
return
std
::
isalpha
((
unsigned
char
)
__ch
)
!=
0
;
}
inline
bool
pp_isalnum
(
int
__ch
)
inline
bool
CPLUSPLUS_EXPORT
pp_isalnum
(
int
__ch
)
{
return
std
::
isalnum
((
unsigned
char
)
__ch
)
!=
0
;
}
inline
bool
pp_isdigit
(
int
__ch
)
inline
bool
CPLUSPLUS_EXPORT
pp_isdigit
(
int
__ch
)
{
return
std
::
isdigit
((
unsigned
char
)
__ch
)
!=
0
;
}
inline
bool
pp_isspace
(
int
__ch
)
inline
bool
CPLUSPLUS_EXPORT
pp_isspace
(
int
__ch
)
{
return
std
::
isspace
((
unsigned
char
)
__ch
)
!=
0
;
}
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_CCTYPE_H
src/
plugins/cpptools/rpp
/pp-client.h
→
src/
libs/cplusplus
/pp-client.h
View file @
14ddfc45
...
...
@@ -34,15 +34,17 @@
#ifndef PP_CLIENT_H
#define PP_CLIENT_H
#include <CPlusPlusForwardDeclarations.h>
#include <QByteArray>
#include <QString>
#include <QFile>
namespace
rpp
{
namespace
CPlusPlus
{
class
Macro
;
class
Client
class
C
PLUSPLUS_EXPORT
C
lient
{
Client
(
const
Client
&
other
);
void
operator
=
(
const
Client
&
other
);
...
...
@@ -60,7 +62,7 @@ public:
virtual
~
Client
()
{
}
virtual
void
macroAdded
(
const
QByteArray
&
macroId
,
const
QByteArray
&
text
)
=
0
;
virtual
void
macroAdded
(
const
Macro
&
macro
)
=
0
;
virtual
void
sourceNeeded
(
QString
&
fileName
,
IncludeType
mode
)
=
0
;
// ### FIX the signature.
virtual
void
startExpandingMacro
(
unsigned
offset
,
...
...
@@ -74,6 +76,6 @@ public:
virtual
void
stopSkippingBlocks
(
unsigned
offset
)
=
0
;
};
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_CLIENT_H
src/
plugins/cpptools/rpp
/pp-engine.cpp
→
src/
libs/cplusplus
/pp-engine.cpp
View file @
14ddfc45
...
...
@@ -57,7 +57,6 @@
#include <QtDebug>
#include <algorithm>
using
namespace
rpp
;
using
namespace
CPlusPlus
;
namespace
{
...
...
@@ -907,16 +906,8 @@ void pp::processDefine(TokenIterator firstToken, TokenIterator lastToken)
env
.
bind
(
macro
);
QByteArray
macroText
;
macroText
.
reserve
(
64
);
macroText
+=
"#define "
;
macroText
+=
macroId
;
macroText
+=
' '
;
macroText
+=
macro
.
definition
;
macroText
+=
'\n'
;
client
->
macroAdded
(
macroId
,
macroText
);
if
(
client
)
client
->
macroAdded
(
macro
);
}
void
pp
::
processIf
(
TokenIterator
firstToken
,
TokenIterator
lastToken
)
...
...
@@ -1020,13 +1011,10 @@ void pp::processUndef(TokenIterator firstToken, TokenIterator lastToken)
if
(
tk
->
is
(
T_IDENTIFIER
))
{
const
QByteArray
macroName
=
tokenText
(
*
tk
);
env
.
remove
(
macroName
);
const
Macro
*
macro
=
env
.
remove
(
macroName
);
QByteArray
macroText
;
macroText
+=
"#undef "
;
macroText
+=
macroName
;
macroText
+=
'\n'
;
client
->
macroAdded
(
macroName
,
macroText
);
if
(
client
&&
macro
)
client
->
macroAdded
(
*
macro
);
}
}
...
...
src/
plugins/cpptools/rpp
/pp-engine.h
→
src/
libs/cplusplus
/pp-engine.h
View file @
14ddfc45
...
...
@@ -62,7 +62,7 @@ namespace CPlusPlus {
class
Token
;
}
namespace
rpp
{
namespace
CPlusPlus
{
struct
Value
{
...
...
@@ -134,7 +134,7 @@ namespace rpp {
#undef PP_DEFINE_BIN_OP
};
class
pp
class
CPLUSPLUS_EXPORT
pp
{
Client
*
client
;
Environment
&
env
;
...
...
@@ -200,7 +200,7 @@ namespace rpp {
Value
evalExpression
(
TokenIterator
firstToken
,
TokenIterator
lastToken
,
const
QByteArray
&
source
)
const
;
const
QByteArray
&
source
)
const
;
QVector
<
CPlusPlus
::
Token
>
tokenize
(
const
QByteArray
&
text
)
const
;
...
...
@@ -226,6 +226,6 @@ namespace rpp {
bool
isQtReservedWord
(
const
QByteArray
&
name
)
const
;
};
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_ENGINE_H
src/
plugins/cpptools/rpp
/pp-environment.cpp
→
src/
libs/cplusplus
/pp-environment.cpp
View file @
14ddfc45
...
...
@@ -54,7 +54,7 @@
#include "pp.h"
#include <cstring>
using
namespace
rpp
;
using
namespace
CPlusPlus
;
Environment
::
Environment
()
:
currentLine
(
0
),
...
...
@@ -115,12 +115,12 @@ Macro *Environment::bind(const Macro &__macro)
return
m
;
}
void
Environment
::
remove
(
const
QByteArray
&
name
)
Macro
*
Environment
::
remove
(
const
QByteArray
&
name
)
{
Macro
macro
;
macro
.
name
=
name
;
macro
.
hidden
=
true
;
bind
(
macro
);
return
bind
(
macro
);
}
bool
Environment
::
isBuiltinMacro
(
const
QByteArray
&
s
)
const
...
...
src/
plugins/cpptools/rpp
/pp-environment.h
→
src/
libs/cplusplus
/pp-environment.h
View file @
14ddfc45
...
...
@@ -53,14 +53,16 @@
#ifndef PP_ENVIRONMENT_H
#define PP_ENVIRONMENT_H
#include "CPlusPlusForwardDeclarations.h"
#include <QVector>
#include <QByteArray>
namespace
rpp
{
namespace
CPlusPlus
{
struct
Macro
;
class
Macro
;
class
Environment
class
CPLUSPLUS_EXPORT
Environment
{
public:
Environment
();
...
...
@@ -70,7 +72,7 @@ public:
Macro
*
macroAt
(
unsigned
index
)
const
;
Macro
*
bind
(
const
Macro
&
macro
);
void
remove
(
const
QByteArray
&
name
);
Macro
*
remove
(
const
QByteArray
&
name
);
Macro
*
resolve
(
const
QByteArray
&
name
)
const
;
bool
isBuiltinMacro
(
const
QByteArray
&
name
)
const
;
...
...
@@ -104,6 +106,6 @@ private:
int
_hash_count
;
};
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_ENVIRONMENT_H
src/
plugins/cpptools/rpp
/pp-fwd.h
→
src/
libs/cplusplus
/pp-fwd.h
View file @
14ddfc45
File moved
src/
plugins/cpptools/rpp
/pp-internal.h
→
src/
libs/cplusplus
/pp-internal.h
View file @
14ddfc45
...
...
@@ -55,7 +55,7 @@
#include <QByteArray>
namespace
rpp
{
namespace
CPlusPlus
{
namespace
_PP_internal
{
inline
bool
comment_p
(
const
char
*
__first
,
const
char
*
__last
)
...
...
@@ -73,6 +73,6 @@ inline bool comment_p (const char *__first, const char *__last)
}
}
// _PP_internal
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_INTERNAL_H
src/
plugins/cpptools/rpp
/pp-macro-expander.cpp
→
src/
libs/cplusplus
/pp-macro-expander.cpp
View file @
14ddfc45
...
...
@@ -35,7 +35,7 @@
#include "pp-macro-expander.h"
#include <QDateTime>
using
namespace
rpp
;
using
namespace
CPlusPlus
;
MacroExpander
::
MacroExpander
(
Environment
&
env
,
pp_frame
*
frame
)
:
env
(
env
),
frame
(
frame
),
...
...
src/
plugins/cpptools/rpp
/pp-macro-expander.h
→
src/
libs/cplusplus
/pp-macro-expander.h
View file @
14ddfc45
...
...
@@ -53,7 +53,7 @@
#ifndef PP_MACRO_EXPANDER_H
#define PP_MACRO_EXPANDER_H
namespace
rpp
{
namespace
CPlusPlus
{
struct
pp_frame
{
...
...
@@ -97,7 +97,7 @@ namespace rpp {
int
generated_lines
;
};
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_MACRO_EXPANDER_H
src/
plugins/cpptools/rpp
/pp-macro.h
→
src/
libs/cplusplus
/pp-macro.h
View file @
14ddfc45
...
...
@@ -53,43 +53,44 @@
#ifndef PP_MACRO_H
#define PP_MACRO_H
#include <CPlusPlusForwardDeclarations.h>
#include <QByteArray>
#include <QVector>
namespace
rpp
{
namespace
CPlusPlus
{
class
CPLUSPLUS_EXPORT
Macro
{
public:
QByteArray
name
;
QByteArray
definition
;
QVector
<
QByteArray
>
formals
;
QByteArray
fileName
;
int
line
;
Macro
*
next
;
unsigned
hashcode
;
struct
Macro
union
{
QByteArray
name
;
QByteArray
definition
;
QVector
<
QByteArray
>
formals
;
QByteArray
fileName
;
int
line
;
int
lines
;
Macro
*
next
;
unsigned
hashcode
;
unsigned
state
;
union
struct
{
unsigned
state
;
struct
{
unsigned
hidden
:
1
;
unsigned
function_like
:
1
;
unsigned
variadics
:
1
;
};
unsigned
hidden
:
1
;
unsigned
function_like
:
1
;
unsigned
variadics
:
1
;
};
};
inline
Macro
()
:
inline
Macro
()
:
line
(
0
),
lines
(
0
),
next
(
0
),
hashcode
(
0
),
state
(
0
)
{
}
};
{
}
};
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_MACRO_H
src/
plugins/cpptools/rpp
/pp-scanner.h
→
src/
libs/cplusplus
/pp-scanner.h
View file @
14ddfc45
...
...
@@ -53,7 +53,7 @@
#ifndef PP_SCANNER_H
#define PP_SCANNER_H
namespace
rpp
{
namespace
CPlusPlus
{
struct
pp_skip_blanks
{
...
...
@@ -373,7 +373,7 @@ struct pp_skip_argument
}
};
}
// namespace
rpp
}
// namespace
CPlusPlus
#endif // PP_SCANNER_H
...
...
src/
plugins/cpptools/rpp
/pp.h
→
src/
libs/cplusplus
/pp.h
View file @
14ddfc45
File moved
src/plugins/cmakeprojectmanager/cmakeproject.cpp
View file @
14ddfc45
...
...
@@ -34,6 +34,8 @@
#include "cmakeproject.h"
#include "cmakeprojectconstants.h"
#include "cmakeprojectnodes.h"
#include "cmakestep.h"
#include "makestep.h"
#include <extensionsystem/pluginmanager.h>
#include <cpptools/cppmodelmanagerinterface.h>
...
...
@@ -188,7 +190,7 @@ QString CMakeProject::buildDirectory(const QString &buildConfiguration) const
{
Q_UNUSED
(
buildConfiguration
)
//TODO
return
""
;
return
QFileInfo
(
m_fileName
).
absolutePath
()
;
}
ProjectExplorer
::
BuildStepConfigWidget
*
CMakeProject
::
createConfigWidget
()
...
...
@@ -225,13 +227,29 @@ QStringList CMakeProject::files(FilesMode fileMode) const
void
CMakeProject
::
saveSettingsImpl
(
ProjectExplorer
::
PersistentSettingsWriter
&
writer
)
{
// TODO
Q_UNUSED
(
writer
)
Q_UNUSED
(
writer
)
;
}
void
CMakeProject
::
restoreSettingsImpl
(
ProjectExplorer
::
PersistentSettingsReader
&
reader
)
{
// TODO
Q_UNUSED
(
reader
)
Q_UNUSED
(
reader
);
if
(
buildConfigurations
().
isEmpty
())
{
// No build configuration, adding those
// TODO do we want to create one build configuration per target?
// or how do we want to handle that?
CMakeStep
*
cmakeStep
=
new
CMakeStep
(
this
);
MakeStep
*
makeStep
=
new
MakeStep
(
this
);
insertBuildStep
(
0
,
cmakeStep
);
insertBuildStep
(
1
,
makeStep
);
addBuildConfiguration
(
"all"
);
setActiveBuildConfiguration
(
"all"
);
}
// Restoring is fine
}
...
...
@@ -376,12 +394,36 @@ void CMakeCbpParser::parseBuild()
void
CMakeCbpParser
::
parseTarget
()
{
m_targetOutput
.
clear
();
m_targetType
=
false
;
while
(
!
atEnd
())
{
readNext
();
if
(
isEndElement
())
{
if
(
m_targetType
&&
!
m_targetOutput
.
isEmpty
())
{
qDebug
()
<<
"found target "
<<
m_targetOutput
;
m_targets
.
insert
(
m_targetOutput
);
}
return
;
}
else
if
(
name
()
==
"Compiler"
)
{
parseCompiler
();
}
else
if
(
name
()
==
"Option"
)
{
parseTargetOption
();
}
else
if
(
isStartElement
())
{
parseUnknownElement
();
}
}
}
void
CMakeCbpParser
::
parseTargetOption
()
{
if
(
attributes
().
hasAttribute
(
"output"
))
m_targetOutput
=
attributes
().
value
(
"output"
).
toString
();
else
if
(
attributes
().
hasAttribute
(
"type"
)
&&
attributes
().
value
(
"type"
)
==
"1"
)
m_targetType
=
true
;
while
(
!
atEnd
())
{
readNext
();
if
(
isEndElement
())
{
return
;
}
else
if
(
isStartElement
())
{
parseUnknownElement
();
}
...
...
src/plugins/cmakeprojectmanager/cmakeproject.h
View file @
14ddfc45
...
...
@@ -123,13 +123,18 @@ private:
void
parseProject
();
void
parseBuild
();
void
parseTarget
();
void
parseTargetOption
();
void
parseCompiler
();
void
parseAdd
();
void
parseUnit
();
void
parseUnknownElement
();
QSet
<
QString
>
m_targets
;
QList
<
ProjectExplorer
::
FileNode
*>
m_fileList
;
QStringList
m_includeFiles
;
QString
m_targetOutput
;
bool
m_targetType
;
};
class
CMakeFile
:
public
Core
::
IFile
...
...
src/plugins/cmakeprojectmanager/cmakestep.cpp
View file @
14ddfc45
...
...
@@ -54,7 +54,7 @@ bool CMakeStep::init(const QString &buildConfiguration)
setEnabled
(
buildConfiguration
,
true
);
setWorkingDirectory
(
buildConfiguration
,
m_pro
->
buildDirectory
(
buildConfiguration
));
setCommand
(
buildConfiguration
,
"cmake"
);
// TODO give full path here?
setArguments
(
buildConfiguration
,
QStringList
());
// TODO
setArguments
(
buildConfiguration
,
QStringList
()
<<
"-GUnix Makefiles"
);
// TODO
setEnvironment
(
buildConfiguration
,
m_pro
->
environment
(
buildConfiguration
));
return
AbstractProcessStep
::
init
(
buildConfiguration
);
}
...
...
src/plugins/cpptools/cppcodecompletion.cpp
View file @
14ddfc45
...
...
@@ -699,7 +699,9 @@ void CppCodeCompletion::addMacros(const LookupContext &context)
continue
;
processed
.
insert
(
fn
);
if
(
Document
::
Ptr
doc
=
context
.
document
(
fn
))
{
macroNames
+=
doc
->
macroNames
();
foreach
(
const
Macro
macro
,
doc
->
definedMacros
())
{
macroNames
.
insert
(
macro
.
name
);
}
todo
+=
doc
->
includedFiles
();
}
}
...
...
@@ -1025,6 +1027,10 @@ bool CppCodeCompletion::partiallyComplete(const QList<TextEditor::CompletionItem
void
CppCodeCompletion
::
cleanup
()
{
m_completions
.
clear
();
// Set empty map in order to avoid referencing old versions of the documents
// until the next completion
typeOfExpression
.
setDocuments
(
QMap
<
QString
,
Document
::
Ptr
>
());
}
int
CppCodeCompletion
::
findStartOfName
(
const
TextEditor
::
ITextEditor
*
editor
)
...
...
src/plugins/cpptools/cppmodelmanager.cpp
View file @
14ddfc45
...
...
@@ -31,7 +31,7 @@
**
***************************************************************************/
#include
"pp.h"
#include
<cplusplus/pp.h>
#include "cppmodelmanager.h"
#include "cpphoverhandler.h"
...
...
@@ -107,7 +107,7 @@ static const char pp_configuration[] =
namespace
CppTools
{
namespace
Internal
{
class
CppPreprocessor
:
public
rpp
::
Client
class
CppPreprocessor
:
public
CPlusPlus
::
Client
{
public:
CppPreprocessor
(
QPointer
<
CppModelManager
>
modelManager
);
...
...
@@ -129,12 +129,11 @@ protected:
void
mergeEnvironment
(
CPlusPlus
::
Document
::
Ptr
doc
);
void
mergeEnvironment
(
CPlusPlus
::
Document
::
Ptr
doc
,
QSet
<
QString
>
*
processed
);
virtual
void
macroAdded
(
const
QByteArray
&
macroName
,
const
QByteArray
&
macroText
);
virtual
void
macroAdded
(
const
Macro
&
macro
);
virtual
void
startExpandingMacro
(
unsigned
offset
,
const
rpp
::
Macro
&
macro
,
const
Macro
&
macro
,
const
QByteArray
&
originalText
);