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
37a146d0
Commit
37a146d0
authored
Jul 14, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced revisions in CPlusPlus::Document.
Reviewed by Thorbjørn Lindeijer
parent
2e49aaf4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
3 deletions
+40
-3
src/libs/cplusplus/CppDocument.cpp
src/libs/cplusplus/CppDocument.cpp
+12
-1
src/libs/cplusplus/CppDocument.h
src/libs/cplusplus/CppDocument.h
+4
-0
src/plugins/cpptools/cppmodelmanager.cpp
src/plugins/cpptools/cppmodelmanager.cpp
+23
-2
src/plugins/cpptools/cppmodelmanager.h
src/plugins/cpptools/cppmodelmanager.h
+1
-0
No files found.
src/libs/cplusplus/CppDocument.cpp
View file @
37a146d0
...
...
@@ -103,7 +103,8 @@ private:
Document
::
Document
(
const
QString
&
fileName
)
:
_fileName
(
fileName
),
_globalNamespace
(
0
)
_globalNamespace
(
0
),
_revision
(
0
)
{
_control
=
new
Control
();
...
...
@@ -130,6 +131,16 @@ Control *Document::control() const
return
_control
;
}
unsigned
Document
::
revision
()
const
{
return
_revision
;
}
void
Document
::
setRevision
(
unsigned
revision
)
{
_revision
=
revision
;
}
QString
Document
::
fileName
()
const
{
return
_fileName
;
...
...
src/libs/cplusplus/CppDocument.h
View file @
37a146d0
...
...
@@ -60,6 +60,9 @@ public:
public:
~
Document
();
unsigned
revision
()
const
;
void
setRevision
(
unsigned
revision
);
QString
fileName
()
const
;
QStringList
includedFiles
()
const
;
...
...
@@ -265,6 +268,7 @@ private:
QList
<
Block
>
_skippedBlocks
;
QList
<
MacroUse
>
_macroUses
;
QByteArray
_source
;
unsigned
_revision
;
friend
class
Snapshot
;
};
...
...
src/plugins/cpptools/cppmodelmanager.cpp
View file @
37a146d0
...
...
@@ -174,6 +174,7 @@ public:
CppPreprocessor
(
QPointer
<
CppModelManager
>
modelManager
);
virtual
~
CppPreprocessor
();
void
setRevision
(
unsigned
revision
);
void
setWorkingCopy
(
const
QMap
<
QString
,
QString
>
&
workingCopy
);
void
setIncludePaths
(
const
QStringList
&
includePaths
);
void
setFrameworkPaths
(
const
QStringList
&
frameworkPaths
);
...
...
@@ -222,6 +223,7 @@ private:
Document
::
Ptr
m_currentDoc
;
QSet
<
QString
>
m_todo
;
QSet
<
QString
>
m_processed
;
unsigned
m_revision
;
};
}
// namespace Internal
...
...
@@ -230,12 +232,16 @@ private:
CppPreprocessor
::
CppPreprocessor
(
QPointer
<
CppModelManager
>
modelManager
)
:
snapshot
(
modelManager
->
snapshot
()),
m_modelManager
(
modelManager
),
preprocess
(
this
,
&
env
)
preprocess
(
this
,
&
env
),
m_revision
(
0
)
{
}
CppPreprocessor
::~
CppPreprocessor
()
{
}
void
CppPreprocessor
::
setRevision
(
unsigned
revision
)
{
m_revision
=
revision
;
}
void
CppPreprocessor
::
setWorkingCopy
(
const
QMap
<
QString
,
QString
>
&
workingCopy
)
{
m_workingCopy
=
workingCopy
;
}
...
...
@@ -537,6 +543,7 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type,
}
doc
=
Document
::
create
(
fileName
);
doc
->
setRevision
(
m_revision
);
Document
::
Ptr
previousDoc
=
switchDocument
(
doc
);
...
...
@@ -577,6 +584,7 @@ Document::Ptr CppPreprocessor::switchDocument(Document::Ptr doc)
CppModelManager
::
CppModelManager
(
QObject
*
parent
)
:
CppModelManagerInterface
(
parent
)
{
m_revision
=
0
;
m_synchronizer
.
setCancelOnWait
(
true
);
m_core
=
Core
::
ICore
::
instance
();
// FIXME
...
...
@@ -762,6 +770,7 @@ QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles
const
QMap
<
QString
,
QString
>
workingCopy
=
buildWorkingCopyList
();
CppPreprocessor
*
preproc
=
new
CppPreprocessor
(
this
);
preproc
->
setRevision
(
++
m_revision
);
preproc
->
setProjectFiles
(
projectFiles
());
preproc
->
setIncludePaths
(
includePaths
());
preproc
->
setFrameworkPaths
(
frameworkPaths
());
...
...
@@ -839,10 +848,22 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc)
{
const
QString
fileName
=
doc
->
fileName
();
bool
outdated
=
false
;
protectSnapshot
.
lock
();
m_snapshot
.
insert
(
doc
);
Document
::
Ptr
previous
=
m_snapshot
.
value
(
fileName
);
if
(
previous
&&
(
doc
->
revision
()
!=
0
&&
doc
->
revision
()
<
previous
->
revision
()))
outdated
=
true
;
else
m_snapshot
.
insert
(
doc
);
protectSnapshot
.
unlock
();
if
(
outdated
)
return
;
QList
<
Core
::
IEditor
*>
openedEditors
=
m_core
->
editorManager
()
->
openedEditors
();
foreach
(
Core
::
IEditor
*
editor
,
openedEditors
)
{
if
(
editor
->
file
()
->
fileName
()
==
fileName
)
{
...
...
src/plugins/cpptools/cppmodelmanager.h
View file @
37a146d0
...
...
@@ -189,6 +189,7 @@ private:
QTimer
*
m_updateEditorSelectionsTimer
;
QFutureSynchronizer
<
void
>
m_synchronizer
;
unsigned
m_revision
;
};
}
// namespace Internal
...
...
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