summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2014-04-29 15:39:26 +0200
committerTobias Hunger <tobias.hunger@digia.com>2014-05-08 14:16:05 +0200
commitfe37b2788b83b0baa9cd506fdea4f27d214bf9f0 (patch)
tree5d380da0e7ff1bbee6199c963b60aba3565e9aea
parent93cdde544c9a34ec481bda9ca7f5316876131a2d (diff)
downloadqt-creator-fe37b2788b83b0baa9cd506fdea4f27d214bf9f0.tar.gz
Git: Do not crash when closing creator after reverting all files in a commit
Keep the commit editor around and disable it instead of closing it. That stops Qt Creator from closing the editor when bringing the commit editor to the foreground to ask whether it should be closed. Task-number: QTCREATORBUG-12099 Change-Id: I6927424675338f845f504cb6f630f05eaf8ad49f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r--src/plugins/git/gitsubmiteditor.cpp6
-rw-r--r--src/plugins/git/gitsubmiteditor.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp
index 7857171768..631094d803 100644
--- a/src/plugins/git/gitsubmiteditor.cpp
+++ b/src/plugins/git/gitsubmiteditor.cpp
@@ -179,12 +179,16 @@ void GitSubmitEditor::updateFileModel()
QString errorMessage, commitTemplate;
CommitData data(m_commitType);
if (client->getCommitData(m_workingDirectory, &commitTemplate, data, &errorMessage)) {
+ m_forceClose = false;
setCommitData(data);
submitEditorWidget()->refreshLog(m_workingDirectory);
+ widget()->setEnabled(true);
} else {
+ // Nothing to commit left!
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
m_forceClose = true;
- Core::EditorManager::closeEditor(this);
+ m_model->clear();
+ widget()->setEnabled(false);
}
}
diff --git a/src/plugins/git/gitsubmiteditor.h b/src/plugins/git/gitsubmiteditor.h
index e2e093cfe2..75b2cf5e83 100644
--- a/src/plugins/git/gitsubmiteditor.h
+++ b/src/plugins/git/gitsubmiteditor.h
@@ -53,7 +53,7 @@ public:
void setCommitData(const CommitData &);
GitSubmitEditorPanelData panelData() const;
- bool forceClose() const { return m_forceClose; }
+ bool forceClose() { updateFileModel(); return m_forceClose; }
CommitType commitType() const { return m_commitType; }
QString amendSHA1() const;