forked from qt-creator/qt-creator
VCS: Do not prompt on close if nothing was done
Fixes: QTCREATORBUG-22233 Change-Id: I1e8240131ccb9a6583a8ae76b3f5c93799f588a5 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
048fd5955d
commit
20cd55046f
@@ -645,6 +645,11 @@ bool SubmitEditorWidget::canSubmit(QString *whyNot) const
|
||||
return res;
|
||||
}
|
||||
|
||||
bool SubmitEditorWidget::edited() const
|
||||
{
|
||||
return !d->m_description.trimmed().isEmpty() || checkedFilesCount() > 0;
|
||||
}
|
||||
|
||||
void SubmitEditorWidget::setUpdateInProgress(bool value)
|
||||
{
|
||||
d->m_updateInProgress = value;
|
||||
|
||||
@@ -67,6 +67,7 @@ public:
|
||||
QList<SubmitFieldWidget *> submitFieldWidgets() const;
|
||||
|
||||
virtual bool canSubmit(QString *whyNot = nullptr) const;
|
||||
bool edited() const;
|
||||
void setUpdateInProgress(bool value);
|
||||
bool updateInProgress() const;
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ VcsBaseSubmitEditor::PromptSubmitResult
|
||||
|
||||
Core::EditorManager::activateEditor(this, Core::EditorManager::IgnoreNavigationHistory);
|
||||
|
||||
if (!submitWidget->isEnabled())
|
||||
if (!submitWidget->isEnabled() || !submitWidget->edited())
|
||||
return SubmitDiscarded;
|
||||
|
||||
QString errorMessage;
|
||||
|
||||
Reference in New Issue
Block a user