1 | /* |
2 | This file is part of libkdepim. |
3 | |
4 | Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> |
5 | |
6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. |
10 | |
11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. |
15 | |
16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 | Boston, MA 02110-1301, USA. |
20 | */ |
21 | |
22 | #include "diffalgo.h" |
23 | #include <QList> |
24 | #include <string.h> |
25 | |
26 | using namespace KPIM; |
27 | |
28 | void DiffAlgo::begin() |
29 | { |
30 | QList<DiffAlgoDisplay*>::Iterator it; |
31 | for ( it = mDisplays.begin(); it != mDisplays.end(); ++it ) |
32 | (*it)->begin(); |
33 | } |
34 | |
35 | void DiffAlgo::end() |
36 | { |
37 | QList<DiffAlgoDisplay*>::Iterator it; |
38 | for ( it = mDisplays.begin(); it != mDisplays.end(); ++it ) |
39 | (*it)->end(); |
40 | } |
41 | |
42 | void DiffAlgo::setLeftSourceTitle( const QString &title ) |
43 | { |
44 | QList<DiffAlgoDisplay*>::Iterator it; |
45 | for ( it = mDisplays.begin(); it != mDisplays.end(); ++it ) |
46 | (*it)->setLeftSourceTitle( title ); |
47 | } |
48 | |
49 | void DiffAlgo::setRightSourceTitle( const QString &title ) |
50 | { |
51 | QList<DiffAlgoDisplay*>::Iterator it; |
52 | for ( it = mDisplays.begin(); it != mDisplays.end(); ++it ) |
53 | (*it)->setRightSourceTitle( title ); |
54 | } |
55 | |
56 | void DiffAlgo::additionalLeftField( const QString &id, const QString &value ) |
57 | { |
58 | QList<DiffAlgoDisplay*>::Iterator it; |
59 | for ( it = mDisplays.begin(); it != mDisplays.end(); ++it ) |
60 | (*it)->additionalLeftField( id, value ); |
61 | } |
62 | |
63 | void DiffAlgo::additionalRightField( const QString &id, const QString &value ) |
64 | { |
65 | QList<DiffAlgoDisplay*>::Iterator it; |
66 | for ( it = mDisplays.begin(); it != mDisplays.end(); ++it ) |
67 | (*it)->additionalRightField( id, value ); |
68 | } |
69 | |
70 | void DiffAlgo::conflictField( const QString &id, const QString &leftValue, |
71 | const QString &rightValue ) |
72 | { |
73 | QList<DiffAlgoDisplay*>::Iterator it; |
74 | for ( it = mDisplays.begin(); it != mDisplays.end(); ++it ) |
75 | (*it)->conflictField( id, leftValue, rightValue ); |
76 | } |
77 | |
78 | void DiffAlgo::addDisplay( DiffAlgoDisplay *display ) |
79 | { |
80 | if ( !mDisplays.contains( display ) ) |
81 | mDisplays.append( display ); |
82 | } |
83 | |
84 | void DiffAlgo::removeDisplay( DiffAlgoDisplay *display ) |
85 | { |
86 | mDisplays.removeAll( display ); |
87 | } |
88 | |