summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile619
-rw-r--r--kabc/addressbook.cpp26
-rw-r--r--kabc/addressee.cpp25
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp4
-rw-r--r--kaddressbook/kabcore.cpp25
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--libkdepim/ksyncmanager.cpp4
7 files changed, 301 insertions, 403 deletions
diff --git a/Makefile b/Makefile
index 467710f..e6f955c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,368 +1,253 @@
1export KDEPIMDIR = $(shell pwd) 1#############################################################################
2 2# Makefile for building: kdepim-desktop
3export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) 3# Generated by qmake (1.07a) (Qt 3.3.1) on: Thu Oct 28 23:52:22 2004
4 4# Project: kdepim-desktop.pro
5ifeq ($(PLATFORM) , zaurus) 5# Template: subdirs
6 BUILD_NO_LDAP_PLUGIN=1 6# Command: $(QMAKE) -o Makefile kdepim-desktop.pro
7endif 7#############################################################################
8 8
9ifneq ($(PLATFORM) , zaurus) 9 MAKEFILE =Makefile
10 BUILD_NO_SHARP_PLUGIN=1 10 QMAKE =qmake
11endif 11DEL_FILE = rm -f
12 12CHK_DIR_EXISTS= test -d
13#opie plugin is deprecated. The qtopia plugin handles the task from now on. 13MKDIR = mkdir -p
14BUILD_NO_OPIE_PLUGIN=1 14 SUBTARGETS = \
15 15 sub-gammu-emb-common \
16SUBDIRS_MICROKDE = \ 16 sub-gammu-emb-gammu \
17 libical/src/libical \ 17 sub-libical \
18 libical/src/libicalss \ 18 sub-libkcal \
19 qtcompat \ 19 sub-microkde \
20 microkde \ 20 sub-libkdepim \
21 libkcal \ 21 sub-kabc \
22 libkdepim \ 22 sub-korganizer \
23 kabc \ 23 sub-kaddressbook \
24 kabc/formats/binary \ 24 sub-kabc-plugins-file \
25 kabc/plugins/file \ 25 sub-kabc-plugins-dir \
26 kabc/plugins/dir \ 26 sub-kabc-plugins-file \
27 korganizer \ 27 sub-kabc-plugins-qtopia \
28 kalarmd \ 28 sub-pwmanager-libcrypt-cipher \
29 kaddressbook 29 sub-pwmanager-libcrypt-error \
30 30 sub-pwmanager-libcrypt-mpi \
31SUBDIRS_QTOPIA_PLUGIN = \ 31 sub-pwmanager-libcrypt-zlib \
32 kabc/plugins/qtopia 32 sub-pwmanager-pwmanager
33 33
34SUBDIRS_OPIE_PLUGIN = \ 34first: all
35 kabc/plugins/opie 35
36 36all: Makefile $(SUBTARGETS)
37SUBDIRS_SHARP_PLUGIN = \ 37
38 kabc/plugins/sharpdtm 38gammu/emb/common/$(MAKEFILE):
39 39 @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common"
40SUBDIRS_LDAP_PLUGIN = \ 40 cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE)
41 kabc/plugins/ldap 41sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE
42 42 cd gammu/emb/common && $(MAKE) -f $(MAKEFILE)
43SUBDIRS_MICROMAIL = \ 43
44 kmicromail/libetpan \ 44gammu/emb/gammu/$(MAKEFILE):
45 kmicromail/libmailwrapper \ 45 @$(CHK_DIR_EXISTS) "gammu/emb/gammu" || $(MKDIR) "gammu/emb/gammu"
46 kmicromail 46 cd gammu/emb/gammu && $(QMAKE) gammu.pro -o $(MAKEFILE)
47 47sub-gammu-emb-gammu: gammu/emb/gammu/$(MAKEFILE) FORCE
48SUBDIRS_GAMMU = \ 48 cd gammu/emb/gammu && $(MAKE) -f $(MAKEFILE)
49 gammu/emb/common \ 49
50 gammu/emb/gammu 50libical/$(MAKEFILE):
51 51 @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical"
52SUBDIRS_PWMANAGER = \ 52 cd libical && $(QMAKE) libical.pro -o $(MAKEFILE)
53 pwmanager/libcrypt/mpi \ 53sub-libical: libical/$(MAKEFILE) FORCE
54 pwmanager/libcrypt/error \ 54 cd libical && $(MAKE) -f $(MAKEFILE)
55 pwmanager/libcrypt/cipher \ 55
56 pwmanager/libcrypt/zlib \ 56libkcal/$(MAKEFILE):
57 pwmanager/pwmanager 57 @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal"
58 58 cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE)
59SUBDIRS = \ 59sub-libkcal: libkcal/$(MAKEFILE) FORCE
60 $(SUBDIRS_MICROKDE) \ 60 cd libkcal && $(MAKE) -f $(MAKEFILE)
61 $(SUBDIRS_QTOPIA_PLUGIN) \ 61
62 $(SUBDIRS_OPIE_PLUGIN) \ 62microkde/$(MAKEFILE):
63 $(SUBDIRS_SHARP_PLUGIN) \ 63 @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde"
64 $(SUBDIRS_LDAP_PLUGIN) \ 64 cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE)
65 $(SUBDIRS_MICROMAIL) \ 65sub-microkde: microkde/$(MAKEFILE) FORCE
66 $(SUBDIRS_GAMMU) \ 66 cd microkde && $(MAKE) -f $(MAKEFILE)
67 $(SUBDIRS_PWMANAGER) 67
68 68libkdepim/$(MAKEFILE):
69 69 @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim"
70all: build_microkde \ 70 cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE)
71 build_qtopia_plugin \ 71sub-libkdepim: libkdepim/$(MAKEFILE) FORCE
72 build_opie_plugin \ 72 cd libkdepim && $(MAKE) -f $(MAKEFILE)
73 build_sharp_plugin \ 73
74 build_ldap_plugin \ 74kabc/$(MAKEFILE):
75 build_micromail \ 75 @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc"
76 build_gammu \ 76 cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE)
77 build_pwmanager 77sub-kabc: kabc/$(MAKEFILE) FORCE
78 78 cd kabc && $(MAKE) -f $(MAKEFILE)
79 79
80build_microkde: variable_test tmake 80korganizer/$(MAKEFILE):
81 for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ 81 @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer"
82 make -f Makefile$(PLATFORM) || exit 1; popd; \ 82 cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE)
83 done 83sub-korganizer: korganizer/$(MAKEFILE) FORCE
84 84 cd korganizer && $(MAKE) -f $(MAKEFILE)
85build_qtopia_plugin: build_microkde 85
86 ifdef BUILD_NO_QTOPIA_PLUGIN 86kaddressbook/$(MAKEFILE):
87 @echo == qtopia plugin not build. 87 @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook"
88 else 88 cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE)
89 for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ 89sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE
90 make -f Makefile$(PLATFORM) || exit 1; popd; \ 90 cd kaddressbook && $(MAKE) -f $(MAKEFILE)
91 done 91
92 endif 92kabc/plugins/file/$(MAKEFILE):
93 93 @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file"
94build_opie_plugin: build_microkde 94 cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE)
95 ifdef BUILD_NO_OPIE_PLUGIN 95sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE
96 @echo == opie plugin not build. 96 cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE)
97 else 97
98 for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ 98kabc/plugins/dir/$(MAKEFILE):
99 make -f Makefile$(PLATFORM) || exit 1; popd; \ 99 @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir"
100 done 100 cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE)
101 endif 101sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE
102 102 cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE)
103build_sharp_plugin: build_microkde 103
104 ifdef BUILD_NO_SHARP_PLUGIN 104kabc/plugins/file/$(MAKEFILE):
105 @echo == ldap plugin not build. 105 @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file"
106 else 106 cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE)
107 for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ 107sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE
108 make -f Makefile$(PLATFORM) || exit 1; popd; \ 108 cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE)
109 done 109
110 endif 110kabc/plugins/qtopia/$(MAKEFILE):
111 111 @$(CHK_DIR_EXISTS) "kabc/plugins/qtopia" || $(MKDIR) "kabc/plugins/qtopia"
112build_ldap_plugin: build_microkde 112 cd kabc/plugins/qtopia && $(QMAKE) qtopia.pro -o $(MAKEFILE)
113 ifdef BUILD_NO_LDAP_PLUGIN 113sub-kabc-plugins-qtopia: kabc/plugins/qtopia/$(MAKEFILE) FORCE
114 @echo == ldap plugin not build. 114 cd kabc/plugins/qtopia && $(MAKE) -f $(MAKEFILE)
115 else 115
116 for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ 116pwmanager/libcrypt/cipher/$(MAKEFILE):
117 make -f Makefile$(PLATFORM) || exit 1; popd; \ 117 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/cipher" || $(MKDIR) "pwmanager/libcrypt/cipher"
118 done 118 cd pwmanager/libcrypt/cipher && $(QMAKE) cipher.pro -o $(MAKEFILE)
119 endif 119sub-pwmanager-libcrypt-cipher: pwmanager/libcrypt/cipher/$(MAKEFILE) FORCE
120 120 cd pwmanager/libcrypt/cipher && $(MAKE) -f $(MAKEFILE)
121 121
122build_micromail: build_microkde 122pwmanager/libcrypt/error/$(MAKEFILE):
123 ifdef BUILD_NO_MICROMAIL 123 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/error" || $(MKDIR) "pwmanager/libcrypt/error"
124 @echo == kmicromail not build. 124 cd pwmanager/libcrypt/error && $(QMAKE) error.pro -o $(MAKEFILE)
125 else 125sub-pwmanager-libcrypt-error: pwmanager/libcrypt/error/$(MAKEFILE) FORCE
126 for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ 126 cd pwmanager/libcrypt/error && $(MAKE) -f $(MAKEFILE)
127 make -f Makefile$(PLATFORM) || exit 1; popd; \ 127
128 done 128pwmanager/libcrypt/mpi/$(MAKEFILE):
129 endif 129 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/mpi" || $(MKDIR) "pwmanager/libcrypt/mpi"
130 130 cd pwmanager/libcrypt/mpi && $(QMAKE) mpi.pro -o $(MAKEFILE)
131build_gammu: variable_test tmake 131sub-pwmanager-libcrypt-mpi: pwmanager/libcrypt/mpi/$(MAKEFILE) FORCE
132 ifdef BUILD_NO_GAMMU 132 cd pwmanager/libcrypt/mpi && $(MAKE) -f $(MAKEFILE)
133 @echo == gammu not build. 133
134 else 134pwmanager/libcrypt/zlib/$(MAKEFILE):
135 for i in $(SUBDIRS_GAMMU); do pushd $$i; \ 135 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/zlib" || $(MKDIR) "pwmanager/libcrypt/zlib"
136 make -f Makefile$(PLATFORM) || exit 1; popd; \ 136 cd pwmanager/libcrypt/zlib && $(QMAKE) zlib.pro -o $(MAKEFILE)
137 done 137sub-pwmanager-libcrypt-zlib: pwmanager/libcrypt/zlib/$(MAKEFILE) FORCE
138 endif 138 cd pwmanager/libcrypt/zlib && $(MAKE) -f $(MAKEFILE)
139 139
140build_pwmanager: build_microkde 140pwmanager/pwmanager/$(MAKEFILE):
141 ifdef BUILD_NO_PWMANAGER 141 @$(CHK_DIR_EXISTS) "pwmanager/pwmanager" || $(MKDIR) "pwmanager/pwmanager"
142 @echo == pwmanager not build. 142 cd pwmanager/pwmanager && $(QMAKE) pwmanager.pro -o $(MAKEFILE)
143 else 143sub-pwmanager-pwmanager: pwmanager/pwmanager/$(MAKEFILE) FORCE
144 for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ 144 cd pwmanager/pwmanager && $(MAKE) -f $(MAKEFILE)
145 make -f Makefile$(PLATFORM) || exit 1; popd; \ 145
146 done 146Makefile: kdepim-desktop.pro /usr/lib/qt3/mkspecs/default/qmake.conf
147 endif 147 $(QMAKE) -o Makefile kdepim-desktop.pro
148 148qmake: qmake_all
149 149 @$(QMAKE) -o Makefile kdepim-desktop.pro
150variable_info: 150
151 @echo -------------------------------------- 151all: $(SUBTARGETS)
152 @echo KDEPIM buildsystem, variableinfo... 152qmake_all: gammu/emb/common/$(MAKEFILE) gammu/emb/gammu/$(MAKEFILE) libical/$(MAKEFILE) libkcal/$(MAKEFILE) microkde/$(MAKEFILE) libkdepim/$(MAKEFILE) kabc/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/qtopia/$(MAKEFILE) pwmanager/libcrypt/cipher/$(MAKEFILE) pwmanager/libcrypt/error/$(MAKEFILE) pwmanager/libcrypt/mpi/$(MAKEFILE) pwmanager/libcrypt/zlib/$(MAKEFILE) pwmanager/pwmanager/$(MAKEFILE)
153 @echo KDEPIMDIR=$(KDEPIMDIR) 153 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
154 @echo QTDIR=$(QTDIR) 154 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
155 @echo QPEDIR=$(QPEDIR) 155 ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
156 @echo OPIEDIR=$(OPIEDIR) 156 ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
157 @echo PLATFORM=$(PLATFORM) 157 ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
158 @echo RELEASE_DEBUG=$(RELEASE_DEBUG) 158 ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
159 @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) 159 ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
160 @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) 160 ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
161 @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) 161 ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
162 @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) 162 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
163 @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) 163 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
164 ifndef BUILD_NO_SHARP_PLUGIN 164 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
165 @echo SHARPDTMSDK=$(SHARPDTMSDK) 165 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
166 endif 166 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
167 @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) 167 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
168 @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) 168 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
169 @echo -------------------------------------- 169 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
170 170 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
171variable_test: variable_info 171clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE
172 @echo KDEPIM buildsystem, variablecheck... 172 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true
173 ifndef KDEPIMDIR 173 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; ) || true
174 @echo KDEPIMDIR is not defined. 174 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true
175 $(error KDEPIMDIR is not defined) 175 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true
176 endif 176 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true
177 ifndef PLATFORM 177 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true
178 @echo PLATFORM is not defined. 178 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true
179 $(error PLATFORM is not defined) 179 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true
180 endif 180 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true
181 ifdef BUILD_NO_LDAP_PLUGIN 181 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true
182 @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) 182 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true
183 endif 183 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true
184 ifdef BUILD_NO_OPIE_PLUGIN 184 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; ) || true
185 @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) 185 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; ) || true
186 endif 186 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; ) || true
187 ifdef BUILD_NO_QTOPIA_PLUGIN 187 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; ) || true
188 @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) 188 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; ) || true
189 endif 189 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; ) || true
190 ifdef BUILD_NO_MICROMAIL 190uninstall_subdirs: qmake_all FORCE
191 @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) 191 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
192 endif 192 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
193 ifdef BUILD_NO_SHARP_PLUGIN 193 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
194 @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) 194 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
195 else 195 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
196 ifndef SHARPDTMSDK 196 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
197 @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) 197 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
198 $(error SHARPDTMSDK is not defined) 198 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
199 endif 199 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
200 endif 200 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
201 ifdef BUILD_NO_GAMMU 201 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
202 @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) 202 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
203 endif 203 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
204 ifdef BUILD_NO_PWMANAGER 204 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
205 @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) 205 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
206 endif 206 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
207 @echo -------------------------------------- 207 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
208 208 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
209 209install_subdirs: qmake_all FORCE
210objects: 210 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true
211 for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done 211 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) install; ) || true
212 for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done 212 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true
213 mkdir -p libical/lib/$(PLATFORM) 213 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true
214 mkdir -p pwmanager/libcrypt/$(PLATFORM) 214 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true
215 215 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true
216clean: 216 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true
217 rm -rf libical/lib/$(PLATFORM)/*; 217 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true
218 rm -rf pwmanager/libcrypt/$(PLATFORM)/*; 218 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true
219 for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ 219 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true
220 rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ 220 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true
221 done 221 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true
222 222 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) install; ) || true
223install: 223 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) install; ) || true
224 224 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) install; ) || true
225 cd bin/kdepim; make install 225 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) install; ) || true
226 cp -r Pim $(QPEDIR)/apps 226 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) install; ) || true
227 cp db2file/db2file $(QPEDIR)/bin/db2file 227 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) install; ) || true
228 cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop 228distclean: qmake_all FORCE
229 cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop 229 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
230 cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop 230 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
231 cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop 231 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
232 232 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
233dist: 233 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
234 @echo Dont forget to do "make install" before "make dist" 234 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
235 rm -f *arm.ipk 235 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
236 rm -f *~ 236 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
237 cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim 237 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
238 mkipks kmicrokdelibs.control 238 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
239 mkipks korganizer.control 239 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
240 mkipks kaddressbook.control 240 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
241 ifndef BUILD_NO_MICROMAIL 241 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
242 mkipks kopiemail.control 242 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
243 endif 243 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
244 ifndef BUILD_NO_SHARP_PLUGIN 244 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
245 mkipks ksharpPIM-DTMaccess.control 245 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
246 endif 246 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
247 mkipks korganizer-alarm.control 247
248 ifndef BUILD_NO_GAMMU 248install: install_subdirs
249 mkipks kmobilephoneaccess.control 249
250 endif 250uninstall: uninstall_subdirs
251 ifndef BUILD_NO_PWMANAGER 251
252 mkipks pwmanager.control 252FORCE:
253 endif
254 mkipks pimTABicon.control
255
256tmake: objects \
257 qtcompat/Makefile$(PLATFORM) \
258 microkde/Makefile$(PLATFORM) \
259 libkcal/Makefile$(PLATFORM) \
260 libkdepim/Makefile$(PLATFORM) \
261 korganizer/Makefile$(PLATFORM) \
262 kalarmd/Makefile$(PLATFORM) \
263 libical/src/libical/Makefile$(PLATFORM) \
264 libical/src/libicalss/Makefile$(PLATFORM) \
265 kabc/Makefile$(PLATFORM) \
266 kabc/formats/binary/Makefile$(PLATFORM) \
267 kabc/plugins/file/Makefile$(PLATFORM) \
268 kabc/plugins/dir/Makefile$(PLATFORM) \
269 kabc/plugins/ldap/Makefile$(PLATFORM) \
270 kabc/plugins/opie/Makefile$(PLATFORM) \
271 kabc/plugins/qtopia/Makefile$(PLATFORM) \
272 kabc/plugins/sharpdtm/Makefile$(PLATFORM) \
273 kaddressbook/Makefile$(PLATFORM) \
274 kmicromail/Makefile$(PLATFORM) \
275 kmicromail/libetpan/Makefile$(PLATFORM) \
276 kmicromail/libmailwrapper/Makefile$(PLATFORM) \
277 gammu/emb/common/Makefile$(PLATFORM) \
278 gammu/emb/gammu/Makefile$(PLATFORM) \
279 pwmanager/pwmanager/Makefile$(PLATFORM) \
280 pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \
281 pwmanager/libcrypt/error/Makefile$(PLATFORM) \
282 pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \
283 pwmanager/libcrypt/zlib/Makefile$(PLATFORM)
284
285qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
286 cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM)
287
288microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
289 cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM)
290
291libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro
292 cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM)
293
294
295libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro
296 cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM)
297
298kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro
299 cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM)
300
301korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro
302 cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM)
303
304libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
305 cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM)
306
307libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro
308 cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM)
309
310kabc/Makefile$(PLATFORM): kabc/kabcE.pro
311 cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM)
312
313kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
314 cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
315
316kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro
317 cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM)
318
319kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro
320 cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM)
321
322kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro
323 cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM)
324
325kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro
326 cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM)
327
328kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro
329 cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM)
330
331kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro
332 cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM)
333
334kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro
335 cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM)
336
337kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro
338 cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM)
339
340kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro
341 cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM)
342
343kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro
344 cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM)
345
346gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro
347 cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM)
348
349gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro
350 cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM)
351
352pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro
353 cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM)
354
355
356pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro
357 cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM)
358
359pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro
360 cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM)
361
362pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro
363 cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM)
364
365pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro
366 cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM)
367
368 253
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 6194d6d..4c4ae09 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -541,49 +541,48 @@ void AddressBook::removeUntagged()
541 } 541 }
542 if ( todelete ) 542 if ( todelete )
543 removeAddressee( todel ); 543 removeAddressee( todel );
544 deleteRemovedAddressees(); 544 deleteRemovedAddressees();
545} 545}
546void AddressBook::smplifyAddressees() 546void AddressBook::smplifyAddressees()
547{ 547{
548 Iterator ait; 548 Iterator ait;
549 for ( ait = begin(); ait != end(); ++ait ) { 549 for ( ait = begin(); ait != end(); ++ait ) {
550 (*ait).simplifyEmails(); 550 (*ait).simplifyEmails();
551 (*ait).simplifyPhoneNumbers(); 551 (*ait).simplifyPhoneNumbers();
552 (*ait).simplifyPhoneNumberTypes(); 552 (*ait).simplifyPhoneNumberTypes();
553 (*ait).simplifyAddresses(); 553 (*ait).simplifyAddresses();
554 } 554 }
555} 555}
556void AddressBook::removeSyncInfo( QString syncProfile) 556void AddressBook::removeSyncInfo( QString syncProfile)
557{ 557{
558 Iterator ait; 558 Iterator ait;
559 for ( ait = begin(); ait != end(); ++ait ) { 559 for ( ait = begin(); ait != end(); ++ait ) {
560 (*ait).removeID( syncProfile ); 560 (*ait).removeID( syncProfile );
561 } 561 }
562 if ( syncProfile.isEmpty() ) { 562 if ( syncProfile.isEmpty() ) {
563 Iterator it = begin(); 563 Iterator it = begin();
564 Iterator it2 ; 564 Iterator it2 ;
565 QDateTime dt ( QDate( 2004,1,1) );
566 while ( it != end() ) { 565 while ( it != end() ) {
567 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) { 566 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) {
568 it2 = it; 567 it2 = it;
569 //qDebug("removing %s ",(*it).uid().latin1() ); 568 //qDebug("removing %s ",(*it).uid().latin1() );
570 ++it; 569 ++it;
571 removeAddressee( it2 ); 570 removeAddressee( it2 );
572 } else { 571 } else {
573 //qDebug("skipping %s ",(*it).uid().latin1() ); 572 //qDebug("skipping %s ",(*it).uid().latin1() );
574 ++it; 573 ++it;
575 } 574 }
576 } 575 }
577 } else { 576 } else {
578 Addressee lse; 577 Addressee lse;
579 lse = findByUid( "last-syncAddressee-"+ syncProfile ); 578 lse = findByUid( "last-syncAddressee-"+ syncProfile );
580 if ( ! lse.isEmpty() ) 579 if ( ! lse.isEmpty() )
581 removeAddressee( lse ); 580 removeAddressee( lse );
582 } 581 }
583 582
584} 583}
585void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync ) 584void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync )
586{ 585{
587 Iterator ait; 586 Iterator ait;
588 for ( ait = begin(); ait != end(); ++ait ) { 587 for ( ait = begin(); ait != end(); ++ait ) {
589 QString id = (*ait).IDStr(); 588 QString id = (*ait).IDStr();
@@ -765,142 +764,135 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev, bool takeRes
765 return; 764 return;
766 } 765 }
767 //qDebug("inserting.... %s ",a.uid().latin1() ); 766 //qDebug("inserting.... %s ",a.uid().latin1() );
768 bool found = false; 767 bool found = false;
769 Addressee::List::Iterator it; 768 Addressee::List::Iterator it;
770 for ( it = d->mAddressees.begin(); it != d->mAddressees.end(); ++it ) { 769 for ( it = d->mAddressees.begin(); it != d->mAddressees.end(); ++it ) {
771 if ( a.uid() == (*it).uid() ) { 770 if ( a.uid() == (*it).uid() ) {
772 771
773 bool changed = false; 772 bool changed = false;
774 Addressee addr = a; 773 Addressee addr = a;
775 if ( addr != (*it) ) 774 if ( addr != (*it) )
776 changed = true; 775 changed = true;
777 776
778 if ( takeResource ) { 777 if ( takeResource ) {
779 Resource * res = (*it).resource(); 778 Resource * res = (*it).resource();
780 (*it) = a; 779 (*it) = a;
781 (*it).setResource( res ); 780 (*it).setResource( res );
782 } else { 781 } else {
783 (*it) = a; 782 (*it) = a;
784 if ( (*it).resource() == 0 ) 783 if ( (*it).resource() == 0 )
785 (*it).setResource( standardResource() ); 784 (*it).setResource( standardResource() );
786 } 785 }
787 if ( changed ) { 786 if ( changed ) {
788 if ( setRev ) { 787 if ( setRev ) {
789 788 (*it).setRevision( QDateTime::currentDateTime() );
790 // get rid of micro seconds
791 QDateTime dt = QDateTime::currentDateTime();
792 QTime t = dt.time();
793 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
794 (*it).setRevision( dt );
795 } 789 }
796 (*it).setChanged( true ); 790 (*it).setChanged( true );
797 } 791 }
798 792
799 found = true; 793 found = true;
800 } else { 794 } else {
801 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) { 795 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) {
802 QString name = (*it).uid().mid( 19 ); 796 QString name = (*it).uid().mid( 19 );
803 Addressee b = a; 797 Addressee b = a;
804 QString id = b.getID( name ); 798 QString id = b.getID( name );
805 if ( ! id.isEmpty() ) { 799 if ( ! id.isEmpty() ) {
806 QString des = (*it).note(); 800 QString des = (*it).note();
807 int startN; 801 int startN;
808 if( (startN = des.find( id ) ) >= 0 ) { 802 if( (startN = des.find( id ) ) >= 0 ) {
809 int endN = des.find( ",", startN+1 ); 803 int endN = des.find( ",", startN+1 );
810 des = des.left( startN ) + des.mid( endN+1 ); 804 des = des.left( startN ) + des.mid( endN+1 );
811 (*it).setNote( des ); 805 (*it).setNote( des );
812 } 806 }
813 } 807 }
814 } 808 }
815 } 809 }
816 } 810 }
817 if ( found ) 811 if ( found )
818 return; 812 return;
813
819 d->mAddressees.append( a ); 814 d->mAddressees.append( a );
820 Addressee& addr = d->mAddressees.last(); 815 Addressee& addr = d->mAddressees.last();
821 if ( addr.resource() == 0 ) 816 if ( addr.resource() == 0 )
822 addr.setResource( standardResource() ); 817 addr.setResource( standardResource() );
823
824 addr.setChanged( true ); 818 addr.setChanged( true );
825} 819}
826 820
827void AddressBook::removeAddressee( const Addressee &a ) 821void AddressBook::removeAddressee( const Addressee &a )
828{ 822{
829 Iterator it; 823 Iterator it;
830 Iterator it2; 824 Iterator it2;
831 bool found = false; 825 bool found = false;
832 for ( it = begin(); it != end(); ++it ) { 826 for ( it = begin(); it != end(); ++it ) {
833 if ( a.uid() == (*it).uid() ) { 827 if ( a.uid() == (*it).uid() ) {
834 found = true; 828 found = true;
835 it2 = it; 829 it2 = it;
836 } else { 830 } else {
837 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) { 831 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) {
838 QString name = (*it).uid().mid( 19 ); 832 QString name = (*it).uid().mid( 19 );
839 Addressee b = a; 833 Addressee b = a;
840 QString id = b.getID( name ); 834 QString id = b.getID( name );
841 if ( ! id.isEmpty() ) { 835 if ( ! id.isEmpty() ) {
842 QString des = (*it).note(); 836 QString des = (*it).note();
843 if( des.find( id ) < 0 ) { 837 if( des.find( id ) < 0 ) {
844 des += id + ","; 838 des += id + ",";
845 (*it).setNote( des ); 839 (*it).setNote( des );
846 } 840 }
847 } 841 }
848 } 842 }
849 843
850 } 844 }
851 } 845 }
852 846
853 if ( found ) 847 if ( found )
854 removeAddressee( it2 ); 848 removeAddressee( it2 );
855 849
856} 850}
857 851
858void AddressBook::removeSyncAddressees( bool removeDeleted ) 852void AddressBook::removeSyncAddressees( bool removeDeleted )
859{ 853{
860 Iterator it = begin(); 854 Iterator it = begin();
861 Iterator it2 ; 855 Iterator it2 ;
862 QDateTime dt ( QDate( 2004,1,1) ); 856 QDateTime dt ( QDate( 2003,1,1) );
863 while ( it != end() ) { 857 while ( it != end() ) {
864 (*it).setRevision( dt ); 858 (*it).setRevision( dt );
865 if (( *it).IDStr() != "changed" ) { 859 if (( *it).IDStr() != "changed" ) {
866 // "changed" is used for tagging changed addressees when syncing with KDE or OL 860 // "changed" is used for tagging changed addressees when syncing with KDE or OL
867 (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); 861 (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" );
868 (*it).setIDStr(""); 862 (*it).setIDStr(":");
869 } 863 }
870 if ( ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE && removeDeleted )|| (*it).uid().left( 19 ) == QString("last-syncAddressee-")) { 864 if ( ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE && removeDeleted )|| (*it).uid().left( 19 ) == QString("last-syncAddressee-")) {
871 it2 = it; 865 it2 = it;
872 //qDebug("removing %s ",(*it).uid().latin1() ); 866 //qDebug("removing %s ",(*it).uid().latin1() );
873 ++it; 867 ++it;
874 removeAddressee( it2 ); 868 removeAddressee( it2 );
875 } else { 869 } else {
876 //qDebug("skipping %s ",(*it).uid().latin1() ); 870 //qDebug("skipping %s ",(*it).uid().latin1() );
877 if ( removeDeleted ) { 871 if ( removeDeleted ) {
878 // we have no postprocessing in the resource, we have to do it here 872 // we have no postprocessing in the resource, we have to do it here
879 // we have to compute csum for all, because it could be the first sync 873 // we have to compute csum for all, because it could be the first sync
880 (*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 874 (*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
881
882
883 } 875 }
884 ++it; 876 ++it;
885 } 877 }
886 } 878 }
887 deleteRemovedAddressees(); 879 deleteRemovedAddressees();
888} 880}
889 881
890void AddressBook::removeAddressee( const Iterator &it ) 882void AddressBook::removeAddressee( const Iterator &it )
891{ 883{
892 d->mRemovedAddressees.append( (*it) ); 884 d->mRemovedAddressees.append( (*it) );
893 d->mAddressees.remove( it.d->mIt ); 885 d->mAddressees.remove( it.d->mIt );
894} 886}
895 887
896AddressBook::Iterator AddressBook::find( const Addressee &a ) 888AddressBook::Iterator AddressBook::find( const Addressee &a )
897{ 889{
898 Iterator it; 890 Iterator it;
899 for ( it = begin(); it != end(); ++it ) { 891 for ( it = begin(); it != end(); ++it ) {
900 if ( a.uid() == (*it).uid() ) { 892 if ( a.uid() == (*it).uid() ) {
901 return it; 893 return it;
902 } 894 }
903 } 895 }
904 return end(); 896 return end();
905} 897}
906 898
@@ -910,62 +902,64 @@ Addressee AddressBook::findByUid( const QString &uid )
910 for ( it = begin(); it != end(); ++it ) { 902 for ( it = begin(); it != end(); ++it ) {
911 if ( uid == (*it).uid() ) { 903 if ( uid == (*it).uid() ) {
912 return *it; 904 return *it;
913 } 905 }
914 } 906 }
915 return Addressee(); 907 return Addressee();
916} 908}
917void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool isSubset ) 909void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool isSubset )
918{ 910{
919 //qDebug("AddressBook::preExternSync "); 911 //qDebug("AddressBook::preExternSync ");
920 AddressBook::Iterator it; 912 AddressBook::Iterator it;
921 for ( it = begin(); it != end(); ++it ) { 913 for ( it = begin(); it != end(); ++it ) {
922 (*it).setID( csd, (*it).externalUID() ); 914 (*it).setID( csd, (*it).externalUID() );
923 (*it).computeCsum( csd ); 915 (*it).computeCsum( csd );
924 } 916 }
925 mergeAB( aBook ,csd, isSubset ); 917 mergeAB( aBook ,csd, isSubset );
926} 918}
927void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID) 919void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID)
928{ 920{
929 //qDebug("AddressBook::postExternSync "); 921 //qDebug("AddressBook::postExternSync ");
930 AddressBook::Iterator it; 922 AddressBook::Iterator it;
931 for ( it = begin(); it != end(); ++it ) { 923 for ( it = begin(); it != end(); ++it ) {
932 //qDebug("check uid %s ", (*it).uid().latin1() ); 924 //qDebug("check uid %s ", (*it).uid().latin1() );
933 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || 925 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ||
934 (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM ) { 926 (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM ||
927 (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) {
935 Addressee ad = aBook->findByUid( ( (*it).uid() )); 928 Addressee ad = aBook->findByUid( ( (*it).uid() ));
936 if ( ad.isEmpty() ) { 929 if ( ad.isEmpty() ) {
937 qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); 930 qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1());
938 } else { 931 } else {
939 (*it).setIDStr(":"); 932 (*it).setIDStr(":");
940 (*it).computeCsum( csd );
941 if ( setID ) { 933 if ( setID ) {
942 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) 934 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID )
943 ad.setID( csd, (*it).externalUID() ); 935 ad.setID( csd, (*it).externalUID() );
944 } else 936 } else
945 ad.setID( csd, (*it).uid() ); 937 ad.setID( csd, (*it).uid() );
938 (*it).computeCsum( csd );
946 ad.setCsum( csd, (*it).getCsum( csd ) ); 939 ad.setCsum( csd, (*it).getCsum( csd ) );
947 aBook->insertAddressee( ad ); 940 //qDebug("CSUM %s ",(*it).getCsum( csd ).latin1() );
941 aBook->insertAddressee( ad , false);
948 } 942 }
949 } 943 }
950 } 944 }
951} 945}
952 946
953bool AddressBook::containsExternalUid( const QString& uid ) 947bool AddressBook::containsExternalUid( const QString& uid )
954{ 948{
955 Iterator it; 949 Iterator it;
956 for ( it = begin(); it != end(); ++it ) { 950 for ( it = begin(); it != end(); ++it ) {
957 if ( uid == (*it).externalUID( ) ) 951 if ( uid == (*it).externalUID( ) )
958 return true; 952 return true;
959 } 953 }
960 return false; 954 return false;
961} 955}
962Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) 956Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile )
963{ 957{
964 Iterator it; 958 Iterator it;
965 for ( it = begin(); it != end(); ++it ) { 959 for ( it = begin(); it != end(); ++it ) {
966 if ( uid == (*it).getID( profile ) ) 960 if ( uid == (*it).getID( profile ) )
967 return (*it); 961 return (*it);
968 } 962 }
969 return Addressee(); 963 return Addressee();
970} 964}
971void AddressBook::mergeAB( AddressBook *aBook, const QString& profile , bool isSubset ) 965void AddressBook::mergeAB( AddressBook *aBook, const QString& profile , bool isSubset )
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index d5a110a..3d4992c 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -188,106 +188,116 @@ ulong Addressee::getCsum4List( const QStringList & attList)
188 QString s = attList[i]; 188 QString s = attList[i];
189 if ( ! s.isEmpty() ){ 189 if ( ! s.isEmpty() ){
190 j = s.length(); 190 j = s.length();
191 for ( k = 0; k < j; ++k ) { 191 for ( k = 0; k < j; ++k ) {
192 int mul = k +1; 192 int mul = k +1;
193 add = s[k].unicode (); 193 add = s[k].unicode ();
194 if ( k < 16 ) 194 if ( k < 16 )
195 mul = mul * mul; 195 mul = mul * mul;
196 int ii = i+1; 196 int ii = i+1;
197 add = add * mul *ii*ii*ii; 197 add = add * mul *ii*ii*ii;
198 cSum += add; 198 cSum += add;
199 } 199 }
200 } 200 }
201 201
202 } 202 }
203 //QString dump = attList.join(","); 203 //QString dump = attList.join(",");
204 //qDebug("csum: %d %s", cSum,dump.latin1()); 204 //qDebug("csum: %d %s", cSum,dump.latin1());
205 205
206 return cSum; 206 return cSum;
207 207
208} 208}
209void Addressee::computeCsum(const QString &dev) 209void Addressee::computeCsum(const QString &dev)
210{ 210{
211 QStringList l; 211 QStringList l;
212 if ( !mData->name.isEmpty() ) l.append(mData->name); 212 //if ( !mData->name.isEmpty() ) l.append(mData->name);
213 if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); 213 //if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName );
214 if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); 214 if ( !mData->familyName.isEmpty() ) l.append( mData->familyName );
215 if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); 215 if ( !mData->givenName.isEmpty() ) l.append(mData->givenName );
216 if ( !mData->additionalName ) l.append( mData->additionalName ); 216 if ( !mData->additionalName.isEmpty() ) l.append( mData->additionalName );
217 if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); 217 if ( !mData->prefix.isEmpty() ) l.append( mData->prefix );
218 if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); 218 if ( !mData->suffix.isEmpty() ) l.append( mData->suffix );
219 if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); 219 if ( !mData->nickName.isEmpty() ) l.append( mData->nickName );
220 if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); 220 if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() );
221 if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); 221 if ( !mData->mailer.isEmpty() ) l.append( mData->mailer );
222 if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); 222 if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() );
223 if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); 223 if ( mData->geo.isValid() ) l.append( mData->geo.asString() );
224 if ( !mData->title .isEmpty() ) l.append( mData->title ); 224 if ( !mData->title .isEmpty() ) l.append( mData->title );
225 if ( !mData->role.isEmpty() ) l.append( mData->role ); 225 if ( !mData->role.isEmpty() ) l.append( mData->role );
226 if ( !mData->organization.isEmpty() ) l.append( mData->organization ); 226 if ( !mData->organization.isEmpty() ) l.append( mData->organization );
227 if ( !mData->note.isEmpty() ) l.append( mData->note ); 227 if ( !mData->note.isEmpty() ) l.append( mData->note );
228 if ( !mData->productId.isEmpty() ) l.append(mData->productId ); 228 if ( !mData->productId.isEmpty() ) l.append(mData->productId );
229 if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); 229 if ( !mData->sortString.isEmpty() ) l.append( mData->sortString );
230 if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); 230 if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString());
231 // if ( !mData->logo.isEmpty() ) l.append( ); 231 // if ( !mData->logo.isEmpty() ) l.append( );
232 //if ( !mData->photo.isEmpty() ) l.append( ); 232 //if ( !mData->photo.isEmpty() ) l.append( );
233 //if ( !mData->sound.isEmpty() ) l.append( ); 233 //if ( !mData->sound.isEmpty() ) l.append( );
234 //if ( !mData->agent.isEmpty() ) l.append( ); 234 //if ( !mData->agent.isEmpty() ) l.append( );
235 if ( mData->url.isValid() ) 235 if ( mData->url.isValid() )
236 if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() ); 236 if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() );
237 KABC::PhoneNumber::List phoneNumbers; 237 KABC::PhoneNumber::List phoneNumbers;
238 KABC::PhoneNumber::List::Iterator phoneIter; 238 KABC::PhoneNumber::List::Iterator phoneIter;
239 239
240 QStringList t; 240 QStringList t;
241 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); 241 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end();
242 ++phoneIter ) 242 ++phoneIter )
243 t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); 243 t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) );
244 t.sort(); 244 t.sort();
245 uint iii; 245 uint iii;
246 for ( iii = 0; iii < t.count(); ++iii) 246 for ( iii = 0; iii < t.count(); ++iii)
247 l.append( t[iii] ); 247 l.append( t[iii] );
248 t = mData->emails; 248 t = mData->emails;
249 t.sort(); 249 t.sort();
250 for ( iii = 0; iii < t.count(); ++iii) 250 for ( iii = 0; iii < t.count(); ++iii)
251 l.append( t[iii] ); 251 l.append( t[iii] );
252 t = mData->categories; 252 t = mData->categories;
253 t.sort(); 253 t.sort();
254 for ( iii = 0; iii < t.count(); ++iii) 254 for ( iii = 0; iii < t.count(); ++iii)
255 l.append( t[iii] ); 255 l.append( t[iii] );
256 t = mData->custom; 256 t = mData->custom;
257 t.sort(); 257 t.sort();
258 for ( iii = 0; iii < t.count(); ++iii) 258 for ( iii = 0; iii < t.count(); ++iii)
259 l.append( t[iii] ); 259 if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) {
260 int find = t[iii].find (':')+1;
261 //qDebug("lennnn %d %d ", find, t[iii].length());
262 if ( find < t[iii].length())
263 l.append( t[iii] );
264
265 }
260 KABC::Address::List::Iterator addressIter; 266 KABC::Address::List::Iterator addressIter;
261 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); 267 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end();
262 ++addressIter ) { 268 ++addressIter ) {
263 t = (*addressIter).asList(); 269 t = (*addressIter).asList();
264 t.sort(); 270 t.sort();
265 for ( iii = 0; iii < t.count(); ++iii) 271 for ( iii = 0; iii < t.count(); ++iii)
266 l.append( t[iii] ); 272 l.append( t[iii] );
267 } 273 }
268 uint cs = getCsum4List(l); 274 uint cs = getCsum4List(l);
269 //qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); 275#if 1
276 for ( iii = 0; iii < l.count(); ++iii)
277 qDebug("%d***%s***",iii,l[iii].latin1());
278 qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() );
279#endif
270 setCsum( dev, QString::number (cs )); 280 setCsum( dev, QString::number (cs ));
271} 281}
272 282
273void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) 283void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false)
274{ 284{
275 285
276 detach(); 286 detach();
277 if ( mData->name.isEmpty() ) mData->name = ad.mData->name; 287 if ( mData->name.isEmpty() ) mData->name = ad.mData->name;
278 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; 288 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName;
279 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; 289 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName;
280 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; 290 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ;
281 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; 291 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName;
282 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; 292 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix;
283 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; 293 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix;
284 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; 294 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName;
285 if ( !mData->birthday.isValid() ) 295 if ( !mData->birthday.isValid() )
286 if ( ad.mData->birthday.isValid()) 296 if ( ad.mData->birthday.isValid())
287 mData->birthday = ad.mData->birthday; 297 mData->birthday = ad.mData->birthday;
288 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; 298 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer;
289 if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; 299 if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone;
290 if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; 300 if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo;
291 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; 301 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ;
292 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; 302 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ;
293 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; 303 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ;
@@ -1090,49 +1100,52 @@ QString Addressee::noteLabel()
1090void Addressee::setProductId( const QString &productId ) 1100void Addressee::setProductId( const QString &productId )
1091{ 1101{
1092 if ( productId == mData->productId ) return; 1102 if ( productId == mData->productId ) return;
1093 detach(); 1103 detach();
1094 mData->empty = false; 1104 mData->empty = false;
1095 mData->productId = productId; 1105 mData->productId = productId;
1096} 1106}
1097 1107
1098QString Addressee::productId() const 1108QString Addressee::productId() const
1099{ 1109{
1100 return mData->productId; 1110 return mData->productId;
1101} 1111}
1102 1112
1103QString Addressee::productIdLabel() 1113QString Addressee::productIdLabel()
1104{ 1114{
1105 return i18n("Product Identifier"); 1115 return i18n("Product Identifier");
1106} 1116}
1107 1117
1108 1118
1109void Addressee::setRevision( const QDateTime &revision ) 1119void Addressee::setRevision( const QDateTime &revision )
1110{ 1120{
1111 if ( revision == mData->revision ) return; 1121 if ( revision == mData->revision ) return;
1112 detach(); 1122 detach();
1113 mData->empty = false; 1123 mData->empty = false;
1114 mData->revision = revision; 1124 mData->revision = QDateTime( revision.date(),
1125 QTime (revision.time().hour(),
1126 revision.time().minute(),
1127 revision.time().second()));
1115} 1128}
1116 1129
1117QDateTime Addressee::revision() const 1130QDateTime Addressee::revision() const
1118{ 1131{
1119 return mData->revision; 1132 return mData->revision;
1120} 1133}
1121 1134
1122QString Addressee::revisionLabel() 1135QString Addressee::revisionLabel()
1123{ 1136{
1124 return i18n("Revision Date"); 1137 return i18n("Revision Date");
1125} 1138}
1126 1139
1127 1140
1128void Addressee::setSortString( const QString &sortString ) 1141void Addressee::setSortString( const QString &sortString )
1129{ 1142{
1130 if ( sortString == mData->sortString ) return; 1143 if ( sortString == mData->sortString ) return;
1131 detach(); 1144 detach();
1132 mData->empty = false; 1145 mData->empty = false;
1133 mData->sortString = sortString; 1146 mData->sortString = sortString;
1134} 1147}
1135 1148
1136QString Addressee::sortString() const 1149QString Addressee::sortString() const
1137{ 1150{
1138 return mData->sortString; 1151 return mData->sortString;
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 012780b..3397e06 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -1039,49 +1039,51 @@ void AddresseeEditorWidget::load()
1039 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) ); 1039 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) );
1040 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); 1040 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) );
1041 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); 1041 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) );
1042 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); 1042 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) );
1043 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); 1043 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) );
1044 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); 1044 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) );
1045 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); 1045 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" );
1046 if ( gen == "female" ) 1046 if ( gen == "female" )
1047 mGenderBox->setCurrentItem ( 1 ); 1047 mGenderBox->setCurrentItem ( 1 );
1048 else if ( gen == "male" ) 1048 else if ( gen == "male" )
1049 mGenderBox->setCurrentItem ( 2 ); 1049 mGenderBox->setCurrentItem ( 2 );
1050 else 1050 else
1051 mGenderBox->setCurrentItem ( 0 ); 1051 mGenderBox->setCurrentItem ( 0 );
1052 blockSignals( block ); 1052 blockSignals( block );
1053 mBlockSignals = false; 1053 mBlockSignals = false;
1054 1054
1055 mDirty = false; 1055 mDirty = false;
1056} 1056}
1057 1057
1058void AddresseeEditorWidget::save() 1058void AddresseeEditorWidget::save()
1059{ 1059{
1060 if ( !dirty() ) { 1060 if ( !dirty() ) {
1061 return; 1061 return;
1062 } 1062 }
1063 1063
1064 mAddressee.setRevision( QDateTime::currentDateTime() );
1065
1064 mAddressee.setRole( mRoleEdit->text() ); 1066 mAddressee.setRole( mRoleEdit->text() );
1065 mAddressee.setOrganization( mOrgEdit->text() ); 1067 mAddressee.setOrganization( mOrgEdit->text() );
1066 mAddressee.setUrl( KURL( mURLEdit->text() ) ); 1068 mAddressee.setUrl( KURL( mURLEdit->text() ) );
1067 mAddressee.setNote( mNoteEdit->text() ); 1069 mAddressee.setNote( mNoteEdit->text() );
1068 if ( mBirthdayPicker->inputIsValid() ) { 1070 if ( mBirthdayPicker->inputIsValid() ) {
1069 QDate da = mBirthdayPicker->date(); 1071 QDate da = mBirthdayPicker->date();
1070 if ( da > QDate::currentDate() ) 1072 if ( da > QDate::currentDate() )
1071 da.setYMD(da.year()-100, da.month(), da.day() ); 1073 da.setYMD(da.year()-100, da.month(), da.day() );
1072 mAddressee.setBirthday( QDateTime( da ) ); 1074 mAddressee.setBirthday( QDateTime( da ) );
1073 //qDebug("bday %s ",da.toString().latin1()); 1075 //qDebug("bday %s ",da.toString().latin1());
1074 } 1076 }
1075 else { 1077 else {
1076 mAddressee.setBirthday( QDateTime() ); 1078 mAddressee.setBirthday( QDateTime() );
1077 mBirthdayPicker->clear(); 1079 mBirthdayPicker->clear();
1078 } 1080 }
1079 mAddressee.setNickName( mNicknameEdit->text() ); 1081 mAddressee.setNickName( mNicknameEdit->text() );
1080 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); 1082 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) );
1081 1083
1082 mAddressee.setGeo( mGeoWidget->geo() ); 1084 mAddressee.setGeo( mGeoWidget->geo() );
1083 mAddressee.setPhoto( mImageWidget->photo() ); 1085 mAddressee.setPhoto( mImageWidget->photo() );
1084 mAddressee.setLogo( mImageWidget->logo() ); 1086 mAddressee.setLogo( mImageWidget->logo() );
1085 mAddressee.setKeys( mKeyWidget->keys() ); 1087 mAddressee.setKeys( mKeyWidget->keys() );
1086#ifndef KAB_EMBEDDED 1088#ifndef KAB_EMBEDDED
1087 mAddressee.setSound( mSoundWidget->sound() ); 1089 mAddressee.setSound( mSoundWidget->sound() );
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 273d435..6e482b5 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2385,87 +2385,86 @@ KABC::Addressee KABCore::getLastSyncAddressee()
2385 return lse; 2385 return lse;
2386} 2386}
2387int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) 2387int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full )
2388{ 2388{
2389 2389
2390 //void setZaurusId(int id); 2390 //void setZaurusId(int id);
2391 // int zaurusId() const; 2391 // int zaurusId() const;
2392 // void setZaurusUid(int id); 2392 // void setZaurusUid(int id);
2393 // int zaurusUid() const; 2393 // int zaurusUid() const;
2394 // void setZaurusStat(int id); 2394 // void setZaurusStat(int id);
2395 // int zaurusStat() const; 2395 // int zaurusStat() const;
2396 // 0 equal 2396 // 0 equal
2397 // 1 take local 2397 // 1 take local
2398 // 2 take remote 2398 // 2 take remote
2399 // 3 cancel 2399 // 3 cancel
2400 QDateTime lastSync = mLastAddressbookSync; 2400 QDateTime lastSync = mLastAddressbookSync;
2401 QDateTime localMod = local->revision(); 2401 QDateTime localMod = local->revision();
2402 QDateTime remoteMod = remote->revision(); 2402 QDateTime remoteMod = remote->revision();
2403 2403
2404 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2404 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2405 2405
2406 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2406 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2407 bool remCh, locCh; 2407 bool remCh, locCh;
2408 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 2408 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
2409 2409 qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2410 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2411 locCh = ( localMod > mLastAddressbookSync ); 2410 locCh = ( localMod > mLastAddressbookSync );
2412 if ( !remCh && ! locCh ) { 2411 if ( !remCh && ! locCh ) {
2413 //qDebug("both not changed "); 2412 qDebug("both not changed ");
2414 lastSync = localMod.addDays(1); 2413 lastSync = localMod.addDays(1);
2415 if ( mode <= SYNC_PREF_ASK ) 2414 if ( mode <= SYNC_PREF_ASK )
2416 return 0; 2415 return 0;
2417 } else { 2416 } else {
2418 if ( locCh ) { 2417 if ( locCh ) {
2419 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); 2418 qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
2420 lastSync = localMod.addDays( -1 ); 2419 lastSync = localMod.addDays( -1 );
2421 if ( !remCh ) 2420 if ( !remCh )
2422 remoteMod =( lastSync.addDays( -1 ) ); 2421 remoteMod =( lastSync.addDays( -1 ) );
2423 } else { 2422 } else {
2424 //qDebug(" not loc changed "); 2423 qDebug(" not loc changed ");
2425 lastSync = localMod.addDays( 1 ); 2424 lastSync = localMod.addDays( 1 );
2426 if ( remCh ) 2425 if ( remCh ) {
2426 qDebug("rem changed ");
2427 remoteMod =( lastSync.addDays( 1 ) ); 2427 remoteMod =( lastSync.addDays( 1 ) );
2428 }
2428 2429
2429 } 2430 }
2430 } 2431 }
2431 full = true; 2432 full = true;
2432 if ( mode < SYNC_PREF_ASK ) 2433 if ( mode < SYNC_PREF_ASK )
2433 mode = SYNC_PREF_ASK; 2434 mode = SYNC_PREF_ASK;
2434 } else { 2435 } else {
2435 if ( localMod == remoteMod ) 2436 if ( localMod == remoteMod )
2436 return 0; 2437 return 0;
2437 2438
2438 } 2439 }
2439 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 2440 qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec());
2440 2441 qDebug("lastsync %s ", lastSync.toString().latin1() );
2441 //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , localMod, remote->lastModified().toString().latin1(), remoteMod);
2442 //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() );
2443 //full = true; //debug only 2442 //full = true; //debug only
2444 if ( full ) { 2443 if ( full ) {
2445 bool equ = ( (*local) == (*remote) ); 2444 bool equ = ( (*local) == (*remote) );
2446 if ( equ ) { 2445 if ( equ ) {
2447 //qDebug("equal "); 2446 qDebug("equal ");
2448 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2447 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2449 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 2448 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
2450 } 2449 }
2451 if ( mode < SYNC_PREF_FORCE_LOCAL ) 2450 if ( mode < SYNC_PREF_FORCE_LOCAL )
2452 return 0; 2451 return 0;
2453 2452
2454 }//else //debug only 2453 }//else //debug only
2455 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 2454 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
2456 } 2455 }
2457 int result; 2456 int result;
2458 bool localIsNew; 2457 bool localIsNew;
2459 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() ); 2458 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() );
2460 2459
2461 if ( full && mode < SYNC_PREF_NEWEST ) 2460 if ( full && mode < SYNC_PREF_NEWEST )
2462 mode = SYNC_PREF_ASK; 2461 mode = SYNC_PREF_ASK;
2463 2462
2464 switch( mode ) { 2463 switch( mode ) {
2465 case SYNC_PREF_LOCAL: 2464 case SYNC_PREF_LOCAL:
2466 if ( lastSync > remoteMod ) 2465 if ( lastSync > remoteMod )
2467 return 1; 2466 return 1;
2468 if ( lastSync > localMod ) 2467 if ( lastSync > localMod )
2469 return 2; 2468 return 2;
2470 return 1; 2469 return 1;
2471 break; 2470 break;
@@ -2622,50 +2621,51 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2622 //inL.setResource( 0 ); 2621 //inL.setResource( 0 );
2623 //inR.setResource( 0 ); 2622 //inR.setResource( 0 );
2624 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars 2623 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars
2625 if ( !inL.resource() || inL.resource()->includeInSync() ) { 2624 if ( !inL.resource() || inL.resource()->includeInSync() ) {
2626 if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { 2625 if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) {
2627 //qDebug("take %d %s ", take, inL.summary().latin1()); 2626 //qDebug("take %d %s ", take, inL.summary().latin1());
2628 if ( take == 3 ) 2627 if ( take == 3 )
2629 return false; 2628 return false;
2630 if ( take == 1 ) {// take local ********************** 2629 if ( take == 1 ) {// take local **********************
2631 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2630 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2632 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 2631 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2633 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 2632 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2634 local->insertAddressee( inL, false ); 2633 local->insertAddressee( inL, false );
2635 idS = inR.externalUID(); 2634 idS = inR.externalUID();
2636 OidS = inR.originalExternalUID(); 2635 OidS = inR.originalExternalUID();
2637 } 2636 }
2638 else 2637 else
2639 idS = inR.IDStr(); 2638 idS = inR.IDStr();
2640 remote->removeAddressee( inR ); 2639 remote->removeAddressee( inR );
2641 inR = inL; 2640 inR = inL;
2642 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 2641 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
2643 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2642 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2644 inR.setOriginalExternalUID( OidS ); 2643 inR.setOriginalExternalUID( OidS );
2645 inR.setExternalUID( idS ); 2644 inR.setExternalUID( idS );
2646 if ( syncManager->syncWithDesktop() ) 2645 if ( syncManager->syncWithDesktop() ) {
2647 inR.setIDStr("changed" ); 2646 inR.setIDStr("changed" );
2647 }
2648 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); 2648 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" );
2649 } else { 2649 } else {
2650 inR.setIDStr( idS ); 2650 inR.setIDStr( idS );
2651 } 2651 }
2652 inR.setResource( 0 ); 2652 inR.setResource( 0 );
2653 remote->insertAddressee( inR , false); 2653 remote->insertAddressee( inR , false);
2654 ++changedRemote; 2654 ++changedRemote;
2655 } else { // take == 2 take remote ********************** 2655 } else { // take == 2 take remote **********************
2656 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2656 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2657 if ( inR.revision().date().year() < 2004 ) 2657 if ( inR.revision().date().year() < 2004 )
2658 inR.setRevision( modifiedCalendar ); 2658 inR.setRevision( modifiedCalendar );
2659 } 2659 }
2660 idS = inL.IDStr(); 2660 idS = inL.IDStr();
2661 local->removeAddressee( inL ); 2661 local->removeAddressee( inL );
2662 inL = inR; 2662 inL = inR;
2663 inL.setIDStr( idS ); 2663 inL.setIDStr( idS );
2664 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2664 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2665 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 2665 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2666 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 2666 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2667 } 2667 }
2668 inL.setResource( 0 ); 2668 inL.setResource( 0 );
2669 local->insertAddressee( inL , false ); 2669 local->insertAddressee( inL , false );
2670 ++changedLocal; 2670 ++changedLocal;
2671 } 2671 }
@@ -2725,48 +2725,49 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2725 if ( !skipIncidence ) { 2725 if ( !skipIncidence ) {
2726 inL = local->findByUid( uid ); 2726 inL = local->findByUid( uid );
2727 if ( !inL.resource() || inL.resource()->includeInSync() ) { 2727 if ( !inL.resource() || inL.resource()->includeInSync() ) {
2728 inR = remote->findByUid( uid ); 2728 inR = remote->findByUid( uid );
2729 if ( inR.isEmpty() ) { // no conflict ********** add or delete local 2729 if ( inR.isEmpty() ) { // no conflict ********** add or delete local
2730 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2730 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2731 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 2731 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
2732 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 2732 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
2733 local->removeAddressee( inL ); 2733 local->removeAddressee( inL );
2734 ++deletedAddresseeL; 2734 ++deletedAddresseeL;
2735 } else { 2735 } else {
2736 if ( ! syncManager->mWriteBackExistingOnly ) { 2736 if ( ! syncManager->mWriteBackExistingOnly ) {
2737 inL.removeID(mCurrentSyncDevice ); 2737 inL.removeID(mCurrentSyncDevice );
2738 ++addedAddresseeR; 2738 ++addedAddresseeR;
2739 inL.setRevision( modifiedCalendar ); 2739 inL.setRevision( modifiedCalendar );
2740 local->insertAddressee( inL, false ); 2740 local->insertAddressee( inL, false );
2741 inR = inL; 2741 inR = inL;
2742 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); 2742 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL );
2743 inR.setResource( 0 ); 2743 inR.setResource( 0 );
2744 remote->insertAddressee( inR, false ); 2744 remote->insertAddressee( inR, false );
2745 } 2745 }
2746 } 2746 }
2747 } else { 2747 } else {
2748 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { 2748 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) {
2749 //qDebug("data %s ", inL.revision().toString().latin1());
2749 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 2750 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
2750 local->removeAddressee( inL ); 2751 local->removeAddressee( inL );
2751 ++deletedAddresseeL; 2752 ++deletedAddresseeL;
2752 } else { 2753 } else {
2753 if ( ! syncManager->mWriteBackExistingOnly ) { 2754 if ( ! syncManager->mWriteBackExistingOnly ) {
2754 ++addedAddresseeR; 2755 ++addedAddresseeR;
2755 inL.setRevision( modifiedCalendar ); 2756 inL.setRevision( modifiedCalendar );
2756 local->insertAddressee( inL, false ); 2757 local->insertAddressee( inL, false );
2757 inR = inL; 2758 inR = inL;
2758 inR.setIDStr( ":" ); 2759 inR.setIDStr( ":" );
2759 inR.setResource( 0 ); 2760 inR.setResource( 0 );
2760 remote->insertAddressee( inR, false ); 2761 remote->insertAddressee( inR, false );
2761 } 2762 }
2762 } 2763 }
2763 } 2764 }
2764 } 2765 }
2765 } 2766 }
2766 } 2767 }
2767 ++incCounter; 2768 ++incCounter;
2768 } 2769 }
2769 el.clear(); 2770 el.clear();
2770 syncManager->hideProgressBar(); 2771 syncManager->hideProgressBar();
2771 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); 2772 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 );
2772 // get rid of micro seconds 2773 // get rid of micro seconds
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 59f3b40..f8d752a 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1164,48 +1164,49 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1164 bool ok; 1164 bool ok;
1165 dt = inR->getNextOccurence( cur, &ok ); 1165 dt = inR->getNextOccurence( cur, &ok );
1166 if ( !ok ) 1166 if ( !ok )
1167 dt = cur.addSecs( -62 ); 1167 dt = cur.addSecs( -62 );
1168 } 1168 }
1169 else 1169 else
1170 dt = inR->dtStart(); 1170 dt = inR->dtStart();
1171 if ( dt < cur || dt > end ) { 1171 if ( dt < cur || dt > end ) {
1172 remote->deleteIncidence( inR ); 1172 remote->deleteIncidence( inR );
1173 ++delFut; 1173 ++delFut;
1174 } 1174 }
1175 inR = er.next(); 1175 inR = er.next();
1176 } 1176 }
1177 } 1177 }
1178 bar.hide(); 1178 bar.hide();
1179 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1179 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1180 eventLSync->setReadOnly( false ); 1180 eventLSync->setReadOnly( false );
1181 eventLSync->setDtStart( mLastCalendarSync ); 1181 eventLSync->setDtStart( mLastCalendarSync );
1182 eventRSync->setDtStart( mLastCalendarSync ); 1182 eventRSync->setDtStart( mLastCalendarSync );
1183 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1183 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1184 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1184 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1185 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1185 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1186 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1186 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1187 eventLSync->setReadOnly( true ); 1187 eventLSync->setReadOnly( true );
1188 qDebug("********** %d %d ", mGlobalSyncMode == SYNC_MODE_NORMAL, mSyncManager->syncWithDesktop() );
1188 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1189 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1189 remote->addEvent( eventRSync ); 1190 remote->addEvent( eventRSync );
1190 else 1191 else
1191 delete eventRSync; 1192 delete eventRSync;
1192 QString mes; 1193 QString mes;
1193 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR ); 1194 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR );
1194 QString delmess; 1195 QString delmess;
1195 if ( delFut ) { 1196 if ( delFut ) {
1196 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut); 1197 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut);
1197 mes += delmess; 1198 mes += delmess;
1198 } 1199 }
1199 mes = i18n("Local calendar changed!\n") +mes; 1200 mes = i18n("Local calendar changed!\n") +mes;
1200 mCalendar->checkAlarmForIncidence( 0, true ); 1201 mCalendar->checkAlarmForIncidence( 0, true );
1201 qDebug( mes ); 1202 qDebug( mes );
1202 if ( mSyncManager->mShowSyncSummary ) { 1203 if ( mSyncManager->mShowSyncSummary ) {
1203 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1204 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1204 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1205 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1205 qDebug("cancelled "); 1206 qDebug("cancelled ");
1206 return false; 1207 return false;
1207 } 1208 }
1208 } 1209 }
1209 return syncOK; 1210 return syncOK;
1210} 1211}
1211 1212
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 21af295..c12ba1c 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -516,82 +516,84 @@ void KSyncManager::multiSync( bool askforPrefs )
516 if ( askforPrefs ) { 516 if ( askforPrefs ) {
517 if ( !edit_sync_options()) { 517 if ( !edit_sync_options()) {
518 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") ); 518 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") );
519 return; 519 return;
520 } 520 }
521 mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; 521 mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs;
522 } 522 }
523 mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); 523 mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") );
524 qApp->processEvents(); 524 qApp->processEvents();
525 int num = ringSync() ; 525 int num = ringSync() ;
526 if ( num > 1 ) 526 if ( num > 1 )
527 ringSync(); 527 ringSync();
528 setBlockSave(false); 528 setBlockSave(false);
529 if ( num ) 529 if ( num )
530 emit save(); 530 emit save();
531 if ( num ) 531 if ( num )
532 mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); 532 mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) );
533 else 533 else
534 mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); 534 mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
535 return; 535 return;
536} 536}
537 537
538int KSyncManager::ringSync() 538int KSyncManager::ringSync()
539{ 539{
540
540 int syncedProfiles = 0; 541 int syncedProfiles = 0;
541 unsigned int i; 542 unsigned int i;
542 QTime timer; 543 QTime timer;
543 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 544 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
544 QStringList syncProfileNames = mSyncProfileNames; 545 QStringList syncProfileNames = mSyncProfileNames;
545 KSyncProfile* temp = new KSyncProfile (); 546 KSyncProfile* temp = new KSyncProfile ();
546 mAskForPreferences = false; 547 mAskForPreferences = false;
547 for ( i = 0; i < syncProfileNames.count(); ++i ) { 548 for ( i = 0; i < syncProfileNames.count(); ++i ) {
548 mCurrentSyncProfile = i; 549 mCurrentSyncProfile = i;
549 temp->setName(syncProfileNames[mCurrentSyncProfile]); 550 temp->setName(syncProfileNames[mCurrentSyncProfile]);
550 temp->readConfig(&config); 551 temp->readConfig(&config);
551 552
552 bool includeInRingSync; 553 bool includeInRingSync;
553 switch(mTargetApp) 554 switch(mTargetApp)
554 { 555 {
555 case (KAPI): 556 case (KAPI):
556 includeInRingSync = temp->getIncludeInRingSyncAB(); 557 includeInRingSync = temp->getIncludeInRingSyncAB();
557 break; 558 break;
558 case (KOPI): 559 case (KOPI):
559 includeInRingSync = temp->getIncludeInRingSync(); 560 includeInRingSync = temp->getIncludeInRingSync();
560 break; 561 break;
561 case (PWMPI): 562 case (PWMPI):
562 includeInRingSync = temp->getIncludeInRingSyncPWM(); 563 includeInRingSync = temp->getIncludeInRingSyncPWM();
563 break; 564 break;
564 default: 565 default:
565 qDebug("KSyncManager::ringSync: invalid apptype selected"); 566 qDebug("KSyncManager::ringSync: invalid apptype selected");
566 break; 567 break;
567 568
568 } 569 }
569 570
570 571
571 if ( includeInRingSync && ( i < 1 || i > 2 )) { 572 if ( includeInRingSync && ( i < 1 || i > 2 )) {
572 mParent->topLevelWidget()->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); 573 mParent->topLevelWidget()->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... "));
573 ++syncedProfiles; 574 ++syncedProfiles;
575 mSyncWithDesktop = false;
574 // mAskForPreferences = temp->getAskForPreferences(); 576 // mAskForPreferences = temp->getAskForPreferences();
575 mWriteBackFile = temp->getWriteBackFile(); 577 mWriteBackFile = temp->getWriteBackFile();
576 mWriteBackExistingOnly = temp->getWriteBackExisting(); 578 mWriteBackExistingOnly = temp->getWriteBackExisting();
577 mIsKapiFile = temp->getIsKapiFile(); 579 mIsKapiFile = temp->getIsKapiFile();
578 mWriteBackInFuture = 0; 580 mWriteBackInFuture = 0;
579 if ( temp->getWriteBackFuture() ) 581 if ( temp->getWriteBackFuture() )
580 mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); 582 mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
581 mShowSyncSummary = false; 583 mShowSyncSummary = false;
582 mCurrentSyncDevice = syncProfileNames[i] ; 584 mCurrentSyncDevice = syncProfileNames[i] ;
583 mCurrentSyncName = mLocalMachineName; 585 mCurrentSyncName = mLocalMachineName;
584 if ( i == 0 ) { 586 if ( i == 0 ) {
585 mIsKapiFile = false; 587 mIsKapiFile = false;
586#ifdef DESKTOP_VERSION 588#ifdef DESKTOP_VERSION
587 syncKDE(); 589 syncKDE();
588#else 590#else
589 syncSharp(); 591 syncSharp();
590#endif 592#endif
591 } else { 593 } else {
592 if ( temp->getIsLocalFileSync() ) { 594 if ( temp->getIsLocalFileSync() ) {
593 switch(mTargetApp) 595 switch(mTargetApp)
594 { 596 {
595 case (KAPI): 597 case (KAPI):
596 if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) 598 if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) )
597 mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); 599 mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB();