forked from qt-creator/qt-creator
VCS: Remove unused termination mode
Defaults to NoReport and nobody sets other values Change-Id: I3def23bd350fcef45df9eb8d3a0e86baac192bd9 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
0c50c5a1d3
commit
360366ae08
@@ -2239,7 +2239,6 @@ VcsBase::Command *GitClient::executeGit(const QString &workingDirectory,
|
||||
outputWindow()->appendCommand(workingDirectory, settings()->stringValue(GitSettings::binaryPathKey), arguments);
|
||||
VcsBase::Command *command = createCommand(workingDirectory, editor, useOutputToWindow, editorLineNumber);
|
||||
command->addJob(arguments, settings()->intValue(GitSettings::timeoutKey));
|
||||
command->setTerminationReportMode(VcsBase::Command::NoReport);
|
||||
command->setUnixTerminalDisabled(false);
|
||||
command->setExpectChanges(expectChanges);
|
||||
command->execute();
|
||||
|
||||
@@ -47,18 +47,6 @@
|
||||
|
||||
Q_DECLARE_METATYPE(QVariant)
|
||||
|
||||
static QString msgTermination(int exitCode, const QString &binaryPath, const QStringList &args)
|
||||
{
|
||||
QString cmd = QFileInfo(binaryPath).baseName();
|
||||
if (!args.empty()) {
|
||||
cmd += QLatin1Char(' ');
|
||||
cmd += args.front();
|
||||
}
|
||||
return exitCode ?
|
||||
QCoreApplication::translate("VcsCommand", "\n'%1' failed (exit code %2).\n").arg(cmd).arg(exitCode) :
|
||||
QCoreApplication::translate("VcsCommand", "\n'%1' completed (exit code %2).\n").arg(cmd).arg(exitCode);
|
||||
}
|
||||
|
||||
namespace VcsBase {
|
||||
namespace Internal {
|
||||
|
||||
@@ -86,7 +74,6 @@ public:
|
||||
QTextCodec *m_codec;
|
||||
|
||||
QList<Job> m_jobs;
|
||||
Command::TerminationReportMode m_reportTerminationMode;
|
||||
|
||||
bool m_lastExecSuccess;
|
||||
int m_lastExecExitCode;
|
||||
@@ -102,7 +89,6 @@ CommandPrivate::CommandPrivate(const QString &binary,
|
||||
m_defaultTimeout(10),
|
||||
m_expectChanges(false),
|
||||
m_codec(0),
|
||||
m_reportTerminationMode(Command::NoReport),
|
||||
m_lastExecSuccess(false),
|
||||
m_lastExecExitCode(-1)
|
||||
{
|
||||
@@ -146,16 +132,6 @@ const QProcessEnvironment &Command::processEnvironment() const
|
||||
return d->m_environment;
|
||||
}
|
||||
|
||||
Command::TerminationReportMode Command::reportTerminationMode() const
|
||||
{
|
||||
return d->m_reportTerminationMode;
|
||||
}
|
||||
|
||||
void Command::setTerminationReportMode(TerminationReportMode m)
|
||||
{
|
||||
d->m_reportTerminationMode = m;
|
||||
}
|
||||
|
||||
int Command::defaultTimeout() const
|
||||
{
|
||||
return d->m_defaultTimeout;
|
||||
@@ -275,16 +251,6 @@ void Command::run()
|
||||
|
||||
error += QString::fromLocal8Bit(stdErr);
|
||||
exitCode = process->exitCode();
|
||||
switch (reportTerminationMode()) {
|
||||
case NoReport:
|
||||
break;
|
||||
case ReportStdout:
|
||||
stdOut += msgTermination(exitCode, binaryPath(), d->m_jobs.at(j).arguments).toUtf8();
|
||||
break;
|
||||
case ReportStderr:
|
||||
error += msgTermination(exitCode, binaryPath(), d->m_jobs.at(j).arguments);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString stdOutS = d->m_codec ? d->m_codec->toUnicode(stdOut)
|
||||
|
||||
@@ -47,14 +47,6 @@ class VCSBASE_EXPORT Command : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Where to report command termination with exit code if desired
|
||||
enum TerminationReportMode
|
||||
{
|
||||
NoReport,
|
||||
ReportStdout, // This assumes UTF8
|
||||
ReportStderr
|
||||
};
|
||||
|
||||
Command(const QString &binary,
|
||||
const QString &workingDirectory,
|
||||
const QProcessEnvironment &environment);
|
||||
@@ -70,10 +62,6 @@ public:
|
||||
const QString &workingDirectory() const;
|
||||
const QProcessEnvironment &processEnvironment() const;
|
||||
|
||||
// Report command termination with exit code
|
||||
TerminationReportMode reportTerminationMode() const;
|
||||
void setTerminationReportMode(TerminationReportMode m);
|
||||
|
||||
int defaultTimeout() const;
|
||||
void setDefaultTimeout(int timeout);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user