From 4531abbe85112cb94640b8a8082f86fd6a36c267 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 15 Apr 2025 13:14:30 +0200 Subject: [PATCH] Perforce: Replace one use of FileReader Change-Id: I67902f69a5fbbc635509312525f8816567899c14 Reviewed-by: David Schulz --- src/plugins/perforce/perforceplugin.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 629df4fe831..e28a4a64b46 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -1414,9 +1415,9 @@ bool PerforcePluginPrivate::activateCommit() return false; // Pipe file into p4 submit -i - FileReader reader; - if (!reader.fetch(Utils::FilePath::fromString(m_commitMessageFileName))) { - VcsOutputWindow::appendError(reader.errorString()); + const Result contents = FilePath::fromString(m_commitMessageFileName).fileContents(); + if (!contents) { + VcsOutputWindow::appendError(contents.error()); return false; } @@ -1424,7 +1425,7 @@ bool PerforcePluginPrivate::activateCommit() submitArgs << QLatin1String("submit") << QLatin1String("-i"); const PerforceResponse submitResponse = runP4Cmd(settings().topLevelSymLinkTarget(), submitArgs, LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor, - {}, reader.text()); + {}, normalizeNewlines(contents.value())); if (submitResponse.error) return false;