File indexing completed on 2024-04-28 05:43:53

0001 /*
0002     SPDX-FileCopyrightText: 2001-2004,2009 Otto Bruggeman <bruggie@gmail.com>
0003     SPDX-FileCopyrightText: 2001-2003 John Firebaugh <jfirebaugh@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef KOMPAREDIFF2_DIFFERENCE_P_H
0009 #define KOMPAREDIFF2_DIFFERENCE_P_H
0010 
0011 // lib
0012 #include "differencestring.h"
0013 
0014 namespace KompareDiff2
0015 {
0016 
0017 class DifferencePrivate
0018 {
0019 public:
0020     DifferencePrivate(int sourceLineNo, int destinationLineNo, int type);
0021     ~DifferencePrivate();
0022 
0023 public:
0024     int type;
0025 
0026     int sourceLineNo;
0027     int destinationLineNo;
0028     int trackingDestinationLineNo;
0029 
0030     DifferenceStringList sourceLines;
0031     DifferenceStringList destinationLines;
0032 
0033     bool applied = false;
0034     bool conflicts = false;
0035     bool unsaved = false;
0036 };
0037 
0038 DifferencePrivate::DifferencePrivate(int sourceLineNo, int destinationLineNo, int type)
0039     : type(type)
0040     , sourceLineNo(sourceLineNo)
0041     , destinationLineNo(destinationLineNo)
0042     , trackingDestinationLineNo(sourceLineNo) // The whole patch starts as unapplied
0043 {
0044 }
0045 
0046 DifferencePrivate::~DifferencePrivate()
0047 {
0048     qDeleteAll(sourceLines);
0049     qDeleteAll(destinationLines);
0050 }
0051 
0052 }
0053 
0054 #endif