Skip to content
GitLab
Menu
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
645cfb59
Commit
645cfb59
authored
Mar 24, 2010
by
Roberto Raggi
Browse files
Ignore outdated parsing requests.
parent
7e5902f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cpptoolseditorsupport.cpp
View file @
645cfb59
...
...
@@ -49,6 +49,8 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager)
_modelManager
(
modelManager
),
_updateDocumentInterval
(
UPDATE_DOCUMENT_DEFAULT_INTERVAL
)
{
_revision
=
0
;
_updateDocumentTimer
=
new
QTimer
(
this
);
_updateDocumentTimer
->
setSingleShot
(
true
);
_updateDocumentTimer
->
setInterval
(
_updateDocumentInterval
);
...
...
@@ -102,6 +104,8 @@ void CppEditorSupport::setUpdateDocumentInterval(int updateDocumentInterval)
void
CppEditorSupport
::
updateDocument
()
{
_revision
=
editorRevision
();
if
(
TextEditor
::
BaseTextEditor
*
edit
=
qobject_cast
<
TextEditor
::
BaseTextEditor
*>
(
_textEditor
->
widget
()))
{
const
QList
<
QTextEdit
::
ExtraSelection
>
selections
=
edit
->
extraSelections
(
TextEditor
::
BaseTextEditor
::
CodeWarningsSelection
);
...
...
@@ -114,7 +118,7 @@ void CppEditorSupport::updateDocument()
void
CppEditorSupport
::
updateDocumentNow
()
{
if
(
_documentParser
.
isRunning
())
{
if
(
_documentParser
.
isRunning
()
||
_revision
!=
editorRevision
()
)
{
_updateDocumentTimer
->
start
(
_updateDocumentInterval
);
}
else
{
_updateDocumentTimer
->
stop
();
...
...
src/plugins/cpptools/cpptoolseditorsupport.h
View file @
645cfb59
...
...
@@ -88,6 +88,7 @@ private:
int
_updateDocumentInterval
;
QFuture
<
void
>
_documentParser
;
QString
_cachedContents
;
unsigned
_revision
;
};
}
// namespace Internal
...
...
Write
Preview
Supports
Markdown
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