# # # patch "guitone/src/model/GetFile.cpp" # from [f9190876d9095f73a4204d1579515025a743de4f] # to [0ffd7d839d5e776eb81bed68eff1c68defa0f255] # # patch "guitone/src/model/GetFile.h" # from [2d7fb807f93d2ac2ea5c3be5a72ee5e022da8271] # to [bf0ecab6e9fe33f315fc9c1ae615761c6a6e931b] # ============================================================ --- guitone/src/model/GetFile.cpp f9190876d9095f73a4204d1579515025a743de4f +++ guitone/src/model/GetFile.cpp 0ffd7d839d5e776eb81bed68eff1c68defa0f255 @@ -94,11 +94,9 @@ void GetFile::parseOutput(AutomateComman // skip the last line since this contains a newline from automate for (int i=0, s=lines.size() - 1; istate == DiffLine::Removed) { fileContents.value(lineStart-1)->marker = ContentLine::Removed; - // lower the linecount for all following lines - for (int x = lineStart, y=fileContents.size(); xnumber -= 1; - } lineStart++; continue; } Q_ASSERT(line->state == DiffLine::Added); - int lastNum = fileContents.at(lineStart)->number; fileContents.insert( lineStart - 1, - new ContentLine( - line->content, - ContentLine::Added, - lastNum - ) + new ContentLine(line->content, ContentLine::Added) ); - // raise the linecount for all following lines - for (int x = lineStart, y=fileContents.size(); xnumber += 1; - } lineOffset++; lineStart++; } @@ -186,7 +169,7 @@ QVariant GetFile::data(const QModelIndex { switch (index.column()) { - case 0: return QVariant(line->number); + case 0: return QVariant(row + 1); case 1: return QVariant(line->content); default: Q_ASSERT(false); } ============================================================ --- guitone/src/model/GetFile.h 2d7fb807f93d2ac2ea5c3be5a72ee5e022da8271 +++ guitone/src/model/GetFile.h bf0ecab6e9fe33f315fc9c1ae615761c6a6e931b @@ -29,9 +29,8 @@ struct ContentLine { struct ContentLine { QString content; enum Marker {Unchanged, Added, Removed} marker; - int number; ContentLine() {} - ContentLine(QString c, Marker m, int n) : content(c), marker(m), number(n) {} + ContentLine(QString c, Marker m) : content(c), marker(m) {} }; typedef QVector Content;