diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index b01aa813f09..62bd9633836 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -949,7 +949,7 @@ VcsCommand *BazaarPluginPrivate::createInitialCheckoutCommand(const QString &url { Environment env = m_client.processEnvironment(baseDirectory); env.set("BZR_PROGRESS_BAR", "text"); - auto command = VcsBaseClient::createVcsCommand(this, baseDirectory, env); + auto command = VcsBaseClient::createVcsCommand(baseDirectory, env); command->addJob({m_client.vcsBinary(baseDirectory), {m_client.vcsCommandString(BazaarClient::CloneCommand), extraArgs, url, localName}}, -1); return command; diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 24ae4a2b17d..c72d3b04b1c 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -413,8 +413,7 @@ VcsCommand *CvsPluginPrivate::createInitialCheckoutCommand(const QString &url, QStringList args; args << QLatin1String("checkout") << url << extraArgs; - auto command = VcsBaseClient::createVcsCommand(this, baseDirectory, - Environment::systemEnvironment()); + auto command = VcsBaseClient::createVcsCommand(baseDirectory, Environment::systemEnvironment()); command->setDisplayName(Tr::tr("CVS Checkout")); command->addJob({settings().binaryPath(), settings().addOptions(args)}, -1); return command; diff --git a/src/plugins/fossil/fossilplugin.cpp b/src/plugins/fossil/fossilplugin.cpp index 77e9f62d921..46b285e5bc4 100644 --- a/src/plugins/fossil/fossilplugin.cpp +++ b/src/plugins/fossil/fossilplugin.cpp @@ -931,7 +931,7 @@ VcsCommand *FossilPluginPrivate::createInitialCheckoutCommand(const QString &sou checkoutPath.createDir(); // Setup the wizard page command job - auto command = VcsBaseClient::createVcsCommand(this, checkoutPath, + auto command = VcsBaseClient::createVcsCommand(checkoutPath, fossilClient().processEnvironment(checkoutPath)); if (!isLocalRepository diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 9a5589b2284..bae1deeb77e 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1838,7 +1838,7 @@ VcsCommand *GitPluginPrivate::createInitialCheckoutCommand(const QString &url, const QString &localName, const QStringList &extraArgs) { - auto command = VcsBaseClient::createVcsCommand(this, baseDirectory, + auto command = VcsBaseClient::createVcsCommand(baseDirectory, gitClient().processEnvironment(baseDirectory)); command->addFlags(RunFlags::SuppressStdErr); command->addJob({gitClient().vcsBinary(baseDirectory), diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index fe16c6caea5..b1be13e4521 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -733,7 +733,7 @@ VcsCommand *MercurialPluginPrivate::createInitialCheckoutCommand(const QString & const QString &localName, const QStringList &extraArgs) { - auto command = VcsBaseClient::createVcsCommand(this, baseDirectory, + auto command = VcsBaseClient::createVcsCommand(baseDirectory, mercurialClient().processEnvironment(baseDirectory)); command->addJob({settings().binaryPath(), {"clone", extraArgs, url, localName}}, -1); return command; diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 5b170a2c9af..406ecf2ef96 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -1149,7 +1149,7 @@ VcsCommand *SubversionPluginPrivate::createInitialCheckoutCommand(const QString args << SubversionClient::AddAuthOptions(); args << Subversion::Constants::NON_INTERACTIVE_OPTION << extraArgs << url << localName; - auto command = VcsBaseClient::createVcsCommand(this, baseDirectory, + auto command = VcsBaseClient::createVcsCommand(baseDirectory, subversionClient().processEnvironment(baseDirectory)); command->addJob(args, -1); return command; diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index b3beeefc086..2b5a59cebcc 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -16,6 +16,8 @@ #include #include +#include + #include #include @@ -71,8 +73,7 @@ FilePath VcsBaseClientImpl::vcsBinary(const Utils::FilePath &forDirectory) const VcsCommand *VcsBaseClientImpl::createCommand(const FilePath &workingDirectory, VcsBaseEditorWidget *editor) const { - auto cmd = createVcsCommand(const_cast(this), - workingDirectory, processEnvironment(workingDirectory)); + auto cmd = createVcsCommand(workingDirectory, processEnvironment(workingDirectory)); if (editor) { editor->setCommand(cmd); connect(cmd, &VcsCommand::done, editor, [editor, cmd] { @@ -210,15 +211,9 @@ int VcsBaseClientImpl::vcsTimeoutS() const VcsCommand *VcsBaseClientImpl::createVcsCommand(const FilePath &defaultWorkingDir, const Environment &environment) -{ - return new VcsCommand(defaultWorkingDir, environment); -} - -VcsCommand *VcsBaseClientImpl::createVcsCommand(QObject *parent, const FilePath &defaultWorkingDir, - const Environment &environment) { auto command = new VcsCommand(defaultWorkingDir, environment); - command->setParent(parent); + command->setParent(ExtensionSystem::shutdownGuard()); return command; } diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index 10403b8893d..9bdf18059b6 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -42,11 +42,8 @@ public: virtual Utils::FilePath vcsBinary(const Utils::FilePath &forDirectory) const; int vcsTimeoutS() const; - // TODO: For master: remove this overload. static VcsCommand *createVcsCommand(const Utils::FilePath &defaultWorkingDir, const Utils::Environment &environment); - static VcsCommand *createVcsCommand(QObject *parent, const Utils::FilePath &defaultWorkingDir, - const Utils::Environment &environment); VcsBaseEditorWidget *createVcsEditor(Utils::Id kind, QString title, const Utils::FilePath &source, QTextCodec *codec,