From f3220dd4086a123e1aa4acf9dc732621a3a14ef5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 19 Jan 2015 10:41:31 +0100 Subject: [PATCH] Vcs: Delete commit message file after commit Change-Id: I5786fb49d99c793319d28d5a14460f962f416ab5 Reviewed-by: Orgad Shaneh --- src/plugins/vcsbase/vcsbaseclient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index 0256bc2a2c0..2438f29f518 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -514,10 +514,12 @@ void VcsBaseClient::commit(const QString &repositoryRoot, // So descendants of VcsBaseClient *must* redefine commit() and extend // extraOptions with the usage for commitMessageFile (see BazaarClient::commit() // for example) - Q_UNUSED(commitMessageFile); QStringList args(vcsCommandString(CommitCommand)); args << extraOptions << files; - enqueueJob(createCommand(repositoryRoot, 0, VcsWindowOutputBind), args); + VcsCommand *cmd = createCommand(repositoryRoot, 0, VcsWindowOutputBind); + if (!commitMessageFile.isEmpty()) + connect(cmd, &VcsCommand::finished, [commitMessageFile]() { QFile(commitMessageFile).remove(); }); + enqueueJob(cmd, args); } VcsBaseClientSettings *VcsBaseClient::settings() const