forked from qt-creator/qt-creator
Get rid of DiffShowEditor.
Made DiffEditor customizable instead Change-Id: If92799d47c7e731febb45197384c082eb3af55df Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
This commit is contained in:
@@ -33,9 +33,12 @@ namespace DiffEditor {
|
||||
|
||||
DiffEditorController::DiffEditorController(QObject *parent)
|
||||
: QObject(parent),
|
||||
m_descriptionEnabled(false),
|
||||
m_descriptionVisible(true),
|
||||
m_contextLinesNumber(3),
|
||||
m_ignoreWhitespaces(true),
|
||||
m_syncScrollBars(true)
|
||||
m_syncScrollBars(true),
|
||||
m_currentDiffFileIndex(-1)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
@@ -60,6 +63,21 @@ QString DiffEditorController::workingDirectory() const
|
||||
return m_workingDirectory;
|
||||
}
|
||||
|
||||
QString DiffEditorController::description() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
bool DiffEditorController::isDescriptionEnabled() const
|
||||
{
|
||||
return m_descriptionEnabled;
|
||||
}
|
||||
|
||||
bool DiffEditorController::isDescriptionVisible() const
|
||||
{
|
||||
return m_descriptionVisible;
|
||||
}
|
||||
|
||||
int DiffEditorController::contextLinesNumber() const
|
||||
{
|
||||
return m_contextLinesNumber;
|
||||
@@ -100,6 +118,33 @@ void DiffEditorController::setDiffContents(const QList<DiffFilesContents> &diffF
|
||||
emit diffContentsChanged(diffFileList, workingDirectory);
|
||||
}
|
||||
|
||||
void DiffEditorController::setDescription(const QString &description)
|
||||
{
|
||||
if (m_description == description)
|
||||
return;
|
||||
|
||||
m_description = description;
|
||||
emit descriptionChanged(description);
|
||||
}
|
||||
|
||||
void DiffEditorController::setDescriptionEnabled(bool on)
|
||||
{
|
||||
if (m_descriptionEnabled == on)
|
||||
return;
|
||||
|
||||
m_descriptionEnabled = on;
|
||||
emit descriptionEnablementChanged(on);
|
||||
}
|
||||
|
||||
void DiffEditorController::setDescriptionVisible(bool on)
|
||||
{
|
||||
if (m_descriptionVisible == on)
|
||||
return;
|
||||
|
||||
m_descriptionVisible = on;
|
||||
emit descriptionVisibilityChanged(on);
|
||||
}
|
||||
|
||||
void DiffEditorController::setContextLinesNumber(int lines)
|
||||
{
|
||||
const int l = qMax(lines, -1);
|
||||
|
||||
Reference in New Issue
Block a user