forked from qt-creator/qt-creator
VcsCommand: Get rid of setCookie()
Remove cookie arg from finished() signal, as it's not used currently. Thus, remove setCookie() method. Change-Id: Iedd328aece776eebd2d161a36ec28370b8bc4bfc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -344,11 +344,8 @@ void GitBaseDiffEditorController::updateBranchList()
|
|||||||
if (revision.isEmpty())
|
if (revision.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const FilePath workingDirectory = baseDirectory();
|
VcsCommand *command = m_instance->vcsExec(baseDirectory(),
|
||||||
VcsCommand *command = m_instance->vcsExec(
|
{"branch", noColorOption, "-a", "--contains", revision});
|
||||||
workingDirectory,
|
|
||||||
{"branch", noColorOption, "-a", "--contains", revision}, nullptr,
|
|
||||||
false, 0, workingDirectory.toString());
|
|
||||||
connect(command, &VcsCommand::stdOutText, this, [this](const QString &text) {
|
connect(command, &VcsCommand::stdOutText, this, [this](const QString &text) {
|
||||||
const QString remotePrefix = "remotes/";
|
const QString remotePrefix = "remotes/";
|
||||||
const QString localPrefix = "<Local>";
|
const QString localPrefix = "<Local>";
|
||||||
|
|||||||
@@ -194,11 +194,10 @@ void VcsBaseClientImpl::annotateRevisionRequested(const FilePath &workingDirecto
|
|||||||
VcsCommand *VcsBaseClientImpl::vcsExec(const FilePath &workingDirectory,
|
VcsCommand *VcsBaseClientImpl::vcsExec(const FilePath &workingDirectory,
|
||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
VcsBaseEditorWidget *editor, bool useOutputToWindow,
|
VcsBaseEditorWidget *editor, bool useOutputToWindow,
|
||||||
unsigned additionalFlags, const QVariant &cookie) const
|
unsigned additionalFlags) const
|
||||||
{
|
{
|
||||||
VcsCommand *command = createCommand(workingDirectory, editor,
|
VcsCommand *command = createCommand(workingDirectory, editor,
|
||||||
useOutputToWindow ? VcsWindowOutputBind : NoOutputBind);
|
useOutputToWindow ? VcsWindowOutputBind : NoOutputBind);
|
||||||
command->setCookie(cookie);
|
|
||||||
command->addFlags(additionalFlags);
|
command->addFlags(additionalFlags);
|
||||||
if (editor)
|
if (editor)
|
||||||
command->setCodec(editor->codec());
|
command->setCodec(editor->codec());
|
||||||
|
|||||||
@@ -115,8 +115,7 @@ public:
|
|||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
VcsBaseEditorWidget *editor = nullptr,
|
VcsBaseEditorWidget *editor = nullptr,
|
||||||
bool useOutputToWindow = false,
|
bool useOutputToWindow = false,
|
||||||
unsigned additionalFlags = 0,
|
unsigned additionalFlags = 0) const;
|
||||||
const QVariant &cookie = {}) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resetCachedVcsInfo(const Utils::FilePath &workingDir);
|
void resetCachedVcsInfo(const Utils::FilePath &workingDir);
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ public:
|
|||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
const FilePath m_defaultWorkingDirectory;
|
const FilePath m_defaultWorkingDirectory;
|
||||||
Environment m_environment;
|
Environment m_environment;
|
||||||
QVariant m_cookie;
|
|
||||||
QTextCodec *m_codec = nullptr;
|
QTextCodec *m_codec = nullptr;
|
||||||
ProgressParser *m_progressParser = nullptr;
|
ProgressParser *m_progressParser = nullptr;
|
||||||
QFutureWatcher<void> m_watcher;
|
QFutureWatcher<void> m_watcher;
|
||||||
@@ -325,7 +324,7 @@ void VcsCommand::run(QFutureInterface<void> &future)
|
|||||||
GlobalFileChangeBlocker::instance()->forceBlocked(false);
|
GlobalFileChangeBlocker::instance()->forceBlocked(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
emit finished(lastExecSuccess, d->m_cookie);
|
emit finished(lastExecSuccess);
|
||||||
if (lastExecSuccess)
|
if (lastExecSuccess)
|
||||||
future.setProgressValue(future.progressMaximum());
|
future.setProgressValue(future.progressMaximum());
|
||||||
else
|
else
|
||||||
@@ -440,11 +439,6 @@ void VcsCommand::runSynchronous(QtcProcess &process)
|
|||||||
process.runBlocking(EventLoopMode::On);
|
process.runBlocking(EventLoopMode::On);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VcsCommand::setCookie(const QVariant &cookie)
|
|
||||||
{
|
|
||||||
d->m_cookie = cookie;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VcsCommand::setCodec(QTextCodec *codec)
|
void VcsCommand::setCodec(QTextCodec *codec)
|
||||||
{
|
{
|
||||||
d->m_codec = codec;
|
d->m_codec = codec;
|
||||||
|
|||||||
@@ -140,8 +140,6 @@ public:
|
|||||||
|
|
||||||
void addFlags(unsigned f);
|
void addFlags(unsigned f);
|
||||||
|
|
||||||
void setCookie(const QVariant &cookie);
|
|
||||||
|
|
||||||
void setCodec(QTextCodec *codec);
|
void setCodec(QTextCodec *codec);
|
||||||
|
|
||||||
void setProgressParser(ProgressParser *parser);
|
void setProgressParser(ProgressParser *parser);
|
||||||
@@ -158,7 +156,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void stdOutText(const QString &);
|
void stdOutText(const QString &);
|
||||||
void stdErrText(const QString &);
|
void stdErrText(const QString &);
|
||||||
void finished(bool success, const QVariant &cookie);
|
void finished(bool success);
|
||||||
|
|
||||||
void terminate(); // Internal
|
void terminate(); // Internal
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user