Qbs: Avoid a FilePath/String round trip

... when creating tasks in the clean step

Change-Id: I563d126416d266eff0b95baa4deb3133cb3e3dc9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2023-07-14 11:37:28 +02:00
parent 7878b0bf9a
commit abd770520a
2 changed files with 5 additions and 4 deletions

View File

@@ -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);
}
// --------------------------------------------------------------------

View File

@@ -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};