Commit 1f7ab0df authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Tobias Hunger

SubmitEditorWidget: Add isDescriptionMandatory()

Usable for SCMs that do not require a message to commit

Change-Id: I6cf0c55698172ad1f53ab31cc8060fa2cbd1a5f5
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent d14fdf2c
......@@ -554,6 +554,11 @@ int SubmitEditorWidget::checkedFilesCount() const
return checkedCount;
}
bool SubmitEditorWidget::isDescriptionMandatory() const
{
return true;
}
QString SubmitEditorWidget::cleanupDescription(const QString &input) const
{
return input;
......@@ -591,7 +596,7 @@ void SubmitEditorWidget::descriptionTextChanged()
bool SubmitEditorWidget::canSubmit() const
{
if (cleanupDescription(descriptionText()).trimmed().isEmpty())
if (isDescriptionMandatory() && cleanupDescription(descriptionText()).trimmed().isEmpty())
return false;
const unsigned checkedCount = checkedFilesCount();
return d->m_emptyFileListEnabled || checkedCount > 0;
......
......@@ -125,6 +125,7 @@ private slots:
void uncheckAll();
protected:
virtual bool isDescriptionMandatory() const;
virtual QString cleanupDescription(const QString &) const;
virtual void changeEvent(QEvent *e);
virtual QString commitName() 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