From 5e1530715c901ef07c21186730d0cbadc9d5e7a4 Mon Sep 17 00:00:00 2001 From: Petr Mironychev <9195189+Palm1r@users.noreply.github.com> Date: Thu, 23 Oct 2025 16:14:28 +0200 Subject: [PATCH] fix: QString() issue in linux build --- tools/ReadFilesByPathTool.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/ReadFilesByPathTool.cpp b/tools/ReadFilesByPathTool.cpp index 81433e7..e845f57 100644 --- a/tools/ReadFilesByPathTool.cpp +++ b/tools/ReadFilesByPathTool.cpp @@ -106,13 +106,11 @@ QFuture ReadFilesByPathTool::executeAsync(const QJsonObject &input) return QtConcurrent::run([this, input]() -> QString { QStringList filePaths; - // Check for single filepath QString singlePath = input["filepath"].toString(); if (!singlePath.isEmpty()) { filePaths.append(singlePath); } - // Check for multiple filepaths if (input.contains("filepaths") && input["filepaths"].isArray()) { QJsonArray pathsArray = input["filepaths"].toArray(); for (const auto &pathValue : pathsArray) { @@ -232,12 +230,12 @@ ReadFilesByPathTool::FileResult ReadFilesByPathTool::processFile(const QString & result.content = readFileContent(canonicalPath); result.success = true; - result.path = canonicalPath; // Use canonical path in result + result.path = canonicalPath; } catch (const ToolRuntimeError &e) { result.error = e.message(); } catch (const std::exception &e) { - result.error = QString("Unexpected error: %1").arg(e.what()); + result.error = QString("Unexpected error: %1").arg(QString::fromUtf8(e.what())); } return result; @@ -246,7 +244,6 @@ ReadFilesByPathTool::FileResult ReadFilesByPathTool::processFile(const QString & QString ReadFilesByPathTool::formatResults(const QList &results) const { if (results.size() == 1) { - // Single file format (backward compatibility) const FileResult &result = results.first(); if (!result.success) { throw ToolRuntimeError(QString("Error: %1 - %2").arg(result.path, result.error)); @@ -259,7 +256,6 @@ QString ReadFilesByPathTool::formatResults(const QList &results) con return QString("File: %1\n\nContent:\n%2").arg(result.path, result.content); } - // Multiple files format QStringList output; int successCount = 0;