forked from qt-creator/qt-creator
VCS: Deduplicate some submit editor closing logic
Change-Id: I622f5703c222a48606fcca3b99e87f9398e6a815 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
eaad78547c
commit
9b61e484be
@@ -206,7 +206,6 @@ public:
|
||||
void update();
|
||||
void commit();
|
||||
void showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status);
|
||||
void commitFromEditor() override;
|
||||
void uncommit();
|
||||
void diffFromEditorSelected(const QStringList &files);
|
||||
|
||||
@@ -242,7 +241,6 @@ public:
|
||||
QAction *m_menuAction = nullptr;
|
||||
|
||||
FilePath m_submitRepository;
|
||||
bool m_submitActionTriggered = false;
|
||||
|
||||
VcsEditorFactory logEditorFactory {
|
||||
&logEditorParameters,
|
||||
@@ -776,14 +774,6 @@ void BazaarPlugin::testLogResolving()
|
||||
}
|
||||
#endif
|
||||
|
||||
void BazaarPluginPrivate::commitFromEditor()
|
||||
{
|
||||
// Close the submit editor
|
||||
m_submitActionTriggered = true;
|
||||
QTC_ASSERT(submitEditor(), return);
|
||||
EditorManager::closeDocuments({submitEditor()->document()});
|
||||
}
|
||||
|
||||
void BazaarPluginPrivate::uncommit()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
@@ -801,19 +791,6 @@ bool BazaarPluginPrivate::submitEditorAboutToClose()
|
||||
IDocument *editorDocument = commitEditor->document();
|
||||
QTC_ASSERT(editorDocument, return true);
|
||||
|
||||
const VcsBaseSubmitEditor::PromptSubmitResult response =
|
||||
commitEditor->promptSubmit(this, !m_submitActionTriggered);
|
||||
m_submitActionTriggered = false;
|
||||
|
||||
switch (response) {
|
||||
case VcsBaseSubmitEditor::SubmitCanceled:
|
||||
return false;
|
||||
case VcsBaseSubmitEditor::SubmitDiscarded:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QStringList files = commitEditor->checkedFiles();
|
||||
if (!files.empty()) {
|
||||
//save the commit message
|
||||
|
||||
Reference in New Issue
Block a user