Skip to content

Commit 22b8211

Browse files
committed
repaired fail of update list
only shows on linux vm because of close timings
1 parent df9a690 commit 22b8211

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

AutoUpdater/updatetask.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -276,20 +276,22 @@ QDateTime UpdateTaskList::currentTask() const
276276

277277
bool UpdateTaskList::nextTask()
278278
{
279-
if(this->isEmpty())
280-
return false;
281-
282-
if(this->first()->nextTask())
283-
return true;
284-
else {
285-
do {
286-
if(this->first()->hasTasks())
287-
return true;
288-
else
289-
delete this->takeFirst();
290-
} while(!this->isEmpty());
291-
return false;
292-
}
279+
if(this->isEmpty())
280+
return false;
281+
282+
if(this->first()->nextTask())
283+
return true;
284+
else {
285+
bool blockFirstHas = false;
286+
do {
287+
if(blockFirstHas && this->first()->hasTasks())
288+
return true;
289+
else
290+
delete this->takeFirst();
291+
blockFirstHas = true;
292+
} while(!this->isEmpty());
293+
return false;
294+
}
293295
}
294296

295297
QByteArray UpdateTaskList::store() const

0 commit comments

Comments
 (0)