Commit 161bb4e4 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

VCS: Properly support contents() on commit descriptions



Change-Id: Ia10a646b49d442c5c8027c744ded003189645283
Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 8a467fcc
......@@ -50,6 +50,8 @@ SubmitEditorFile::SubmitEditorFile(const VcsBaseSubmitEditorParameters *paramete
setId(parameters->id);
setMimeType(QLatin1String(parameters->mimeType));
setTemporary(true);
connect(m_editor, &VcsBaseSubmitEditor::fileContentsChanged,
this, &Core::IDocument::contentsChanged);
}
Core::IDocument::OpenResult SubmitEditorFile::open(QString *errorString, const QString &fileName,
......@@ -71,6 +73,11 @@ Core::IDocument::OpenResult SubmitEditorFile::open(QString *errorString, const Q
return OpenResult::Success;
}
QByteArray SubmitEditorFile::contents() const
{
return m_editor->fileContents();
}
bool SubmitEditorFile::setContents(const QByteArray &contents)
{
return m_editor->setFileContents(contents);
......
......@@ -44,6 +44,7 @@ public:
OpenResult open(QString *errorString, const QString &fileName,
const QString &realFileName) override;
QByteArray contents() const override;
bool setContents(const QByteArray &contents) override;
bool isModified() const override { return m_modified; }
......
......@@ -203,7 +203,7 @@ VcsBaseSubmitEditor::VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *pa
connect(d->m_widget, &SubmitEditorWidget::diffSelected,
this, &VcsBaseSubmitEditor::slotDiffSelectedVcsFiles);
connect(descriptionEdit, &QTextEdit::textChanged,
this, &VcsBaseSubmitEditor::slotDescriptionChanged);
this, &VcsBaseSubmitEditor::fileContentsChanged);
const CommonVcsSettings settings = VcsPlugin::instance()->settings();
// Add additional context menu settings
......@@ -353,10 +353,6 @@ void VcsBaseSubmitEditor::setLineWrapWidth(int w)
d->m_widget->setLineWrapWidth(w);
}
void VcsBaseSubmitEditor::slotDescriptionChanged()
{
}
Core::IDocument *VcsBaseSubmitEditor::document()
{
return d->m_file;
......
......@@ -130,10 +130,10 @@ public:
signals:
void diffSelectedFiles(const QStringList &files);
void diffSelectedRows(const QList<int> &rows);
void fileContentsChanged();
private slots:
void slotDiffSelectedVcsFiles(const QList<int> &rawList);
void slotDescriptionChanged();
void slotCheckSubmitMessage();
void slotInsertNickName();
void slotSetFieldNickName(int);
......
Supports Markdown
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