From abd770520a943e915e0e4d66d7637f8f2b84a271 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 14 Jul 2023 11:37:28 +0200 Subject: [PATCH] Qbs: Avoid a FilePath/String round trip ... when creating tasks in the clean step Change-Id: I563d126416d266eff0b95baa4deb3133cb3e3dc9 Reviewed-by: Christian Kandeler --- src/plugins/qbsprojectmanager/qbscleanstep.cpp | 7 ++++--- src/plugins/qbsprojectmanager/qbscleanstep.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index a0e6916403a..9d6799a5fb1 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -119,7 +119,7 @@ void QbsCleanStep::cleaningDone(const ErrorInfo &error) m_session = nullptr; for (const ErrorInfoItem &item : error.items) - createTaskAndOutput(Task::Error, item.description, item.filePath.toString(), item.line); + createTaskAndOutput(Task::Error, item.description, item.filePath, item.line); emit finished(!error.hasError()); } @@ -135,10 +135,11 @@ void QbsCleanStep::handleProgress(int value) emit progress(value * 100 / m_maxProgress, m_description); } -void QbsCleanStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line) +void QbsCleanStep::createTaskAndOutput(Task::TaskType type, const QString &message, + const FilePath &file, int line) { emit addOutput(message, OutputFormat::Stdout); - emit addTask(CompileTask(type, message, Utils::FilePath::fromString(file), line), 1); + emit addTask(CompileTask(type, message, file, line), 1); } // -------------------------------------------------------------------- diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.h b/src/plugins/qbsprojectmanager/qbscleanstep.h index f7f1d58d018..b3552993366 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.h +++ b/src/plugins/qbsprojectmanager/qbscleanstep.h @@ -38,7 +38,7 @@ private: void handleProgress(int value); void createTaskAndOutput(ProjectExplorer::Task::TaskType type, - const QString &message, const QString &file, int line); + const QString &message, const Utils::FilePath &file, int line); Utils::BoolAspect dryRun{this}; Utils::BoolAspect keepGoing{this};