File search wasn't showing non-latin1 chars correctly in results.

Missing conversion back to the codec. This fixes it only for Utf8
encoded files. It was only happening for non-regexp searches.

Task-number: QTCREATORBUG-65
Reviewed-by: Robert Loehning
This commit is contained in:
con
2010-10-08 12:22:53 +02:00
parent 6b6eeb8765
commit 028a2c8f5c

View File

@@ -172,7 +172,7 @@ void runFileSearch(QFutureInterface<FileSearchResultList> &future,
int n = 0;
while (startOfLastLine[i] != '\n' && startOfLastLine[i] != '\r' && i < textLength && n++ < 256)
res.append(startOfLastLine[i++]);
results << FileSearchResult(s, lineNr, QString(res),
results << FileSearchResult(s, lineNr, QString::fromUtf8(res),
regionPtr - startOfLastLine, sa.length(),
QStringList());
++numMatches;