Bug 82852

Summary: Highlighting incorrect in resolve dialog
Product: [Applications] cervisia Reporter: Christian Loose <christian.loose>
Component: generalAssignee: Christian Loose <christian.loose>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: bugfix patch

Description Christian Loose 2004-06-04 21:13:45 UTC
Version:           2.1.3 (using KDE KDE 3.2.3)

The highlighting of the conflict in the resolve dialog is incorrect. The complete source code is always highlighted.
Comment 1 Christian Loose 2004-06-04 21:15:05 UTC
CVS commit by cloose:

Fix the highlighting of the conflict source lines: Now the complete version
 isn't marked as changed in the diff views anymore.


  M +13 -12    resolvedlg.cpp   1.24.2.2
  M +4 -4      resolvedlg.h   1.9.2.2


--- kdesdk/cervisia/resolvedlg.cpp  #1.24.2.1:1.24.2.2
@@ -28,5 +28,4 @@
 #include <kmessagebox.h>

-#include "diffview.h"
 #include "misc.h"
 #include "resolvedlg_p.h"
@@ -250,6 +249,6 @@ bool ResolveDialog::parseFile(const QStr
                 else
                 {
-                    addToMergeAndVersionA(line, lineno1);
-                    addToVersionB(line, lineno2);
+                    addToMergeAndVersionA(line, DiffView::Unchanged,
 lineno1); +                    addToVersionB(line, DiffView::Unchanged,
 lineno2); }
                 break;
@@ -260,5 +259,5 @@ bool ResolveDialog::parseFile(const QStr
                     {
                         advanced1++;
-                        addToMergeAndVersionA(line, lineno1);
+                        addToMergeAndVersionA(line, DiffView::Change,
 lineno1); }
                     else
@@ -268,5 +267,5 @@ bool ResolveDialog::parseFile(const QStr
                             line.truncate(separatorPos);
                             advanced1++;
-                            addToMergeAndVersionA(line, lineno1);
+                            addToMergeAndVersionA(line, DiffView::Change,
 lineno1); }
                         state     = VersionB;
@@ -281,5 +280,5 @@ bool ResolveDialog::parseFile(const QStr
                     {
                         advanced2++;
-                        addToVersionB(line, lineno2);
+                        addToVersionB(line, DiffView::Change, lineno2);
                     }
                     else
@@ -289,5 +288,5 @@ bool ResolveDialog::parseFile(const QStr
                             line.truncate(separatorPos);
                             advanced2++;
-                            addToVersionB(line, lineno2);
+                            addToVersionB(line, DiffView::Change, lineno2);
                         }

@@ -322,9 +321,10 @@ bool ResolveDialog::parseFile(const QStr


-void ResolveDialog::addToMergeAndVersionA(const QString& line, int& lineNo)
+void ResolveDialog::addToMergeAndVersionA(const QString& line,
+                                          DiffView::DiffType type, int&
 lineNo) {
     lineNo++;
-    diff1->addLine(line, DiffView::Change, lineNo);
-    merge->addLine(line, DiffView::Change, lineNo);
+    diff1->addLine(line, type, lineNo);
+    merge->addLine(line, type, lineNo);

     m_contentVersionA      += line;
@@ -333,8 +333,9 @@ void ResolveDialog::addToMergeAndVersion


-void ResolveDialog::addToVersionB(const QString& line, int& lineNo)
+void ResolveDialog::addToVersionB(const QString& line, DiffView::DiffType
 type, +                                  int& lineNo)
 {
     lineNo++;
-    diff2->addLine(line, DiffView::Change, lineNo);
+    diff2->addLine(line, type, lineNo);

     m_contentVersionB += line;

--- kdesdk/cervisia/resolvedlg.h  #1.9.2.1:1.9.2.2
@@ -21,8 +21,7 @@

 #include <qptrlist.h>
+#include "diffview.h"


-class DiffView;
-
 class QLabel;
 class QTextCodec;
@@ -64,6 +63,7 @@ private:
     void saveFile(const QString &name);
     QString readFile();
-    void addToMergeAndVersionA(const QString& line, int& lineNo);
-    void addToVersionB(const QString& line, int& lineNo);
+    void addToMergeAndVersionA(const QString& line, DiffView::DiffType type,
+                               int& lineNo);
+    void addToVersionB(const QString& line, DiffView::DiffType type, int&
 lineNo); void updateMergedVersion(ResolveItem* item, ChooseType chosen);

Comment 2 Christian Loose 2004-06-04 21:16:13 UTC
Created attachment 6249 [details]
bugfix patch