Fix progress bar for searching in files.

Affects e.g. Advanced Find->All Projects. Progress bar was not updating
at all, except at the end of the search.
The fix is a workaround for regression in
QFutureInterface::isProgressUpdateNeeded that would no longer return
true the very first time in Qt 4.7. To be reverted when this is fixed
in a released Qt version.

Reviewed-by: dt
This commit is contained in:
con
2011-03-28 13:35:43 +02:00
parent 306a945b86
commit 01dd85bc00
2 changed files with 6 additions and 3 deletions

View File

@@ -178,7 +178,8 @@ void runFileSearch(QFutureInterface<FileSearchResultList> &future,
}
++numFilesSearched;
if (future.isProgressUpdateNeeded()) {
if (future.isProgressUpdateNeeded()
|| future.progressValue() == 0 /*workaround for regression in Qt*/) {
if (!results.isEmpty()) {
future.reportResult(results);
results.clear();
@@ -256,7 +257,8 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResultList> &future,
++lineNr;
}
++numFilesSearched;
if (future.isProgressUpdateNeeded()) {
if (future.isProgressUpdateNeeded()
|| future.progressValue() == 0 /*workaround for regression in Qt*/) {
if (!results.isEmpty()) {
future.reportResult(results);
results.clear();