summaryrefslogtreecommitdiff
path: root/src/plugins/diffeditor/diffeditorcontroller.cpp
diff options
context:
space:
mode:
authorjkobus <jaroslaw.kobus@digia.com>2014-11-06 13:23:40 +0100
committerJarek Kobus <jaroslaw.kobus@theqtcompany.com>2014-11-21 10:08:36 +0100
commit8d1940a7964a27c32f3a1f8f637f28511f6360a6 (patch)
tree9427537dec87ca246abb4832f71f338fb95682b0 /src/plugins/diffeditor/diffeditorcontroller.cpp
parent07e3a032ff04ab1af665819baf267bcc80463d0b (diff)
downloadqt-creator-8d1940a7964a27c32f3a1f8f637f28511f6360a6.tar.gz
Replace old svn diff editor with the new one
Change-Id: I4137b709be718603cdc221ac938e139326c88835 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
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)