forked from qt-creator/qt-creator
		
	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:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user