forked from qt-creator/qt-creator
ShellCommand: De-virtualize postRunCommand()
Provide runCommandFinished() signal instead. Change-Id: I7c5e7d4aa484a7248dc369880343996e18c7c4b0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -223,11 +223,6 @@ void ShellCommand::cancel()
|
|||||||
emit terminate();
|
emit terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShellCommand::postRunCommand(const FilePath &workingDirectory)
|
|
||||||
{
|
|
||||||
Q_UNUSED(workingDirectory)
|
|
||||||
}
|
|
||||||
|
|
||||||
int ShellCommand::timeoutS() const
|
int ShellCommand::timeoutS() const
|
||||||
{
|
{
|
||||||
return std::accumulate(d->m_jobs.cbegin(), d->m_jobs.cend(), 0,
|
return std::accumulate(d->m_jobs.cbegin(), d->m_jobs.cend(), 0,
|
||||||
@@ -337,7 +332,7 @@ void ShellCommand::runCommand(QtcProcess &proc,
|
|||||||
emit appendError(proc.exitMessage());
|
emit appendError(proc.exitMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
postRunCommand(dir);
|
emit runCommandFinished(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShellCommand::runFullySynchronous(QtcProcess &process)
|
void ShellCommand::runFullySynchronous(QtcProcess &process)
|
||||||
|
@@ -149,6 +149,7 @@ signals:
|
|||||||
void appendMessage(const QString &text);
|
void appendMessage(const QString &text);
|
||||||
|
|
||||||
void executedAsync(const QFuture<void> &future);
|
void executedAsync(const QFuture<void> &future);
|
||||||
|
void runCommandFinished(const Utils::FilePath &workingDirectory);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setEnvironment(const Environment &env);
|
void setEnvironment(const Environment &env);
|
||||||
@@ -156,7 +157,6 @@ protected:
|
|||||||
int timeoutS() const;
|
int timeoutS() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void postRunCommand(const Utils::FilePath &workDirectory);
|
|
||||||
FilePath workDirectory(const FilePath &wd) const;
|
FilePath workDirectory(const FilePath &wd) const;
|
||||||
void run(QFutureInterface<void> &future);
|
void run(QFutureInterface<void> &future);
|
||||||
|
|
||||||
|
@@ -79,6 +79,7 @@ VcsCommand::VcsCommand(const FilePath &workingDirectory, const Environment &envi
|
|||||||
connect(this, &ShellCommand::appendMessage, outputWindow, &VcsOutputWindow::appendMessage);
|
connect(this, &ShellCommand::appendMessage, outputWindow, &VcsOutputWindow::appendMessage);
|
||||||
|
|
||||||
connect(this, &ShellCommand::executedAsync, this, &VcsCommand::addTask);
|
connect(this, &ShellCommand::executedAsync, this, &VcsCommand::addTask);
|
||||||
|
connect(this, &ShellCommand::runCommandFinished, this, &VcsCommand::postRunCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VcsCommand::addTask(const QFuture<void> &future)
|
void VcsCommand::addTask(const QFuture<void> &future)
|
||||||
|
@@ -41,7 +41,7 @@ private:
|
|||||||
const Utils::Environment &environment);
|
const Utils::Environment &environment);
|
||||||
|
|
||||||
void addTask(const QFuture<void> &future);
|
void addTask(const QFuture<void> &future);
|
||||||
void postRunCommand(const Utils::FilePath &workDirectory) override;
|
void postRunCommand(const Utils::FilePath &workDirectory);
|
||||||
|
|
||||||
QPointer<Core::FutureProgress> m_progress;
|
QPointer<Core::FutureProgress> m_progress;
|
||||||
bool m_preventRepositoryChanged;
|
bool m_preventRepositoryChanged;
|
||||||
|
Reference in New Issue
Block a user