summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile428
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--libkcal/phoneformat.cpp336
-rw-r--r--libkcal/sharpformat.cpp2
-rw-r--r--libkcal/vcalformat.cpp71
-rw-r--r--microkde/kidmanager.cpp14
6 files changed, 489 insertions, 363 deletions
diff --git a/Makefile b/Makefile
index 9b55ecf..95a3a45 100644
--- a/Makefile
+++ b/Makefile
@@ -1,271 +1,159 @@
1export KDEPIMDIR = $(shell pwd) 1#############################################################################
2# Makefile for building: kopi-desktop
3# Generated by qmake (1.07a) (Qt 3.3.3) on: Thu Aug 19 22:23:29 2004
4# Project: kopi-desktop.pro
5# Template: subdirs
6# Command: $(QMAKE) -o Makefile kopi-desktop.pro
7#############################################################################
8
9 MAKEFILE =Makefile
10 QMAKE =qmake
11DEL_FILE = rm -f
12CHK_DIR_EXISTS= test -d
13MKDIR = mkdir -p
14INSTALL_FILE=
15INSTALL_DIR =
16 SUBTARGETS = \
17 sub-gammu-emb-common \
18 sub-libical \
19 sub-libkcal \
20 sub-microkde \
21 sub-libkdepim \
22 sub-kabc \
23 sub-korganizer \
24 sub-kaddressbook \
25 sub-kabc-plugins-file \
26 sub-kabc-plugins-dir
27
28first: all
29
30all: Makefile $(SUBTARGETS)
31
32gammu/emb/common/$(MAKEFILE):
33 @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common"
34 cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE)
35sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE
36 cd gammu/emb/common && $(MAKE) -f $(MAKEFILE)
37
38libical/$(MAKEFILE):
39 @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical"
40 cd libical && $(QMAKE) libical.pro -o $(MAKEFILE)
41sub-libical: libical/$(MAKEFILE) FORCE
42 cd libical && $(MAKE) -f $(MAKEFILE)
43
44libkcal/$(MAKEFILE):
45 @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal"
46 cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE)
47sub-libkcal: libkcal/$(MAKEFILE) FORCE
48 cd libkcal && $(MAKE) -f $(MAKEFILE)
49
50microkde/$(MAKEFILE):
51 @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde"
52 cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE)
53sub-microkde: microkde/$(MAKEFILE) FORCE
54 cd microkde && $(MAKE) -f $(MAKEFILE)
55
56libkdepim/$(MAKEFILE):
57 @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim"
58 cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE)
59sub-libkdepim: libkdepim/$(MAKEFILE) FORCE
60 cd libkdepim && $(MAKE) -f $(MAKEFILE)
61
62kabc/$(MAKEFILE):
63 @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc"
64 cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE)
65sub-kabc: kabc/$(MAKEFILE) FORCE
66 cd kabc && $(MAKE) -f $(MAKEFILE)
67
68korganizer/$(MAKEFILE):
69 @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer"
70 cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE)
71sub-korganizer: korganizer/$(MAKEFILE) FORCE
72 cd korganizer && $(MAKE) -f $(MAKEFILE)
73
74kaddressbook/$(MAKEFILE):
75 @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook"
76 cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE)
77sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE
78 cd kaddressbook && $(MAKE) -f $(MAKEFILE)
79
80kabc/plugins/file/$(MAKEFILE):
81 @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file"
82 cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE)
83sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE
84 cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE)
85
86kabc/plugins/dir/$(MAKEFILE):
87 @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir"
88 cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE)
89sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE
90 cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE)
91
92Makefile: kopi-desktop.pro /usr/local/qtgcc/mkspecs/default/qmake.conf
93 $(QMAKE) -o Makefile kopi-desktop.pro
94qmake: qmake_all
95 @$(QMAKE) -o Makefile kopi-desktop.pro
96
97all: $(SUBTARGETS)
98qmake_all: gammu/emb/common/$(MAKEFILE) libical/$(MAKEFILE) libkcal/$(MAKEFILE) microkde/$(MAKEFILE) libkdepim/$(MAKEFILE) kabc/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE)
99 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
100 ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
101 ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
102 ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
103 ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
104 ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
105 ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
106 ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
107 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
108 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
109clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE
110 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true
111 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true
112 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true
113 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true
114 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true
115 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true
116 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true
117 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true
118 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true
119 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true
120uninstall_subdirs: qmake_all FORCE
121 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
122 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
123 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
124 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
125 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
126 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
127 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
128 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
129 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
130 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
131install_subdirs: qmake_all FORCE
132 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true
133 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true
134 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true
135 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true
136 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true
137 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true
138 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true
139 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true
140 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true
141 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true
142distclean: qmake_all FORCE
143 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
144 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
145 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
146 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
147 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
148 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
149 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
150 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
151 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
152 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
153
154install: install_subdirs
155
156uninstall: uninstall_subdirs
157
158FORCE:
2 159
3
4ifeq ($(PLATFORM) , zaurus)
5 BUILD_NO_LDAP_PLUGIN=1
6endif
7
8ifneq ($(PLATFORM) , zaurus)
9 BUILD_NO_SHARP_PLUGIN=1
10endif
11
12SUBDIRS_MICROKDE = \
13 libical/src/libical \
14 libical/src/libicalss \
15 qtcompat \
16 microkde \
17 libkcal \
18 libkdepim \
19 kabc \
20 kabc/formats/binary \
21 kabc/plugins/file \
22 kabc/plugins/dir \
23 korganizer \
24 kalarmd \
25 kaddressbook
26
27SUBDIRS_QTOPIA_PLUGIN = \
28 kabc/plugins/qtopia
29
30SUBDIRS_OPIE_PLUGIN = \
31 kabc/plugins/opie
32
33SUBDIRS_SHARP_PLUGIN = \
34 kabc/plugins/sharpdtm
35
36SUBDIRS_LDAP_PLUGIN = \
37 kabc/plugins/ldap
38
39SUBDIRS_MICROMAIL = \
40 kmicromail/libetpan \
41 kmicromail/libmailwrapper \
42 kmicromail
43
44SUBDIRS = \
45 $(SUBDIRS_MICROKDE) \
46 $(SUBDIRS_QTOPIA_PLUGIN) \
47 $(SUBDIRS_OPIE_PLUGIN) \
48 $(SUBDIRS_SHARP_PLUGIN) \
49 $(SUBDIRS_LDAP_PLUGIN) \
50 $(SUBDIRS_MICROMAIL)
51
52
53all: build_microkde \
54 build_qtopia_plugin \
55 build_opie_plugin \
56 build_sharp_plugin \
57 build_ldap_plugin \
58 build_micromail
59
60
61build_microkde: variable_test tmake
62 for i in $(SUBDIRS_MICROKDE); do pushd $$i; \
63 make -f Makefile$(PLATFORM) || exit 1; popd; \
64 done
65
66build_qtopia_plugin: build_microkde
67 for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \
68 make -f Makefile$(PLATFORM) || exit 1; popd; \
69 done
70
71build_opie_plugin: build_microkde
72 ifdef BUILD_NO_OPIE_PLUGIN
73 @echo ---> opie plugin not build.
74 else
75 for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \
76 make -f Makefile$(PLATFORM) || exit 1; popd; \
77 done
78 endif
79
80build_sharp_plugin: build_microkde
81 ifdef BUILD_NO_SHARP_PLUGIN
82 @echo ---> ldap plugin not build.
83 else
84 for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \
85 make -f Makefile$(PLATFORM) || exit 1; popd; \
86 done
87 endif
88
89build_ldap_plugin: build_microkde
90 ifdef BUILD_NO_LDAP_PLUGIN
91 @echo ---> ldap plugin not build.
92 else
93 for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \
94 make -f Makefile$(PLATFORM) || exit 1; popd; \
95 done
96 endif
97
98
99build_micromail: build_microkde
100 ifdef BUILD_NO_MICROMAIL
101 @echo ---> micromail not build.
102 else
103 for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \
104 make -f Makefile$(PLATFORM) || exit 1; popd; \
105 done
106 endif
107
108
109variable_info:
110 @echo --------------------------------------
111 @echo KDEPIM buildsystem, variableinfo...
112 @echo KDEPIMDIR=$(KDEPIMDIR)
113 @echo QTDIR=$(QTDIR)
114 @echo QPEDIR=$(QPEDIR)
115 @echo OPIEDIR=$(OPIEDIR)
116 @echo PLATFORM=$(PLATFORM)
117 @echo RELEASE_DEBUG=$(RELEASE_DEBUG)
118 @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL)
119 @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN)
120 @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN)
121 @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN)
122 ifndef BUILD_NO_SHARP_PLUGIN
123 @echo SHARPDTMSDK=$(SHARPDTMSDK)
124 endif
125 @echo --------------------------------------
126
127variable_test: variable_info
128 @echo KDEPIM buildsystem, variablecheck...
129 ifndef KDEPIMDIR
130 @echo KDEPIMDIR is not defined.
131 $(error KDEPIMDIR is not defined)
132 endif
133 ifndef PLATFORM
134 @echo PLATFORM is not defined.
135 $(error PLATFORM is not defined)
136 endif
137 ifdef BUILD_NO_LDAP_PLUGIN
138 @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN)
139 endif
140 ifdef BUILD_NO_OPIE_PLUGIN
141 @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN)
142 endif
143 ifdef BUILD_NO_MICROMAIL
144 @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL)
145 endif
146 ifdef BUILD_NO_SHARP_PLUGIN
147 @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN)
148 else
149 ifndef SHARPDTMSDK
150 @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK)
151 $(error SHARPDTMSDK is not defined)
152 endif
153 endif
154 @echo --------------------------------------
155
156
157objects:
158 for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done
159 for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done
160 mkdir -p libical/lib/$(PLATFORM)
161
162clean:
163 rm -rf libical/lib/$(PLATFORM)/*;
164 for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\
165 rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \
166 done
167install:
168 cd bin/kdepim; make install
169 cp db2file/db2file $(QPEDIR)/bin/db2file
170 cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop
171 cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop
172 cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kmicromail.desktop
173
174dist:
175 @echo Dont forget to do "make install" before "make dist"
176 rm -f *arm.ipk
177 rm -f *~
178 cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc kdepim
179 ./mkipks kmicrokdelibs.control
180 ./mkipks korganizer.control
181 ./mkipks kaddressbook.control
182 ifndef BUILD_NO_MICROMAIL
183 ./mkipks kopiemail.control
184 endif
185 ./mkipks korganizer-alarm.control
186
187tmake: objects \
188 qtcompat/Makefile$(PLATFORM) \
189 microkde/Makefile$(PLATFORM) \
190 libkcal/Makefile$(PLATFORM) \
191 libkdepim/Makefile$(PLATFORM) \
192 korganizer/Makefile$(PLATFORM) \
193 kalarmd/Makefile$(PLATFORM) \
194 libical/src/libical/Makefile$(PLATFORM) \
195 libical/src/libicalss/Makefile$(PLATFORM) \
196 kabc/Makefile$(PLATFORM) \
197 kabc/formats/binary/Makefile$(PLATFORM) \
198 kabc/plugins/file/Makefile$(PLATFORM) \
199 kabc/plugins/dir/Makefile$(PLATFORM) \
200 kabc/plugins/ldap/Makefile$(PLATFORM) \
201 kabc/plugins/opie/Makefile$(PLATFORM) \
202 kabc/plugins/qtopia/Makefile$(PLATFORM) \
203 kabc/plugins/sharpdtm/Makefile$(PLATFORM) \
204 kaddressbook/Makefile$(PLATFORM) \
205 kmicromail/Makefile$(PLATFORM) \
206 kmicromail/libetpan/Makefile$(PLATFORM) \
207 kmicromail/libmailwrapper/Makefile$(PLATFORM)
208
209
210
211
212qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
213 cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" qtcompat.pro -o Makefile$(PLATFORM)
214
215microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
216 cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" microkdeE.pro -o Makefile$(PLATFORM)
217
218libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro
219 cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" libkcalE.pro -o Makefile$(PLATFORM)
220
221
222libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro
223 cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" libkdepimE.pro -o Makefile$(PLATFORM)
224
225kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro
226 cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" kalarmdE.pro -o Makefile$(PLATFORM)
227
228korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro
229 cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" korganizerE.pro -o Makefile$(PLATFORM)
230
231libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
232 cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalE.pro -o Makefile$(PLATFORM)
233
234libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro
235 cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalssE.pro -o Makefile$(PLATFORM)
236
237kabc/Makefile$(PLATFORM): kabc/kabcE.pro
238 cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcE.pro -o Makefile$(PLATFORM)
239
240kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
241 cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
242
243kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro
244 cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" fileE.pro -o Makefile$(PLATFORM)
245
246kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro
247 cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" dirE.pro -o Makefile$(PLATFORM)
248
249kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro
250 cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" ldapE.pro -o Makefile$(PLATFORM)
251
252kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro
253 cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieE.pro -o Makefile$(PLATFORM)
254
255kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro
256 cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM)
257
258kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro
259 cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" sharpdtmE.pro -o Makefile$(PLATFORM)
260
261kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro
262 cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" kaddressbookE.pro -o Makefile$(PLATFORM)
263
264kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro
265 cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" kmicromailE.pro -o Makefile$(PLATFORM)
266
267kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro
268 cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" libetpanE.pro -o Makefile$(PLATFORM)
269
270kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro
271 cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" libmailwrapperE.pro -o Makefile$(PLATFORM)
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 547d02b..7eca69d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -930,24 +930,25 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
930 int changedLocal = 0; 930 int changedLocal = 0;
931 int changedRemote = 0; 931 int changedRemote = 0;
932 //QPtrList<Event> el = local->rawEvents(); 932 //QPtrList<Event> el = local->rawEvents();
933 Event* eventR; 933 Event* eventR;
934 QString uid; 934 QString uid;
935 int take; 935 int take;
936 Event* eventL; 936 Event* eventL;
937 Event* eventRSync; 937 Event* eventRSync;
938 Event* eventLSync; 938 Event* eventLSync;
939 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 939 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
940 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 940 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
941 bool fullDateRange = false; 941 bool fullDateRange = false;
942 local->resetTempSyncStat();
942 mLastCalendarSync = QDateTime::currentDateTime(); 943 mLastCalendarSync = QDateTime::currentDateTime();
943 QDateTime modifiedCalendar = mLastCalendarSync;; 944 QDateTime modifiedCalendar = mLastCalendarSync;;
944 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 945 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
945 if ( eventR ) { 946 if ( eventR ) {
946 eventRSync = (Event*) eventR->clone(); 947 eventRSync = (Event*) eventR->clone();
947 remote->deleteEvent(eventR ); 948 remote->deleteEvent(eventR );
948 949
949 } else { 950 } else {
950 fullDateRange = true; 951 fullDateRange = true;
951 eventRSync = new Event(); 952 eventRSync = new Event();
952 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 953 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
953 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 954 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 6bbc0a3..6276498 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -474,25 +474,25 @@ public:
474 // csum ***************************************** 474 // csum *****************************************
475 475
476 uint cSum; 476 uint cSum;
477 cSum = PhoneFormat::getCsumEvent( event ); 477 cSum = PhoneFormat::getCsumEvent( event );
478 event->setCsum( mProfileName, QString::number( cSum )); 478 event->setCsum( mProfileName, QString::number( cSum ));
479 event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); 479 event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
480 mCalendar->addEvent( event); 480 mCalendar->addEvent( event);
481 481
482 return true; 482 return true;
483 } 483 }
484 484
485 485
486 QDateTime fromGSM ( GSM_DateTime*dtp, bool useTz = true ) { 486 QDateTime fromGSM ( GSM_DateTime*dtp, bool useTz = false ) {
487 QDateTime dt; 487 QDateTime dt;
488 int y,m,t,h,min,sec; 488 int y,m,t,h,min,sec;
489 y = dtp->Year; 489 y = dtp->Year;
490 m = dtp->Month; 490 m = dtp->Month;
491 t = dtp->Day; 491 t = dtp->Day;
492 h = dtp->Hour; 492 h = dtp->Hour;
493 min = dtp->Minute; 493 min = dtp->Minute;
494 sec = dtp->Second; 494 sec = dtp->Second;
495 dt = QDateTime(QDate(y,m,t), QTime(h,min,sec)); 495 dt = QDateTime(QDate(y,m,t), QTime(h,min,sec));
496 // dtp->Timezone: offset in hours 496 // dtp->Timezone: offset in hours
497 int offset = KGlobal::locale()->localTimeOffset( dt ); 497 int offset = KGlobal::locale()->localTimeOffset( dt );
498 if ( useTz ) 498 if ( useTz )
@@ -773,67 +773,25 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
773 s.ConfigNum = 0; 773 s.ConfigNum = 0;
774 QLabel status ( i18n("Opening device ..."), 0 ); 774 QLabel status ( i18n("Opening device ..."), 0 );
775 int w = status.sizeHint().width()+20 ; 775 int w = status.sizeHint().width()+20 ;
776 if ( w < 200 ) w = 230; 776 if ( w < 200 ) w = 230;
777 int h = status.sizeHint().height()+20 ; 777 int h = status.sizeHint().height()+20 ;
778 int dw = QApplication::desktop()->width(); 778 int dw = QApplication::desktop()->width();
779 int dh = QApplication::desktop()->height(); 779 int dh = QApplication::desktop()->height();
780 status.setCaption(i18n("Reading phone...") ); 780 status.setCaption(i18n("Reading phone...") );
781 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 781 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
782 status.show(); 782 status.show();
783 status.raise(); 783 status.raise();
784 qApp->processEvents(); 784 qApp->processEvents();
785#if 0
786 static char*cp;
787 static INI_Section *cfg = NULL;
788 cfg=GSM_FindGammuRC();
789 int i;
790 for (i = 0; i <= MAX_CONFIG_NUM; i++) {
791 if (cfg!=NULL) {
792 cp = (char *)INI_GetValue(cfg, (unsigned char*) "gammu", (unsigned char*)"gammucoding", false);
793 if (cp) di.coding = cp;
794
795 s.Config[i].Localize = (char *)INI_GetValue(cfg, (unsigned char*) "gammu", (unsigned char*) "gammuloc", false);
796 if (s.Config[i].Localize) {
797 s.msg=INI_ReadFile(s.Config[i].Localize, true);
798 } else {
799#if !defined(WIN32) && defined(LOCALE_PATH)
800 locale = setlocale(LC_MESSAGES, NULL);
801 if (locale != NULL) {
802 snprintf(locale_file, 200, "%s/gammu_%c%c.txt",
803 LOCALE_PATH,
804 tolower(locale[0]),
805 tolower(locale[1]));
806 s.msg = INI_ReadFile(locale_file, true);
807 }
808#endif
809 }
810 }
811
812 /* Wanted user specific configuration? */
813
814 if (!GSM_ReadConfig(cfg, &s.Config[i], i) && i != 0) break;
815
816 s.ConfigNum++;
817
818 /* We want to use only one file descriptor for global and state machine debug output */
819 s.Config[i].UseGlobalDebugFile = true;
820
821
822 785
823 /* We wanted to read just user specified configuration. */
824 {break;}
825 }
826
827#endif
828 int error=initDevice(&s); 786 int error=initDevice(&s);
829 qDebug("GSM Init %d (no error is %d)", error, ERR_NONE); 787 qDebug("GSM Init %d (no error is %d)", error, ERR_NONE);
830 if ( error != ERR_NONE ) 788 if ( error != ERR_NONE )
831 return false; 789 return false;
832 GSM_Phone_Functions*Phone; 790 GSM_Phone_Functions*Phone;
833 GSM_CalendarEntrynote; 791 GSM_CalendarEntrynote;
834 bool start = true; 792 bool start = true;
835 Phone=s.Phone.Functions; 793 Phone=s.Phone.Functions;
836 bool gshutdown = false; 794 bool gshutdown = false;
837 PhoneParser handler( calendar, mProfileName ); 795 PhoneParser handler( calendar, mProfileName );
838 int ccc = 0; 796 int ccc = 0;
839 QString message = i18n(" Reading event # "); 797 QString message = i18n(" Reading event # ");
@@ -904,35 +862,36 @@ void PhoneFormat::todo2GSM( Calendar *cal, Todo* todo, GSM_ToDoEntry *gsmTodo )
904 GSM_DecodeVCALENDAR_VTODO( (unsigned char*) ba.data(), &pos, &dummy, gsmTodo, Nokia_VCalendar, Nokia_VToDo ); 862 GSM_DecodeVCALENDAR_VTODO( (unsigned char*) ba.data(), &pos, &dummy, gsmTodo, Nokia_VCalendar, Nokia_VToDo );
905 qDebug( "Convert todo done "); 863 qDebug( "Convert todo done ");
906 gsmTodo->Location = 0; 864 gsmTodo->Location = 0;
907 QString loc = todo->getID(mProfileName); 865 QString loc = todo->getID(mProfileName);
908 if ( !loc.isEmpty() ){ 866 if ( !loc.isEmpty() ){
909 gsmTodo->Location = loc.toInt(); 867 gsmTodo->Location = loc.toInt();
910 } 868 }
911 869
912} 870}
913void PhoneFormat::afterSave( Incidence* inc) 871void PhoneFormat::afterSave( Incidence* inc)
914{ 872{
915 uint csum; 873 uint csum;
874 inc->removeID( mProfileName );
916 if ( inc->type() == "Event") 875 if ( inc->type() == "Event")
917 csum = PhoneFormat::getCsumEvent( (Event*) inc ); 876 csum = PhoneFormat::getCsumEvent( (Event*) inc );
918 else 877 else
919 csum = PhoneFormat::getCsumTodo( (Todo*) inc ); 878 csum = PhoneFormat::getCsumTodo( (Todo*) inc );
920 inc->setCsum( mProfileName, QString::number( csum )); 879 inc->setCsum( mProfileName, QString::number( csum ));
921 inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 880 inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
922 881
923} 882}
924bool PhoneFormat::save( Calendar *calendar) 883bool PhoneFormat::save( Calendar *calendar)
925{ 884{
926 return true; 885
927 GSM_StateMachines; 886 GSM_StateMachines;
928 qDebug(" save "); 887 qDebug(" save ");
929 s.opened = false; 888 s.opened = false;
930 s.msg = NULL; 889 s.msg = NULL;
931 s.ConfigNum = 0; 890 s.ConfigNum = 0;
932 QLabel status ( i18n(" Opening device ..."), 0 ); 891 QLabel status ( i18n(" Opening device ..."), 0 );
933 int w = status.sizeHint().width()+20 ; 892 int w = status.sizeHint().width()+20 ;
934 if ( w < 200 ) w = 230; 893 if ( w < 200 ) w = 230;
935 int h = status.sizeHint().height()+20 ; 894 int h = status.sizeHint().height()+20 ;
936 int dw = QApplication::desktop()->width(); 895 int dw = QApplication::desktop()->width();
937 int dh = QApplication::desktop()->height(); 896 int dh = QApplication::desktop()->height();
938 status.setCaption(i18n("Writing to phone...") ); 897 status.setCaption(i18n("Writing to phone...") );
@@ -943,61 +902,333 @@ bool PhoneFormat::save( Calendar *calendar)
943 902
944 int error=initDevice(&s); 903 int error=initDevice(&s);
945 qDebug("GSM Init %d (no error is %d)", error, ERR_NONE); 904 qDebug("GSM Init %d (no error is %d)", error, ERR_NONE);
946 if ( error != ERR_NONE ) 905 if ( error != ERR_NONE )
947 return false; 906 return false;
948 GSM_Phone_Functions*Phone; 907 GSM_Phone_Functions*Phone;
949 GSM_CalendarEntryNote; 908 GSM_CalendarEntryNote;
950 bool start = true; 909 bool start = true;
951 Phone=s.Phone.Functions; 910 Phone=s.Phone.Functions;
952 bool gshutdown = false; 911 bool gshutdown = false;
953 QPtrList<Event> er = calendar->rawEvents(); 912 QPtrList<Event> er = calendar->rawEvents();
954 Event* ev = er.first(); 913 Event* ev = er.first();
955 QString message = i18n(" Processing event # "); 914 QString message = i18n(" Deleting event # ");
956 int procCount = 0; 915 int procCount = 0;
957 bool planB = true;// false; 916 int diffProc = 0;
917 bool setPossible = true;
918#ifdef _WIN32_
919 QString fileName = locateLocal("data", "korganizer") + "\\tempfile.vcs";
920#else
921 QString fileName = "/tmp/kdepimtemp.vcs";
922#endif
923 //algo 1 delete event
924 while ( ev ) {
925 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { // event was changed during sync or is a new one
926
927 status.setText ( message + QString::number ( ++procCount ) );
928 qApp->processEvents();
929 qDebug("del event1 %d ", procCount);
930 //event2GSM( calendar, ev, &Note );
931 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete
932
933 QString loc = ev->getID(mProfileName);
934 if ( !loc.isEmpty() ){
935 Note.Location = loc.toInt();
936 } else {
937 qDebug("error: loc is empty ");
938 }
939 error = Phone->DeleteCalendar(&s, &Note);
940 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
941 qDebug(" e error delete1 planB %d ", error);
942 break;
943 }
944 }
945 else if ( ev->getID(mProfileName).isEmpty() ) { // add new
946 // we have to do this later after deleting
947
948 }
949 else { // change existing
950
951 QString loc = ev->getID(mProfileName);
952 if ( !loc.isEmpty() ){
953 Note.Location = loc.toInt();
954 } else {
955 qDebug("error3: loc is empty ");
956 }
957 error = Phone->DeleteCalendar(&s, &Note);
958 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
959 qDebug(" e error delete2 planB %d ", error);
960 break;
961 }
962 ev->removeID( mProfileName );
963 }
964 }
965 ev = er.next();
966 }
967 //algo 1 delete todo
968 GSM_ToDoEntry ToDoEntry;
969 QPtrList<Todo> tl = calendar->rawTodos();
970 Todo* to = tl.first();
971 message = i18n(" Deleting todo # ");
972 procCount = 0;
973 while ( to ) {
974 if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
975 qDebug("todo3 %d ", procCount);
976 status.setText ( message + QString::number ( ++procCount ) );
977 qApp->processEvents();
978 qDebug("todo5 %d ", procCount);
979 // todo2GSM( calendar, to, &ToDoEntry );
980 QString loc = to->getID(mProfileName);
981 if ( !loc.isEmpty() ){
982 ToDoEntry.Location = loc.toInt();
983 } else {
984 qDebug("error2: loc is empty ");
985 }
986 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete
987 error=Phone->DeleteToDo(&s,&ToDoEntry);
988 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
989 qDebug("delete planB %d ", error);
990 }
991 }
992 else if ( to->getID(mProfileName).isEmpty() ) { // add new
993 ;
994 }
995 else { // change existing
996 error=Phone->DeleteToDo(&s,&ToDoEntry);
997 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
998 qDebug("set planB %d ", error);
999 }
1000 to->removeID( mProfileName );
1001 }
1002 }
1003 to = tl.next();
1004 }
1005 //algo 2 add event
1006 ev = er.first();
1007 QString filec;
1008 message = i18n(" Preparing event # ");
1009 procCount = 0;
1010 while ( ev ) {
1011 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL && ev->tempSyncStat() != SYNC_TEMPSTATE_DELETE) {
1012 if ( ev->getID(mProfileName).isEmpty() ) {
1013 status.setText ( message + QString::number ( ++procCount ) );
1014 qApp->processEvents();
1015 filec += vfconverter.eventToString( ev, calendar )+ "\n";
1016 afterSave ( ev );
1017
1018 }
1019 }
1020 ev = er.next();
1021 }
1022 //algo 2 add todo
1023 to = tl.first();
1024 procCount = 0;
1025 message = i18n(" Preparing todo # ");
1026 while ( to ) {
1027 qDebug("todo2 %d ", procCount);
1028 if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL && to->tempSyncStat() != SYNC_TEMPSTATE_DELETE) {
1029 qDebug("todo4 %d ", procCount);
1030 if ( to->getID(mProfileName).isEmpty() ) {
1031 status.setText ( message + QString::number ( ++procCount ) );
1032 qApp->processEvents();
1033 filec += vfconverter.todoToString( to, calendar )+ "\n";
1034 afterSave ( to );
1035 }
1036 }
1037 to = tl.next();
1038 }
1039 if ( filec.isEmpty() ) {
1040 qDebug("Nothing to write back.Finished. ");
1041 error=GSM_TerminateConnection(&s);
1042 return true;
1043 }
1044 //algo 3 saving file
1045 message = i18n(" Saving temp file ... ");
1046 status.setText ( message );
1047 qApp->processEvents();
1048 QFile file( fileName );
1049 if (!file.open( IO_WriteOnly ) ) {
1050 qDebug("error open file ");
1051 error=GSM_TerminateConnection(&s);
1052 return false;
1053 }
1054 QTextStream ts( &file );
1055 ts.setCodec( QTextCodec::codecForName("utf8") );
1056 ts << filec ;
1057 file.close();
1058
1059
1060 message = i18n(" Parsing temp file ... ");
1061 status.setText ( message );
1062 qApp->processEvents();
1063 GSM_Backup Backup;
1064 error=GSM_ReadBackupFile( (char*) fileName.latin1() ,&Backup);
1065 qDebug("Read file result %d ",error );
1066 //algo 4 writing event
1067 int max, i;
1068 procCount = 0;
1069 message = i18n(" Writing event # ");
1070 if (Backup.Calendar[0] != NULL) {
1071 max = 0;
1072 while (Backup.Calendar[max]!=NULL) max++;
1073 for (i=0;i<max;i++) {
1074 status.setText ( message + QString::number ( ++procCount ) );
1075 qApp->processEvents();
1076 Note = *Backup.Calendar[i];
1077 Note.Location = 0;
1078 error=Phone->AddCalendar(&s,&Note);
1079 qDebug("add event %d %d", error, Note.Location );
1080 }
1081 }
1082 //algo 4 writing todo
1083 procCount = 0;
1084 message = i18n(" Writing todo # ");
1085 if (Backup.ToDo[0] != NULL) {
1086 max = 0;
1087 while (Backup.ToDo[max]!=NULL) max++;
1088 for (i=0;i<max;i++) {
1089 status.setText ( message + QString::number ( ++procCount ) );
1090 qApp->processEvents();
1091 ToDoEntry = *Backup.ToDo[i];
1092 error = Phone->AddToDo(&s,&ToDoEntry);
1093 qDebug("add todo %d ", error);
1094 }
1095 }
1096 //algo 5 reread
1097 message = i18n(" Rereading all data ... ");
1098 status.setText ( message );
1099 qApp->processEvents();
1100 error=GSM_TerminateConnection(&s);
1101 CalendarLocal* calendarTemp = new CalendarLocal();
1102 calendarTemp->setTimeZoneId( calendar->timeZoneId());
1103 if ( ! load( calendarTemp,calendar) ){
1104 qDebug("error reloading calendar ");
1105 delete calendarTemp;
1106 return false;
1107 }
1108
1109
1110 //algo 6 compare event
1111 ev = er.first();
1112 message = i18n(" Comparing event # ");
1113 QPtrList<Event> er1 = calendarTemp->rawEvents();
1114 Event* ev1;
1115 procCount = 0;
1116 while ( ev ) {
1117 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID) {
1118 qDebug("event new ID ");
1119 status.setText ( message + QString::number ( ++procCount ) );
1120 qApp->processEvents();
1121 QString cSum = ev->getCsum(mProfileName);
1122 ev1 = er1.first();
1123 while ( ev1 ) {
1124 if ( ev1->getCsum( mProfileName ) == cSum ) {
1125 er1.remove( ev1 );
1126 ev->setID(mProfileName, ev1->getID(mProfileName) );
1127 break;
1128 }
1129 ev1 = er1.next();
1130 }
1131 if ( ! ev1 ) {
1132 ev->removeID(mProfileName);
1133 qDebug("ERROR: No event found on phone for %s ", ev->summary().latin1());
1134 qDebug("Probably writing back of events not supported ");
1135 }
1136
1137 }
1138 ev = er.next();
1139 }
1140 //algo 6 compare todo
1141 to = tl.first();
1142 procCount = 0;
1143 QPtrList<Todo> tl1 = calendarTemp->rawTodos();
1144 Todo* to1 ;
1145 message = i18n(" Comparing todo # ");
1146 while ( to ) {
1147 qDebug("todo2 %d ", procCount);
1148 if ( to->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID) {
1149 status.setText ( message + QString::number ( ++procCount ) );
1150 qApp->processEvents();
1151 QString cSum = to->getCsum(mProfileName);
1152 Todo* to1 = tl1.first();
1153 while ( to1 ) {
1154 if ( to1->getCsum( mProfileName ) == cSum ) {
1155 tl1.remove( to1 );
1156 to->setID(mProfileName, to1->getID(mProfileName) );
1157 break;
1158 }
1159 to1 = tl1.next();
1160 }
1161 if ( ! to1 ) {
1162 to->removeID(mProfileName);
1163 qDebug("ERROR: No todo found on phone for %s ", to->summary().latin1());
1164 qDebug("Probably writing back of todos not supported ");
1165 }
1166 }
1167 to = tl.next();
1168 }
1169 delete calendarTemp;
1170 return true;
1171 // *******************************************************************
1172 // *******************************************************************
1173 // *******************************************************************
1174#if 0
958 while ( ev && ! planB) { 1175 while ( ev && ! planB) {
959 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { // event was changed during sync or is a new one 1176 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { // event was changed during sync or is a new one
960 1177
961 status.setText ( message + QString::number ( ++procCount ) ); 1178 status.setText ( message + QString::number ( ++procCount ) );
962 qApp->processEvents(); 1179 qApp->processEvents();
963 qDebug("event1 %d ", procCount); 1180 qDebug("event1 %d ", procCount);
964 event2GSM( calendar, ev, &Note ); 1181 event2GSM( calendar, ev, &Note );
965 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete 1182 if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete
966 error = Phone->DeleteCalendar(&s, &Note); 1183 error = Phone->DeleteCalendar(&s, &Note);
967 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { 1184 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
968 planB = true; 1185 planB = true;
969 qDebug(" e delete planB %d ", error); 1186 qDebug(" e delete1 planB %d ", error);
970 break; 1187 break;
971 } 1188 }
972 } 1189 }
973 else if ( ev->getID(mProfileName).isEmpty() ) { // add new 1190 else if ( ev->getID(mProfileName).isEmpty() ) { // add new
974 // we have to do this later after deleting 1191 // we have to do this later after deleting
975 1192
976 } 1193 }
977 else { // change existing 1194 else { // change existing
978 error = Phone->SetCalendar(&s, &Note); 1195 if ( setPossible ) {
979 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { 1196 error = Phone->SetCalendar(&s, &Note);
980 planB = true; 1197 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
981 qDebug(" e change planB %d ", error); 1198 setPossible = false;
982 break; 1199 ++diffProc;
1200 qDebug("Set cal not supported %d ", error);
1201 break;
1202 }
1203 }
1204 if ( ! setPossible) {
1205 ++diffProc;
1206 error = Phone->DeleteCalendar(&s, &Note);
1207 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
1208 planB = true;
1209 qDebug(" e delete2 planB %d ", error);
1210 break;
1211 }
1212 ev->removeID( mProfileName );
983 } 1213 }
984 qDebug("Change Calendar. Location %d status: %d",Note.Location, error ); 1214 qDebug("Change Calendar. Location %d status: %d",Note.Location, error );
985 } 1215 }
986 } 1216 }
987 ev = er.next(); 1217 ev = er.next();
988 } 1218 }
989 ev = er.first(); 1219 ev = er.first();
990 // pending get empty slots 1220 // pending get empty slots
991 int loc = 0; 1221 int loc = 0;
1222 procCount -= diffProc;
992 while ( ev && ! planB) { 1223 while ( ev && ! planB) {
993 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL && ev->tempSyncStat() != SYNC_TEMPSTATE_DELETE) { 1224 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL && ev->tempSyncStat() != SYNC_TEMPSTATE_DELETE) {
994 qDebug("event2 %d ", procCount); 1225 qDebug("event2 %d ", procCount);
995 if ( ev->getID(mProfileName).isEmpty() ) { 1226 if ( ev->getID(mProfileName).isEmpty() ) {
996 status.setText ( message + QString::number ( ++procCount ) ); 1227 status.setText ( message + QString::number ( ++procCount ) );
997 qApp->processEvents(); 1228 qApp->processEvents();
998 //int newID ;//= pending 1229 //int newID ;//= pending
999 //ev->setID(mProfileName, QString::number( newID )); 1230 //ev->setID(mProfileName, QString::number( newID ));
1000 event2GSM( calendar, ev, &Note ); 1231 event2GSM( calendar, ev, &Note );
1001 ++loc; 1232 ++loc;
1002 Note.Location = loc; 1233 Note.Location = loc;
1003 error = Phone->AddCalendar(&s, &Note); 1234 error = Phone->AddCalendar(&s, &Note);
@@ -1164,24 +1395,25 @@ bool PhoneFormat::save( Calendar *calendar)
1164 } else { 1395 } else {
1165 qDebug("adding %d planB %d ", ToDoEntry.Location ,error); 1396 qDebug("adding %d planB %d ", ToDoEntry.Location ,error);
1166 to->setID(mProfileName, QString::number( ToDoEntry.Location )); 1397 to->setID(mProfileName, QString::number( ToDoEntry.Location ));
1167 afterSave( to ); 1398 afterSave( to );
1168 } 1399 }
1169 to = tl.next(); 1400 to = tl.next();
1170 } 1401 }
1171 if ( planC ) { 1402 if ( planC ) {
1172 // we have currently no planC :-( 1403 // we have currently no planC :-(
1173 } 1404 }
1174 } 1405 }
1175 return true; 1406 return true;
1407#endif
1176} 1408}
1177QString PhoneFormat::dtToGSM( const QDateTime& dti, bool useTZ ) 1409QString PhoneFormat::dtToGSM( const QDateTime& dti, bool useTZ )
1178{ 1410{
1179 QString datestr; 1411 QString datestr;
1180 QString timestr; 1412 QString timestr;
1181 int offset = KGlobal::locale()->localTimeOffset( dti ); 1413 int offset = KGlobal::locale()->localTimeOffset( dti );
1182 QDateTime dt; 1414 QDateTime dt;
1183 if (useTZ) 1415 if (useTZ)
1184 dt = dti.addSecs ( -(offset*60)); 1416 dt = dti.addSecs ( -(offset*60));
1185 else 1417 else
1186 dt = dti; 1418 dt = dti;
1187 if(dt.date().isValid()){ 1419 if(dt.date().isValid()){
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index defdb09..820d068 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -498,25 +498,25 @@ bool SharpFormat::save( Calendar *calendar)
498 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 498 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
499 status.show(); 499 status.show();
500 status.raise(); 500 status.raise();
501 qApp->processEvents(); 501 qApp->processEvents();
502 bool debug = DEBUGMODE; 502 bool debug = DEBUGMODE;
503 QString codec = "utf8"; 503 QString codec = "utf8";
504 QString answer; 504 QString answer;
505 QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n"; 505 QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n";
506 QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n"; 506 QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n";
507 QString command; 507 QString command;
508 QPtrList<Event> er = calendar->rawEvents(); 508 QPtrList<Event> er = calendar->rawEvents();
509 Event* ev = er.first(); 509 Event* ev = er.first();
510 QString fileName = "/tmp/kopitempout"; 510 QString fileName = "/tmp/kdepimtempfile";
511 int i = 0; 511 int i = 0;
512 QString changeString = ePrefix; 512 QString changeString = ePrefix;
513 QString deleteString = ePrefix; 513 QString deleteString = ePrefix;
514 bool deleteEnt = false; 514 bool deleteEnt = false;
515 bool changeEnt = false; 515 bool changeEnt = false;
516 QString message = i18n("Processing event # "); 516 QString message = i18n("Processing event # ");
517 int procCount = 0; 517 int procCount = 0;
518 while ( ev ) { 518 while ( ev ) {
519 //qDebug("i %d ", ++i); 519 //qDebug("i %d ", ++i);
520 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { 520 if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
521 status.setText ( message + QString::number ( ++procCount ) ); 521 status.setText ( message + QString::number ( ++procCount ) );
522 qApp->processEvents(); 522 qApp->processEvents();
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 076cd3f..9307f12 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -338,40 +338,42 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
338 } 338 }
339 if (!tmpStr.isEmpty()) { 339 if (!tmpStr.isEmpty()) {
340 tmpStr.truncate(tmpStr.length()-1); 340 tmpStr.truncate(tmpStr.length()-1);
341 addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit()); 341 addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit());
342 } 342 }
343 343
344 // alarm stuff 344 // alarm stuff
345 kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl; 345 kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl;
346 QPtrList<Alarm> alarms = anEvent->alarms(); 346 QPtrList<Alarm> alarms = anEvent->alarms();
347 Alarm* alarm; 347 Alarm* alarm;
348 for (alarm = alarms.first(); alarm; alarm = alarms.next()) { 348 for (alarm = alarms.first(); alarm; alarm = alarms.next()) {
349 if (alarm->enabled()) { 349 if (alarm->enabled()) {
350 VObject *a = addProp(vtodo, VCDAlarmProp); 350 VObject *a;
351 tmpStr = qDateTimeToISO(alarm->time()); 351 tmpStr = qDateTimeToISO(alarm->time());
352 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 352 if (alarm->type() == Alarm::Audio) {
353 addPropValue(a, VCRepeatCountProp, "1"); 353 a = addProp(vtodo, VCAAlarmProp);
354 addPropValue(a, VCDisplayStringProp, "beep!"); 354 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
355 if (alarm->type() == Alarm::Audio) { 355 addPropValue(a, VCRepeatCountProp, "1");
356 a = addProp(vtodo, VCAAlarmProp); 356 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile()));
357 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 357 }
358 addPropValue(a, VCRepeatCountProp, "1"); 358 else if (alarm->type() == Alarm::Procedure) {
359 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); 359 a = addProp(vtodo, VCPAlarmProp);
360 } 360 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
361 else if (alarm->type() == Alarm::Procedure) { 361 addPropValue(a, VCRepeatCountProp, "1");
362 a = addProp(vtodo, VCPAlarmProp); 362 addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile()));
363 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 363 } else {
364 addPropValue(a, VCRepeatCountProp, "1"); 364 a = addProp(vtodo, VCDAlarmProp);
365 addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); 365 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
366 addPropValue(a, VCRepeatCountProp, "1");
367 addPropValue(a, VCDisplayStringProp, "beep!");
366 } 368 }
367 } 369 }
368 } 370 }
369 371
370 if (anEvent->pilotId()) { 372 if (anEvent->pilotId()) {
371 // pilot sync stuff 373 // pilot sync stuff
372 tmpStr.sprintf("%i",anEvent->pilotId()); 374 tmpStr.sprintf("%i",anEvent->pilotId());
373 addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit()); 375 addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit());
374 tmpStr.sprintf("%i",anEvent->syncStatus()); 376 tmpStr.sprintf("%i",anEvent->syncStatus());
375 addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit()); 377 addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit());
376 } 378 }
377 379
@@ -616,41 +618,44 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent)
616 addPropValue(vevent, VCAttachProp, at->uri().local8Bit()); 618 addPropValue(vevent, VCAttachProp, at->uri().local8Bit());
617 619
618 // resources 620 // resources
619 tmpStrList = anEvent->resources(); 621 tmpStrList = anEvent->resources();
620 tmpStr = tmpStrList.join(";"); 622 tmpStr = tmpStrList.join(";");
621 if (!tmpStr.isEmpty()) 623 if (!tmpStr.isEmpty())
622 addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit()); 624 addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit());
623 625
624 // alarm stuff 626 // alarm stuff
625 QPtrList<Alarm> alarms = anEvent->alarms(); 627 QPtrList<Alarm> alarms = anEvent->alarms();
626 Alarm* alarm; 628 Alarm* alarm;
627 for (alarm = alarms.first(); alarm; alarm = alarms.next()) { 629 for (alarm = alarms.first(); alarm; alarm = alarms.next()) {
628 if (alarm->enabled()) { 630 if (alarm->enabled()) {
629 VObject *a = addProp(vevent, VCDAlarmProp); 631 VObject *a ;
630 tmpStr = qDateTimeToISO(alarm->time()); 632 tmpStr = qDateTimeToISO(alarm->time());
631 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 633 if (alarm->type() == Alarm::Audio) {
632 addPropValue(a, VCRepeatCountProp, "1"); 634 a = addProp(vevent, VCAAlarmProp);
633 addPropValue(a, VCDisplayStringProp, "beep!"); 635 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
634 if (alarm->type() == Alarm::Audio) { 636 addPropValue(a, VCRepeatCountProp, "1");
635 a = addProp(vevent, VCAAlarmProp); 637 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile()));
636 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 638 }
637 addPropValue(a, VCRepeatCountProp, "1"); 639 if (alarm->type() == Alarm::Procedure) {
638 addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); 640 a = addProp(vevent, VCPAlarmProp);
639 } 641 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
640 if (alarm->type() == Alarm::Procedure) { 642 addPropValue(a, VCRepeatCountProp, "1");
641 a = addProp(vevent, VCPAlarmProp); 643 addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile()));
642 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 644 } else {
643 addPropValue(a, VCRepeatCountProp, "1"); 645 a = addProp(vevent, VCDAlarmProp);
644 addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); 646 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
647 addPropValue(a, VCRepeatCountProp, "1");
648 addPropValue(a, VCDisplayStringProp, "beep!");
649
645 } 650 }
646 } 651 }
647 } 652 }
648 653
649 // priority 654 // priority
650 tmpStr.sprintf("%i",anEvent->priority()); 655 tmpStr.sprintf("%i",anEvent->priority());
651 addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit()); 656 addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit());
652 657
653 // transparency 658 // transparency
654 tmpStr.sprintf("%i",anEvent->transparency()); 659 tmpStr.sprintf("%i",anEvent->transparency());
655 addPropValue(vevent, VCTranspProp, tmpStr.local8Bit()); 660 addPropValue(vevent, VCTranspProp, tmpStr.local8Bit());
656 661
diff --git a/microkde/kidmanager.cpp b/microkde/kidmanager.cpp
index d24a41f..8cf486a 100644
--- a/microkde/kidmanager.cpp
+++ b/microkde/kidmanager.cpp
@@ -13,100 +13,100 @@ QString KIdManager::setId (const QString& idString,const QString& prof,const QSt
13 int startIDnumlen; 13 int startIDnumlen;
14 int startID; 14 int startID;
15 int lenID; 15 int lenID;
16 int startCsum; 16 int startCsum;
17 int lenCsum; 17 int lenCsum;
18 int endall; 18 int endall;
19 QString newIDString; 19 QString newIDString;
20 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) { 20 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) {
21 newIDString = idString.left(startIDnum ) + QString::number( idvalue.length() ) +";"+idvalue+ ";"+idString.mid( startCsum ); 21 newIDString = idString.left(startIDnum ) + QString::number( idvalue.length() ) +";"+idvalue+ ";"+idString.mid( startCsum );
22 } else { 22 } else {
23 newIDString = idString + prof+";"+ QString::number( idvalue.length() ) +";"+idvalue +";0:"; 23 newIDString = idString + prof+";"+ QString::number( idvalue.length() ) +";"+idvalue +";0:";
24 } 24 }
25 qDebug("setID:profile:%s*retval:%s*idvalue:%s* ", prof.latin1(), newIDString.latin1() ,idvalue.latin1() ); 25 //qDebug("setID:profile:%s*retval:%s*idvalue:%s* ", prof.latin1(), newIDString.latin1() ,idvalue.latin1() );
26 return newIDString; 26 return newIDString;
27} 27}
28QString KIdManager::getId (const QString& idString,const QString& prof ) 28QString KIdManager::getId (const QString& idString,const QString& prof )
29{ 29{
30 int startProf; 30 int startProf;
31 int startIDnum; 31 int startIDnum;
32 int startIDnumlen; 32 int startIDnumlen;
33 int startID; 33 int startID;
34 int lenID; 34 int lenID;
35 int startCsum; 35 int startCsum;
36 int lenCsum; 36 int lenCsum;
37 int endall; 37 int endall;
38 QString idval = ""; 38 QString idval = "";
39 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) 39 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) )
40 idval = idString.mid( startID, lenID ); 40 idval = idString.mid( startID, lenID );
41 41
42 qDebug("getID:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() ); 42 //qDebug("getID:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() );
43 return idval; 43 return idval;
44 44
45} 45}
46 46
47QString KIdManager::removeId (const QString& idString,const QString& prof ) 47QString KIdManager::removeId (const QString& idString,const QString& prof )
48{ 48{
49 int startProf; 49 int startProf;
50 int startIDnum; 50 int startIDnum;
51 int startIDnumlen; 51 int startIDnumlen;
52 int startID; 52 int startID;
53 int lenID; 53 int lenID;
54 int startCsum; 54 int startCsum;
55 int lenCsum; 55 int lenCsum;
56 int endall; 56 int endall;
57 QString newIDString; 57 QString newIDString;
58 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) { 58 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) {
59 newIDString = idString.left(startProf) + idString.mid( endall ); 59 newIDString = idString.left(startProf) + idString.mid( endall+1 );
60 } else { 60 } else {
61 newIDString = idString; 61 newIDString = idString;
62 } 62 }
63 qDebug("removeID:profile:%s*retval:%s*oldidstring:%s* ", prof.latin1(), newIDString.latin1() ,idString.latin1() ); 63 //qDebug("removeID:profile:%s*retval:%s*oldidstring:%s* ", prof.latin1(), newIDString.latin1() ,idString.latin1() );
64 return newIDString; 64 return newIDString;
65} 65}
66 66
67QString KIdManager::setCsum (const QString& idString,const QString& prof,const QString& idCsum ) 67QString KIdManager::setCsum (const QString& idString,const QString& prof,const QString& idCsum )
68{ 68{
69 int startProf; 69 int startProf;
70 int startIDnum; 70 int startIDnum;
71 int startIDnumlen; 71 int startIDnumlen;
72 int startID; 72 int startID;
73 int lenID; 73 int lenID;
74 int startCsum; 74 int startCsum;
75 int lenCsum; 75 int lenCsum;
76 int endall; 76 int endall;
77 QString newIDString; 77 QString newIDString;
78 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) { 78 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) {
79 newIDString = idString.left(startCsum) + idCsum+ idString.mid( endall +1); 79 newIDString = idString.left(startCsum) + idCsum+ idString.mid( endall +1);
80 } else { 80 } else {
81 newIDString = idString + prof + ";3;_u_;"+ idCsum + ":"; 81 newIDString = idString + prof + ";3;_u_;"+ idCsum + ":";
82 } 82 }
83 qDebug("setCsum:profile:%s*retval:%s*idCsum:%s* ", prof.latin1(), newIDString.latin1() ,idCsum.latin1() ); 83 //qDebug("setCsum:profile:%s*retval:%s*idCsum:%s* ", prof.latin1(), newIDString.latin1() ,idCsum.latin1() );
84 return newIDString; 84 return newIDString;
85} 85}
86QString KIdManager::getCsum (const QString& idString,const QString& prof ) 86QString KIdManager::getCsum (const QString& idString,const QString& prof )
87{ 87{
88 int startProf; 88 int startProf;
89 int startIDnum; 89 int startIDnum;
90 int startIDnumlen; 90 int startIDnumlen;
91 int startID; 91 int startID;
92 int lenID; 92 int lenID;
93 int startCsum; 93 int startCsum;
94 int lenCsum; 94 int lenCsum;
95 int endall; 95 int endall;
96 QString idval = ""; 96 QString idval = "";
97 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) ) 97 if ( KIdManager::getNumbers (idString, prof, startProf, startIDnum, startIDnumlen,startID, lenID, startCsum, lenCsum, endall) )
98 idval = idString.mid( startCsum, lenCsum ); 98 idval = idString.mid( startCsum, lenCsum );
99 99
100 qDebug("getCsum:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() ); 100 //qDebug("getCsum:profile:%s*retval:%s*idstring:%s* ", prof.latin1(), idval.latin1() ,idString.latin1() );
101 return idval; 101 return idval;
102} 102}
103// :profilename;12;id_withLen12;123456: 103// :profilename;12;id_withLen12;123456:
104bool KIdManager::getNumbers (const QString& idString,const QString& prof, int &startProf, int &startIDnum, int &startIDnumlen,int &startID, int& lenID, int &startCsum, int &lenCsum, int & endall) 104bool KIdManager::getNumbers (const QString& idString,const QString& prof, int &startProf, int &startIDnum, int &startIDnumlen,int &startID, int& lenID, int &startCsum, int &lenCsum, int & endall)
105{ 105{
106 startProf = idString.find( ":"+prof+";" ); 106 startProf = idString.find( ":"+prof+";" );
107 if ( startProf >= 0 ) { 107 if ( startProf >= 0 ) {
108 startIDnum = prof.length()+2+startProf; 108 startIDnum = prof.length()+2+startProf;
109 startID = idString.find( ";", startIDnum ) +1; 109 startID = idString.find( ";", startIDnum ) +1;
110 startIDnumlen = startID - startIDnum - 1; 110 startIDnumlen = startID - startIDnum - 1;
111 if ( startIDnum > 0 ) { 111 if ( startIDnum > 0 ) {
112 bool ok; 112 bool ok;
@@ -120,17 +120,17 @@ bool KIdManager::getNumbers (const QString& idString,const QString& prof, int &s
120 } 120 }
121 lenCsum = endall-startCsum+1; 121 lenCsum = endall-startCsum+1;
122 } 122 }
123 else { 123 else {
124 qDebug("Error getNumbers:length is no number:*%s* ", idString.mid ( startIDnum,startIDnumlen).toInt( &ok )); 124 qDebug("Error getNumbers:length is no number:*%s* ", idString.mid ( startIDnum,startIDnumlen).toInt( &ok ));
125 return false; 125 return false;
126 } 126 }
127 } else { 127 } else {
128 qDebug("Error in KIdManager::getNumbers.startIDnum <= 0"); 128 qDebug("Error in KIdManager::getNumbers.startIDnum <= 0");
129 return false; 129 return false;
130 } 130 }
131 } else { 131 } else {
132 qDebug("getnumbers: profile not found *%s* ",prof.latin1() ); 132 //qDebug("getnumbers: profile not found *%s* ",prof.latin1() );
133 return false; 133 return false;
134 } 134 }
135 return true; 135 return true;
136} 136}