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;