Commit 699495f0 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Fix compiler warnings, constify.

parent dfee3388
...@@ -79,20 +79,18 @@ void runFileSearch(QFutureInterface<FileSearchResultList> &future, ...@@ -79,20 +79,18 @@ void runFileSearch(QFutureInterface<FileSearchResultList> &future,
future.setProgressRange(0, files->maxProgress()); future.setProgressRange(0, files->maxProgress());
future.setProgressValueAndText(files->currentProgress(), msgFound(searchTerm, numMatches, numFilesSearched)); future.setProgressValueAndText(files->currentProgress(), msgFound(searchTerm, numMatches, numFilesSearched));
bool caseInsensitive = !(flags & QTextDocument::FindCaseSensitively); const bool caseInsensitive = !(flags & QTextDocument::FindCaseSensitively);
bool wholeWord = (flags & QTextDocument::FindWholeWords); const bool wholeWord = (flags & QTextDocument::FindWholeWords);
const QString searchTermLower = searchTerm.toLower(); const QString searchTermLower = searchTerm.toLower();
const QString searchTermUpper = searchTerm.toUpper(); const QString searchTermUpper = searchTerm.toUpper();
int termLength = searchTerm.length(); const int termLength = searchTerm.length();
int termMaxIndex = termLength - 1; const int termMaxIndex = termLength - 1;
const QChar *termData = searchTerm.constData(); const QChar *termData = searchTerm.constData();
const QChar *termDataLower = searchTermLower.constData(); const QChar *termDataLower = searchTermLower.constData();
const QChar *termDataUpper = searchTermUpper.constData(); const QChar *termDataUpper = searchTermUpper.constData();
int chunkSize = qMax(100000, 2 * termLength);
QFile file; QFile file;
QString str; QString str;
QTextStream stream; QTextStream stream;
...@@ -295,7 +293,7 @@ QString Utils::expandRegExpReplacement(const QString &replaceText, const QString ...@@ -295,7 +293,7 @@ QString Utils::expandRegExpReplacement(const QString &replaceText, const QString
{ {
// handles \1 \\ \& & \t // handles \1 \\ \& & \t
QString result; QString result;
int numCaptures = capturedTexts.size() - 1; const int numCaptures = capturedTexts.size() - 1;
for (int i = 0; i < replaceText.length(); ++i) { for (int i = 0; i < replaceText.length(); ++i) {
QChar c = replaceText.at(i); QChar c = replaceText.at(i);
if (c == QLatin1Char('\\') && i < replaceText.length() - 1) { if (c == QLatin1Char('\\') && i < replaceText.length() - 1) {
...@@ -408,8 +406,8 @@ bool SubDirFileIterator::hasNext() const ...@@ -408,8 +406,8 @@ bool SubDirFileIterator::hasNext() const
return true; return true;
while(!m_dirs.isEmpty() && m_currentFiles.isEmpty()) { while(!m_dirs.isEmpty() && m_currentFiles.isEmpty()) {
QDir dir = m_dirs.pop(); QDir dir = m_dirs.pop();
qreal dirProgressMax = m_progressValues.pop(); const qreal dirProgressMax = m_progressValues.pop();
bool processed = m_processedValues.pop(); const bool processed = m_processedValues.pop();
if (dir.exists()) { if (dir.exists()) {
QStringList subDirs; QStringList subDirs;
if (!processed) { if (!processed) {
......
...@@ -121,7 +121,7 @@ static bool isValidFileNameChar(const QChar &c) ...@@ -121,7 +121,7 @@ static bool isValidFileNameChar(const QChar &c)
} }
ProFileEditor::Link ProFileEditor::findLinkAt(const QTextCursor &cursor, ProFileEditor::Link ProFileEditor::findLinkAt(const QTextCursor &cursor,
bool resolveTarget) bool /* resolveTarget */)
{ {
Link link; Link link;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment