fix: Missed QString linux compilation error

This commit is contained in:
Petr Mironychev
2025-10-20 18:52:01 +02:00
parent a0a76f2665
commit db7da29fa4

View File

@ -131,7 +131,9 @@ QFuture<QString> FindFileTool::executeAsync(const QJsonObject &input)
LOG_MESSAGE(QString("FindFileTool: Searching for '%1'%2 (max: %3)") LOG_MESSAGE(QString("FindFileTool: Searching for '%1'%2 (max: %3)")
.arg(query) .arg(query)
.arg(filePattern.isEmpty() ? "" : QString(" with pattern '%1'").arg(filePattern)) .arg(
filePattern.isEmpty() ? QString("")
: QString(" with pattern '%1'").arg(filePattern))
.arg(maxResults)); .arg(maxResults));
QFileInfo queryInfo(query); QFileInfo queryInfo(query);
@ -165,10 +167,14 @@ QFuture<QString> FindFileTool::executeAsync(const QJsonObject &input)
int totalFound = matches.size(); int totalFound = matches.size();
if (matches.isEmpty()) { if (matches.isEmpty()) {
QString error = QString("Error: No files found matching '%1'%2 in the project. " QString error = QString(
"Try using a different search term or check the file name.") "Error: No files found matching '%1'%2 in the project. "
"Try using a different search term or check the file name.")
.arg(query) .arg(query)
.arg(filePattern.isEmpty() ? "" : QString(" with pattern '%1'").arg(filePattern)); .arg(
filePattern.isEmpty()
? QString("")
: QString(" with pattern '%1'").arg(filePattern));
throw std::runtime_error(error.toStdString()); throw std::runtime_error(error.toStdString());
} }
@ -276,7 +282,7 @@ QString FindFileTool::formatResults(const QList<FileMatch> &matches,
} else { } else {
result = QString("Found %1 file%2%3:\n\n") result = QString("Found %1 file%2%3:\n\n")
.arg(totalFound) .arg(totalFound)
.arg(totalFound == 1 ? "" : "s") .arg(totalFound == 1 ? QString("") : QString("s"))
.arg(wasTruncated ? QString(" (showing first %1)").arg(matches.size()) : ""); .arg(wasTruncated ? QString(" (showing first %1)").arg(matches.size()) : "");
QString currentProject; QString currentProject;