Clang: Ensure to cancel every expired or not added job

Previosly the JobQueue cancelled job requests for some reasons, but not
for others. Conceptually, JobQueue should not make any difference
between those.

Introduce equal treatment and always cancel if a job request could not
be added or is expired as this avoids leaving the Qt Creator side
waiting for a response.

Change-Id: I26b392b7f80b89ba2ae9a46a8d1b51403ec6eb4a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-12-13 14:52:05 +01:00
parent f8d15c3940
commit e0bbb0a0bb
2 changed files with 49 additions and 35 deletions

View File

@@ -66,7 +66,8 @@ private:
bool isJobRunningForJobRequest(const JobRequest &jobRequest);
JobRequests takeJobRequestsToRunNow();
void removeExpiredRequests();
bool isJobRequestExpired(const JobRequest &jobRequest);
bool isJobRequestAddable(const JobRequest &jobRequest, QString &notAddableReason);
bool isJobRequestExpired(const JobRequest &jobRequest, QString &expirationReason);
private:
Documents &m_documents;