summaryrefslogtreecommitdiff
path: root/src/plugins/diffeditor/diffeditorcontroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/diffeditor/diffeditorcontroller.cpp')
-rw-r--r--src/plugins/diffeditor/diffeditorcontroller.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/plugins/diffeditor/diffeditorcontroller.cpp b/src/plugins/diffeditor/diffeditorcontroller.cpp
index 5aeb8d2705..796ff19673 100644
--- a/src/plugins/diffeditor/diffeditorcontroller.cpp
+++ b/src/plugins/diffeditor/diffeditorcontroller.cpp
@@ -48,6 +48,7 @@ DiffEditorController::DiffEditorController(QObject *parent)
m_chunkIndex(-1),
m_descriptionEnabled(false),
m_contextLinesNumber(3),
+ m_contextLinesNumberEnabled(true),
m_ignoreWhitespace(true),
m_reloader(0)
{
@@ -97,6 +98,11 @@ int DiffEditorController::contextLinesNumber() const
return m_contextLinesNumber;
}
+bool DiffEditorController::isContextLinesNumberEnabled() const
+{
+ return m_contextLinesNumberEnabled;
+}
+
bool DiffEditorController::isIgnoreWhitespace() const
{
return m_ignoreWhitespace;
@@ -150,7 +156,7 @@ void DiffEditorController::setReloader(DiffEditorReloader *reloader)
if (m_reloader)
m_reloader->setController(this);
- emit reloaderChanged(m_reloader);
+ emit reloaderChanged();
}
void DiffEditorController::clear()
@@ -180,10 +186,6 @@ void DiffEditorController::setDescription(const QString &description)
return;
m_description = description;
- // Empty line before headers and commit message
- const int emptyLine = m_description.indexOf(QLatin1String("\n\n"));
- if (emptyLine != -1)
- m_description.insert(emptyLine, QLatin1Char('\n') + QLatin1String(Constants::EXPAND_BRANCHES));
emit descriptionChanged(m_description);
}
@@ -250,6 +252,15 @@ void DiffEditorController::setContextLinesNumber(int lines)
emit contextLinesNumberChanged(l);
}
+void DiffEditorController::setContextLinesNumberEnabled(bool on)
+{
+ if (m_contextLinesNumberEnabled == on)
+ return;
+
+ m_contextLinesNumberEnabled = on;
+ emit contextLinesNumberEnablementChanged(on);
+}
+
void DiffEditorController::setIgnoreWhitespace(bool ignore)
{
if (m_ignoreWhitespace == ignore)