Consolidate duplicate code

Change-Id: I0cae5df1b1f5a8ddab063dc37e1dcd0cb97701a0
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-07-27 10:49:40 +02:00
committed by Niels Weber
parent 8f738836ea
commit 8b4bdb6a00

View File

@@ -557,7 +557,8 @@ bool TestCodeParser::postponed(const QStringList &fileList)
case Idle:
return false;
case PartialParse:
// partial is running, postponing a full parse
case FullParse:
// parse is running, postponing a full parse
if (fileList.isEmpty()) {
m_partialUpdatePostponed = false;
m_postponedFiles.clear();
@@ -567,23 +568,6 @@ bool TestCodeParser::postponed(const QStringList &fileList)
if (m_fullUpdatePostponed)
return true;
// partial parse triggered, postpone or add current files to already postponed partial
foreach (const QString &file, fileList)
m_postponedFiles.insert(file);
m_partialUpdatePostponed = true;
}
return true;
case FullParse:
// full parse is running, postponing another full parse
if (fileList.isEmpty()) {
m_partialUpdatePostponed = false;
m_postponedFiles.clear();
m_fullUpdatePostponed = true;
} else {
// full parse already postponed, ignoring triggering a partial parse
if (m_fullUpdatePostponed) {
return true;
}
// partial parse triggered, postpone or add current files to already postponed partial
foreach (const QString &file, fileList)
m_postponedFiles.insert(file);
m_partialUpdatePostponed = true;