diff options
author | jkobus <jaroslaw.kobus@digia.com> | 2014-02-24 11:10:17 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@digia.com> | 2014-02-24 11:43:25 +0100 |
commit | 52e166c5ae6f36eb53404e03a566bc04d07a0310 (patch) | |
tree | ecaf30bbbd7925071203e49287564015c1fac4cd /src/plugins/diffeditor/diffeditorcontroller.cpp | |
parent | 167206f8fb5d6617b353c85f2b080bcb4c87f108 (diff) | |
download | qt-creator-52e166c5ae6f36eb53404e03a566bc04d07a0310.tar.gz |
Move Gui stuff out of DiffEditorController
Place it in DiffEditorGuiController, will be needed for
sharing gui settings between unified and sidebyside versions.
Change-Id: I8a858d0549ff84e21f7c909288ca07c5a2ef4e5b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src/plugins/diffeditor/diffeditorcontroller.cpp')
-rw-r--r-- | src/plugins/diffeditor/diffeditorcontroller.cpp | 85 |
1 files changed, 1 insertions, 84 deletions
diff --git a/src/plugins/diffeditor/diffeditorcontroller.cpp b/src/plugins/diffeditor/diffeditorcontroller.cpp index b382efbdd2..fae78efbcb 100644 --- a/src/plugins/diffeditor/diffeditorcontroller.cpp +++ b/src/plugins/diffeditor/diffeditorcontroller.cpp @@ -33,12 +33,7 @@ namespace DiffEditor { DiffEditorController::DiffEditorController(QObject *parent) : QObject(parent), - m_descriptionEnabled(false), - m_descriptionVisible(true), - m_contextLinesNumber(3), - m_ignoreWhitespaces(true), - m_syncScrollBars(true), - m_currentDiffFileIndex(-1) + m_descriptionEnabled(false) { clear(); } @@ -73,31 +68,6 @@ bool DiffEditorController::isDescriptionEnabled() const return m_descriptionEnabled; } -bool DiffEditorController::isDescriptionVisible() const -{ - return m_descriptionVisible; -} - -int DiffEditorController::contextLinesNumber() const -{ - return m_contextLinesNumber; -} - -bool DiffEditorController::isIgnoreWhitespaces() const -{ - return m_ignoreWhitespaces; -} - -bool DiffEditorController::horizontalScrollBarSynchronization() const -{ - return m_syncScrollBars; -} - -int DiffEditorController::currentDiffFileIndex() const -{ - return m_currentDiffFileIndex; -} - void DiffEditorController::clear() { clear(tr("No difference")); @@ -106,7 +76,6 @@ void DiffEditorController::clear() void DiffEditorController::clear(const QString &message) { m_clearMessage = message; - m_currentDiffFileIndex = -1; emit cleared(message); } @@ -115,7 +84,6 @@ void DiffEditorController::setDiffContents(const QList<DiffFilesContents> &diffF { m_diffFileList = diffFileList; m_workingDirectory = workingDirectory; - m_currentDiffFileIndex = (diffFileList.isEmpty() ? -1 : 0); emit diffContentsChanged(diffFileList, workingDirectory); } @@ -137,55 +105,4 @@ void DiffEditorController::setDescriptionEnabled(bool 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); - if (m_contextLinesNumber == l) - return; - - m_contextLinesNumber = l; - emit contextLinesNumberChanged(l); -} - -void DiffEditorController::setIgnoreWhitespaces(bool ignore) -{ - if (m_ignoreWhitespaces == ignore) - return; - - m_ignoreWhitespaces = ignore; - emit ignoreWhitespacesChanged(ignore); -} - -void DiffEditorController::setHorizontalScrollBarSynchronization(bool on) -{ - if (m_syncScrollBars == on) - return; - - m_syncScrollBars = on; - emit horizontalScrollBarSynchronizationChanged(on); -} - -void DiffEditorController::setCurrentDiffFileIndex(int diffFileIndex) -{ - if (!m_diffFileList.count()) - return; // -1 is the only valid value in this case - - const int newIndex = qBound(0, diffFileIndex, m_diffFileList.count() - 1); - - if (m_currentDiffFileIndex == newIndex) - return; - - m_currentDiffFileIndex = newIndex; - emit currentDiffFileIndexChanged(newIndex); -} - } // namespace DiffEditor |