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
752c823d
Commit
752c823d
authored
Jun 18, 2010
by
Oswald Buddenhagen
Browse files
better pro eval notifications
more types, and callback even for top-level project file
parent
a82ef5f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/profilereader.cpp
View file @
752c823d
...
...
@@ -35,7 +35,9 @@
using
namespace
Qt4ProjectManager
;
using
namespace
Qt4ProjectManager
::
Internal
;
ProFileReader
::
ProFileReader
(
ProFileOption
*
option
)
:
ProFileEvaluator
(
option
)
ProFileReader
::
ProFileReader
(
ProFileOption
*
option
)
:
ProFileEvaluator
(
option
)
,
m_ignoreLevel
(
0
)
{
}
...
...
@@ -48,8 +50,6 @@ ProFileReader::~ProFileReader()
bool
ProFileReader
::
readProFile
(
const
QString
&
fileName
)
{
if
(
ProFile
*
pro
=
parsedProFile
(
fileName
))
{
m_ignoreLevel
=
0
;
aboutToEval
(
0
,
pro
,
EvalIncludeFile
);
bool
ok
=
accept
(
pro
);
pro
->
deref
();
return
ok
;
...
...
@@ -59,7 +59,7 @@ bool ProFileReader::readProFile(const QString &fileName)
void
ProFileReader
::
aboutToEval
(
ProFile
*
,
ProFile
*
pro
,
EvalFileType
type
)
{
if
(
m_ignoreLevel
||
type
=
=
Eval
Featur
eFile
)
{
if
(
m_ignoreLevel
||
(
type
!
=
Eval
ProjectFile
&&
type
!=
EvalInclud
eFile
)
)
{
m_ignoreLevel
++
;
}
else
if
(
!
m_includeFiles
.
contains
(
pro
->
fileName
()))
{
m_includeFiles
.
insert
(
pro
->
fileName
(),
pro
);
...
...
src/shared/proparser/profileevaluator.cpp
View file @
752c823d
...
...
@@ -254,7 +254,7 @@ public:
static
ALWAYS_INLINE
void
skipHashStr
(
const
ushort
*&
tokPtr
);
void
skipExpression
(
const
ushort
*&
tokPtr
);
VisitReturn
visitProFile
(
ProFile
*
pro
);
VisitReturn
visitProFile
(
ProFile
*
pro
,
ProFileEvaluator
::
EvalFileType
type
);
VisitReturn
visitProBlock
(
const
ushort
*
tokPtr
);
VisitReturn
visitProLoop
(
const
ProString
&
variable
,
const
ushort
*
exprPtr
,
const
ushort
*
tokPtr
);
...
...
@@ -2026,8 +2026,10 @@ void ProFileEvaluator::Private::visitProVariable(
}
}
ProFileEvaluator
::
Private
::
VisitReturn
ProFileEvaluator
::
Private
::
visitProFile
(
ProFile
*
pro
)
ProFileEvaluator
::
Private
::
VisitReturn
ProFileEvaluator
::
Private
::
visitProFile
(
ProFile
*
pro
,
ProFileEvaluator
::
EvalFileType
type
)
{
q
->
aboutToEval
(
currentProFile
(),
pro
,
type
);
m_lineNo
=
0
;
m_profileStack
.
push
(
pro
);
if
(
m_profileStack
.
count
()
==
1
)
{
...
...
@@ -2072,7 +2074,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(P
if
(
!
qmake_cache
.
isEmpty
())
{
qmake_cache
=
resolvePath
(
qmake_cache
);
QHash
<
ProString
,
ProStringList
>
cache_valuemap
;
if
(
evaluateFileInto
(
qmake_cache
,
ProFileEvaluator
::
Eval
Feature
File
,
if
(
evaluateFileInto
(
qmake_cache
,
ProFileEvaluator
::
Eval
Config
File
,
&
cache_valuemap
,
0
))
{
if
(
m_option
->
qmakespec
.
isEmpty
())
{
const
ProStringList
&
vals
=
cache_valuemap
.
value
(
ProString
(
"QMAKESPEC"
));
...
...
@@ -2129,11 +2131,11 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(P
m_option
->
qmakespec
=
QDir
::
cleanPath
(
qmakespec
);
QString
spec
=
m_option
->
qmakespec
+
QLatin1String
(
"/qmake.conf"
);
if
(
!
evaluateFileInto
(
spec
,
ProFileEvaluator
::
Eval
Feature
File
,
if
(
!
evaluateFileInto
(
spec
,
ProFileEvaluator
::
Eval
Config
File
,
&
m_option
->
base_valuemap
,
&
m_option
->
base_functions
))
{
errorMessage
(
format
(
"Could not read qmake configuration file %1"
).
arg
(
spec
));
}
else
if
(
!
m_option
->
cachefile
.
isEmpty
())
{
evaluateFileInto
(
m_option
->
cachefile
,
ProFileEvaluator
::
Eval
Feature
File
,
evaluateFileInto
(
m_option
->
cachefile
,
ProFileEvaluator
::
Eval
Config
File
,
&
m_option
->
base_valuemap
,
&
m_option
->
base_functions
);
}
m_option
->
qmakespec_name
=
IoUtils
::
fileName
(
m_option
->
qmakespec
).
toString
();
...
...
@@ -2214,6 +2216,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::visitProFile(P
}
}
m_profileStack
.
pop
();
q
->
doneWithEval
(
currentProFile
());
return
ReturnTrue
;
}
...
...
@@ -3015,7 +3018,7 @@ ProStringList ProFileEvaluator::Private::evaluateExpandFunction(
QHash
<
ProString
,
ProStringList
>
vars
;
QString
fn
=
resolvePath
(
expandEnvVars
(
args
.
at
(
0
).
toQString
(
m_tmp1
)));
fn
.
detach
();
if
(
evaluateFileInto
(
fn
,
ProFileEvaluator
::
Eval
Include
File
,
&
vars
,
0
))
if
(
evaluateFileInto
(
fn
,
ProFileEvaluator
::
Eval
Aux
File
,
&
vars
,
0
))
ret
=
vars
.
value
(
map
(
args
.
at
(
1
)));
}
break
;
...
...
@@ -3295,7 +3298,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateCondit
QHash
<
ProString
,
ProStringList
>
vars
;
QString
fn
=
resolvePath
(
expandEnvVars
(
args
.
at
(
0
).
toQString
(
m_tmp1
)));
fn
.
detach
();
if
(
!
evaluateFileInto
(
fn
,
ProFileEvaluator
::
Eval
Include
File
,
&
vars
,
0
))
if
(
!
evaluateFileInto
(
fn
,
ProFileEvaluator
::
Eval
Aux
File
,
&
vars
,
0
))
return
ReturnFalse
;
if
(
args
.
count
()
==
2
)
return
returnBool
(
vars
.
contains
(
args
.
at
(
1
)));
...
...
@@ -3925,9 +3928,7 @@ bool ProFileEvaluator::Private::evaluateFileDirect(
{
int
lineNo
=
m_lineNo
;
if
(
ProFile
*
pro
=
parsedProFile
(
fileName
,
true
))
{
q
->
aboutToEval
(
currentProFile
(),
pro
,
type
);
bool
ok
=
(
visitProFile
(
pro
)
==
ReturnTrue
);
q
->
doneWithEval
(
currentProFile
());
bool
ok
=
(
visitProFile
(
pro
,
type
)
==
ReturnTrue
);
pro
->
deref
();
m_lineNo
=
lineNo
;
return
ok
;
...
...
@@ -4184,7 +4185,7 @@ ProFile *ProFileEvaluator::parsedProFile(const QString &fileName, const QString
bool
ProFileEvaluator
::
accept
(
ProFile
*
pro
)
{
return
d
->
visitProFile
(
pro
);
return
d
->
visitProFile
(
pro
,
ProFileEvaluator
::
EvalProjectFile
);
}
QString
ProFileEvaluator
::
propertyValue
(
const
QString
&
name
)
const
...
...
src/shared/proparser/profileevaluator.h
View file @
752c823d
...
...
@@ -100,7 +100,7 @@ public:
QString
propertyValue
(
const
QString
&
val
)
const
;
// for our descendents
enum
EvalFileType
{
Eval
Feature
File
,
EvalIncludeFile
};
enum
EvalFileType
{
Eval
Project
File
,
EvalIncludeFile
,
EvalConfigFile
,
EvalFeatureFile
,
EvalAuxFile
};
virtual
void
aboutToEval
(
ProFile
*
parent
,
ProFile
*
proFile
,
EvalFileType
type
);
virtual
void
doneWithEval
(
ProFile
*
parent
);
virtual
void
logMessage
(
const
QString
&
msg
);
...
...
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