forked from qt-creator/qt-creator
Perforce: Replace one use of FileReader
Change-Id: I67902f69a5fbbc635509312525f8816567899c14 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <vcsbase/vcsbaseconstants.h>
|
#include <vcsbase/vcsbaseconstants.h>
|
||||||
@@ -1414,9 +1415,9 @@ bool PerforcePluginPrivate::activateCommit()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Pipe file into p4 submit -i
|
// Pipe file into p4 submit -i
|
||||||
FileReader reader;
|
const Result<QByteArray> contents = FilePath::fromString(m_commitMessageFileName).fileContents();
|
||||||
if (!reader.fetch(Utils::FilePath::fromString(m_commitMessageFileName))) {
|
if (!contents) {
|
||||||
VcsOutputWindow::appendError(reader.errorString());
|
VcsOutputWindow::appendError(contents.error());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1424,7 +1425,7 @@ bool PerforcePluginPrivate::activateCommit()
|
|||||||
submitArgs << QLatin1String("submit") << QLatin1String("-i");
|
submitArgs << QLatin1String("submit") << QLatin1String("-i");
|
||||||
const PerforceResponse submitResponse = runP4Cmd(settings().topLevelSymLinkTarget(), submitArgs,
|
const PerforceResponse submitResponse = runP4Cmd(settings().topLevelSymLinkTarget(), submitArgs,
|
||||||
LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor,
|
LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor,
|
||||||
{}, reader.text());
|
{}, normalizeNewlines(contents.value()));
|
||||||
if (submitResponse.error)
|
if (submitResponse.error)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user