summaryrefslogtreecommitdiff
path: root/src/plugins/diffeditor/diffutils.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-01-30 16:59:25 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-03-10 10:25:52 +0000
commitb2b8b867d68e95e9421a15549c1a7bb83949186d (patch)
tree5acf5ac984dae16bb7404cfd6a85910f1ae76f0a /src/plugins/diffeditor/diffutils.cpp
parent59640aa7aaf1220a2739de021203f14834fc12b9 (diff)
downloadqt-creator-b2b8b867d68e95e9421a15549c1a7bb83949186d.tar.gz
DiffEditor: Refactor the user-facing parts
* Move all data handling into DiffEditorDocument * Move much of the logic of how to update views into the DiffEditor. * Introduce a base class for the different views on the diff to implement. * Remove DiffEditorGuiController * Make DiffEditorController smaller and merge the DiffEditorReloader into the class * Simplify communication between the classes involved * Make much of the implementation private to the plugin Change-Id: I7ccb9df6061923bcb34cf3090d6d8331895e83c7 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Diffstat (limited to 'src/plugins/diffeditor/diffutils.cpp')
-rw-r--r--src/plugins/diffeditor/diffutils.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp
index d464e230b0..0e16becbdf 100644
--- a/src/plugins/diffeditor/diffutils.cpp
+++ b/src/plugins/diffeditor/diffutils.cpp
@@ -263,11 +263,10 @@ ChunkData DiffUtils::calculateOriginalData(const QList<Diff> &leftDiffList,
return chunkData;
}
-FileData DiffUtils::calculateContextData(const ChunkData &originalData,
- int contextLinesNumber,
+FileData DiffUtils::calculateContextData(const ChunkData &originalData, int contextLineCount,
int joinChunkThreshold)
{
- if (contextLinesNumber < 0)
+ if (contextLineCount < 0)
return FileData(originalData);
FileData fileData;
@@ -292,9 +291,9 @@ FileData DiffUtils::calculateContextData(const ChunkData &originalData,
const bool last = i == originalData.rows.count(); // includes last line?
const int firstLine = first
- ? 0 : equalRowStart + contextLinesNumber;
+ ? 0 : equalRowStart + contextLineCount;
const int lastLine = last
- ? originalData.rows.count() : i - contextLinesNumber;
+ ? originalData.rows.count() : i - contextLineCount;
if (firstLine < lastLine - joinChunkThreshold) {
for (int j = firstLine; j < lastLine; j++) {