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
93698188
Commit
93698188
authored
Feb 09, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invalidate the documents in the snapshot that need to be reparsed.
parent
ea981d50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
src/plugins/cpptools/cppmodelmanager.cpp
src/plugins/cpptools/cppmodelmanager.cpp
+22
-10
No files found.
src/plugins/cpptools/cppmodelmanager.cpp
View file @
93698188
...
...
@@ -120,6 +120,9 @@ public:
void
run
(
QString
&
fileName
);
void
operator
()(
QString
&
fileName
);
public:
// attributes
Snapshot
snapshot
;
protected:
CPlusPlus
::
Document
::
Ptr
switchDocument
(
CPlusPlus
::
Document
::
Ptr
doc
);
...
...
@@ -141,7 +144,6 @@ protected:
private:
QPointer
<
CppModelManager
>
m_modelManager
;
Snapshot
m_snapshot
;
Environment
env
;
Preprocessor
m_proc
;
QStringList
m_includePaths
;
...
...
@@ -157,9 +159,9 @@ private:
}
// namespace CppTools
CppPreprocessor
::
CppPreprocessor
(
QPointer
<
CppModelManager
>
modelManager
)
:
m_modelManager
(
modelManager
),
m_snapshot
(
modelManager
->
snapshot
()
),
m_proc
(
this
,
env
)
:
snapshot
(
modelManager
->
snapshot
()
),
m_modelManager
(
modelManager
),
m_proc
(
this
,
env
)
{
}
void
CppPreprocessor
::
setWorkingCopy
(
const
QMap
<
QString
,
QByteArray
>
&
workingCopy
)
...
...
@@ -337,8 +339,13 @@ void CppPreprocessor::mergeEnvironment(Document::Ptr doc, QSet<QString> *process
processed
->
insert
(
fn
);
foreach
(
QString
includedFile
,
doc
->
includedFiles
())
{
mergeEnvironment
(
m_snapshot
.
value
(
includedFile
),
processed
);
foreach
(
Document
::
Include
incl
,
doc
->
includes
())
{
QString
includedFile
=
incl
.
fileName
();
if
(
Document
::
Ptr
includedDoc
=
snapshot
.
value
(
includedFile
))
mergeEnvironment
(
includedDoc
,
processed
);
else
run
(
includedFile
);
}
foreach
(
const
Macro
macro
,
doc
->
definedMacros
())
{
...
...
@@ -384,7 +391,7 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type,
}
if
(
!
contents
.
isEmpty
())
{
Document
::
Ptr
cachedDoc
=
m_
snapshot
.
value
(
fileName
);
Document
::
Ptr
cachedDoc
=
snapshot
.
value
(
fileName
);
if
(
cachedDoc
&&
m_currentDoc
)
{
mergeEnvironment
(
cachedDoc
);
}
else
{
...
...
@@ -393,8 +400,8 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type,
const
QByteArray
previousFile
=
env
.
currentFile
;
const
unsigned
previousLine
=
env
.
currentLine
;
env
.
currentFile
=
QByteArray
(
m_currentDoc
->
translationUnit
()
->
fileName
(),
m_currentDoc
->
translationUnit
()
->
fileNameLength
());
TranslationUnit
*
unit
=
m_currentDoc
->
translationUnit
();
env
.
currentFile
=
QByteArray
(
unit
->
fileName
(),
unit
->
fileNameLength
());
QByteArray
preprocessedCode
;
m_proc
(
contents
,
&
preprocessedCode
);
...
...
@@ -775,7 +782,12 @@ void CppModelManager::parse(QFutureInterface<void> &future,
CppPreprocessor
*
preproc
,
QStringList
files
)
{
QTC_ASSERT
(
!
files
.
isEmpty
(),
return
);
if
(
files
.
isEmpty
())
return
;
foreach
(
QString
file
,
files
)
{
preproc
->
snapshot
.
remove
(
file
);
}
// Change the priority of the background parser thread to idle.
QThread
::
currentThread
()
->
setPriority
(
QThread
::
IdlePriority
);
...
...
Write
Preview
Markdown
is supported
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