summaryrefslogtreecommitdiff
path: root/src/plugins/vcsbase
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-07-12 13:34:26 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-07-12 14:49:00 +0000
commite3da02248aefe4cbfa9dede89358fc98d6f3c71a (patch)
tree57ead1c4548b1833bac39f131c67e76bd894bd3e /src/plugins/vcsbase
parent3de1fffbeb13ef742be37649b90c1e9296748ce2 (diff)
downloadqt-creator-e3da02248aefe4cbfa9dede89358fc98d6f3c71a.tar.gz
ShellCommand: De-virtualize runCommand()
Add virtual postRunCommand() method, called by the end of runCommand(). In this way the rest of the API of VcsCommand remains an implementation detail. Change-Id: Ia4149334bd39a1448266d2406e0987bee07a9c58 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r--src/plugins/vcsbase/vcscommand.cpp12
-rw-r--r--src/plugins/vcsbase/vcscommand.h8
2 files changed, 4 insertions, 16 deletions
diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp
index e2d8ed7795..c290e2d778 100644
--- a/src/plugins/vcsbase/vcscommand.cpp
+++ b/src/plugins/vcsbase/vcscommand.cpp
@@ -82,14 +82,6 @@ Environment VcsCommand::environment() const
return env;
}
-void VcsCommand::runCommand(QtcProcess &proc,
- const CommandLine &command,
- const FilePath &workingDirectory)
-{
- ShellCommand::runCommand(proc, command, workingDirectory);
- emitRepositoryChanged(workingDirectory);
-}
-
void VcsCommand::addTask(QFuture<void> &future)
{
const QString name = displayName();
@@ -114,13 +106,13 @@ void VcsCommand::addTask(QFuture<void> &future)
Internal::VcsPlugin::addFuture(future);
}
-void VcsCommand::emitRepositoryChanged(const FilePath &workingDirectory)
+void VcsCommand::postRunCommand(const FilePath &workingDirectory)
{
if (m_preventRepositoryChanged || !(flags() & VcsCommand::ExpectRepoChanges))
return;
// TODO tell the document manager that the directory now received all expected changes
// Core::DocumentManager::unexpectDirectoryChange(d->m_workingDirectory);
- VcsManager::emitRepositoryChanged(workDirectory(workingDirectory));
+ VcsManager::emitRepositoryChanged(workingDirectory);
}
} // namespace VcsBase
diff --git a/src/plugins/vcsbase/vcscommand.h b/src/plugins/vcsbase/vcscommand.h
index a59eba1068..80fa69dcc8 100644
--- a/src/plugins/vcsbase/vcscommand.h
+++ b/src/plugins/vcsbase/vcscommand.h
@@ -48,16 +48,12 @@ public:
VcsCommand(const Utils::FilePath &defaultWorkingDirectory, const Utils::Environment &environment);
- void runCommand(Utils::QtcProcess &process,
- const Utils::CommandLine &command,
- const Utils::FilePath &workDirectory = {}) override;
-
protected:
Utils::Environment environment() const override;
- void addTask(QFuture<void> &future) override;
private:
- void emitRepositoryChanged(const Utils::FilePath &workingDirectory);
+ void addTask(QFuture<void> &future) override;
+ void postRunCommand(const Utils::FilePath &workDirectory) override;
QPointer<Core::FutureProgress> m_progress;
bool m_preventRepositoryChanged;