Commit fe37b278 authored by Tobias Hunger's avatar Tobias Hunger

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's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 93cdde54
......@@ -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);
}
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment