Commit a4a8d9c4 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Tobias Hunger
Browse files

VCS: Replace isDescriptionMandatory() virtual function with a member



Change-Id: Id7be95e9d20450d57cfd4f2fcae0088e6b67c2ec
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent ceb57574
......@@ -178,6 +178,7 @@ struct SubmitEditorWidgetPrivate
bool m_commitEnabled;
bool m_ignoreChange;
bool m_descriptionMandatory;
};
SubmitEditorWidgetPrivate::SubmitEditorWidgetPrivate() :
......@@ -189,7 +190,8 @@ SubmitEditorWidgetPrivate::SubmitEditorWidgetPrivate() :
m_submitShortcut(0),
m_lineWidth(defaultLineWidth),
m_commitEnabled(false),
m_ignoreChange(false)
m_ignoreChange(false),
m_descriptionMandatory(true)
{
}
......@@ -376,6 +378,16 @@ void SubmitEditorWidget::setLineWrapWidth(int v)
d->m_ui.description->setLineWrapColumnOrWidth(v);
}
bool SubmitEditorWidget::isDescriptionMandatory() const
{
return d->m_descriptionMandatory;
}
void SubmitEditorWidget::setDescriptionMandatory(bool v)
{
d->m_descriptionMandatory = v;
}
int SubmitEditorWidget::fileNameColumn() const
{
return d->m_fileNameColumn;
......@@ -554,11 +566,6 @@ int SubmitEditorWidget::checkedFilesCount() const
return checkedCount;
}
bool SubmitEditorWidget::isDescriptionMandatory() const
{
return true;
}
QString SubmitEditorWidget::cleanupDescription(const QString &input) const
{
return input;
......
......@@ -60,6 +60,7 @@ class QTCREATOR_UTILS_EXPORT SubmitEditorWidget : public QWidget
Q_PROPERTY(QAbstractItemView::SelectionMode fileListSelectionMode READ fileListSelectionMode WRITE setFileListSelectionMode DESIGNABLE true)
Q_PROPERTY(bool lineWrap READ lineWrap WRITE setLineWrap DESIGNABLE true)
Q_PROPERTY(int lineWrapWidth READ lineWrapWidth WRITE setLineWrapWidth DESIGNABLE true)
Q_PROPERTY(bool descriptionMandatory READ isDescriptionMandatory WRITE setDescriptionMandatory DESIGNABLE false)
Q_PROPERTY(bool emptyFileListEnabled READ isEmptyFileListEnabled WRITE setEmptyFileListEnabled DESIGNABLE true)
public:
......@@ -90,6 +91,9 @@ public:
int lineWrapWidth() const;
void setLineWrapWidth(int);
bool isDescriptionMandatory() const;
void setDescriptionMandatory(bool);
QAbstractItemView::SelectionMode fileListSelectionMode() const;
void setFileListSelectionMode(QAbstractItemView::SelectionMode sm);
......@@ -125,7 +129,6 @@ private slots:
void uncheckAll();
protected:
virtual bool isDescriptionMandatory() const;
virtual QString cleanupDescription(const QString &) const;
virtual void changeEvent(QEvent *e);
virtual QString commitName() const;
......
......@@ -570,6 +570,16 @@ bool VcsBaseSubmitEditor::setFileContents(const QString &contents)
return true;
}
bool VcsBaseSubmitEditor::isDescriptionMandatory() const
{
return d->m_widget->isDescriptionMandatory();
}
void VcsBaseSubmitEditor::setDescriptionMandatory(bool v)
{
d->m_widget->setDescriptionMandatory(v);
}
enum { checkDialogMinimumWidth = 500 };
VcsBaseSubmitEditor::PromptSubmitResult
......
......@@ -172,6 +172,9 @@ protected:
virtual QByteArray fileContents() const;
virtual bool setFileContents(const QString &contents);
void setDescriptionMandatory(bool v);
bool isDescriptionMandatory() const;
private:
void createUserFields(const QString &fieldConfigFile);
bool checkSubmitMessage(QString *errorMessage) 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