-rw-r--r-- | Makefile | 507 | ||||
-rw-r--r-- | kde2file/caldump/main.cpp | 4 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 44 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 1 |
4 files changed, 219 insertions, 337 deletions
@@ -1,338 +1,171 @@ | |||
1 | export KDEPIMDIR = $(shell pwd) | 1 | ############################################################################# |
2 | 2 | # Makefile for building: kdepim-desktop | |
3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) | 3 | # Generated by qmake (1.07a) (Qt 3.3.3) on: Sat Oct 16 22:32:03 2004 |
4 | 4 | # Project: kdepim-desktop.pro | |
5 | ifeq ($(PLATFORM) , zaurus) | 5 | # Template: subdirs |
6 | BUILD_NO_LDAP_PLUGIN=1 | 6 | # Command: $(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kdepim-desktop.pro |
7 | endif | 7 | ############################################################################# |
8 | 8 | ||
9 | ifneq ($(PLATFORM) , zaurus) | 9 | MAKEFILE =Makefile |
10 | BUILD_NO_SHARP_PLUGIN=1 | 10 | QMAKE =qmake |
11 | endif | 11 | DEL_FILE = rm -f |
12 | 12 | CHK_DIR_EXISTS= test -d | |
13 | SUBDIRS_MICROKDE = \ | 13 | MKDIR = mkdir -p |
14 | libical/src/libical \ | 14 | INSTALL_FILE= |
15 | libical/src/libicalss \ | 15 | INSTALL_DIR = |
16 | qtcompat \ | 16 | SUBTARGETS = \ |
17 | microkde \ | 17 | sub-gammu-emb-common \ |
18 | libkcal \ | 18 | sub-gammu-emb-gammu \ |
19 | libkdepim \ | 19 | sub-libical \ |
20 | kabc \ | 20 | sub-libkcal \ |
21 | kabc/formats/binary \ | 21 | sub-microkde \ |
22 | kabc/plugins/file \ | 22 | sub-libkdepim \ |
23 | kabc/plugins/dir \ | 23 | sub-kabc \ |
24 | korganizer \ | 24 | sub-korganizer \ |
25 | kalarmd \ | 25 | sub-kaddressbook \ |
26 | kaddressbook | 26 | sub-kabc-plugins-file \ |
27 | 27 | sub-kabc-plugins-dir | |
28 | SUBDIRS_QTOPIA_PLUGIN = \ | 28 | |
29 | kabc/plugins/qtopia | 29 | first: all |
30 | 30 | ||
31 | SUBDIRS_OPIE_PLUGIN = \ | 31 | all: Makefile $(SUBTARGETS) |
32 | kabc/plugins/opie | 32 | |
33 | 33 | gammu/emb/common/$(MAKEFILE): | |
34 | SUBDIRS_SHARP_PLUGIN = \ | 34 | @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common" |
35 | kabc/plugins/sharpdtm | 35 | cd gammu/emb/common && $(QMAKE) common.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
36 | 36 | sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE | |
37 | SUBDIRS_LDAP_PLUGIN = \ | 37 | cd gammu/emb/common && $(MAKE) -f $(MAKEFILE) |
38 | kabc/plugins/ldap | 38 | |
39 | 39 | gammu/emb/gammu/$(MAKEFILE): | |
40 | SUBDIRS_MICROMAIL = \ | 40 | @$(CHK_DIR_EXISTS) "gammu/emb/gammu" || $(MKDIR) "gammu/emb/gammu" |
41 | kmicromail/libetpan \ | 41 | cd gammu/emb/gammu && $(QMAKE) gammu.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
42 | kmicromail/libmailwrapper \ | 42 | sub-gammu-emb-gammu: gammu/emb/gammu/$(MAKEFILE) FORCE |
43 | kmicromail | 43 | cd gammu/emb/gammu && $(MAKE) -f $(MAKEFILE) |
44 | 44 | ||
45 | SUBDIRS_GAMMU = \ | 45 | libical/$(MAKEFILE): |
46 | gammu/emb/common \ | 46 | @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical" |
47 | gammu/emb/gammu | 47 | cd libical && $(QMAKE) libical.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
48 | 48 | sub-libical: libical/$(MAKEFILE) FORCE | |
49 | SUBDIRS_PWMANAGER = \ | 49 | cd libical && $(MAKE) -f $(MAKEFILE) |
50 | pwmanager/pwmanager | 50 | |
51 | 51 | libkcal/$(MAKEFILE): | |
52 | SUBDIRS = \ | 52 | @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal" |
53 | $(SUBDIRS_MICROKDE) \ | 53 | cd libkcal && $(QMAKE) libkcal.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
54 | $(SUBDIRS_QTOPIA_PLUGIN) \ | 54 | sub-libkcal: libkcal/$(MAKEFILE) FORCE |
55 | $(SUBDIRS_OPIE_PLUGIN) \ | 55 | cd libkcal && $(MAKE) -f $(MAKEFILE) |
56 | $(SUBDIRS_SHARP_PLUGIN) \ | 56 | |
57 | $(SUBDIRS_LDAP_PLUGIN) \ | 57 | microkde/$(MAKEFILE): |
58 | $(SUBDIRS_MICROMAIL) \ | 58 | @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde" |
59 | $(SUBDIRS_GAMMU) \ | 59 | cd microkde && $(QMAKE) microkde.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
60 | $(SUBDIRS_PWMANAGER) | 60 | sub-microkde: microkde/$(MAKEFILE) FORCE |
61 | 61 | cd microkde && $(MAKE) -f $(MAKEFILE) | |
62 | 62 | ||
63 | all: build_microkde \ | 63 | libkdepim/$(MAKEFILE): |
64 | build_qtopia_plugin \ | 64 | @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim" |
65 | build_opie_plugin \ | 65 | cd libkdepim && $(QMAKE) libkdepim.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
66 | build_sharp_plugin \ | 66 | sub-libkdepim: libkdepim/$(MAKEFILE) FORCE |
67 | build_ldap_plugin \ | 67 | cd libkdepim && $(MAKE) -f $(MAKEFILE) |
68 | build_micromail \ | 68 | |
69 | build_gammu \ | 69 | kabc/$(MAKEFILE): |
70 | build_pwmanager | 70 | @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc" |
71 | 71 | cd kabc && $(QMAKE) kabc.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) | |
72 | 72 | sub-kabc: kabc/$(MAKEFILE) FORCE | |
73 | build_microkde: variable_test tmake | 73 | cd kabc && $(MAKE) -f $(MAKEFILE) |
74 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ | 74 | |
75 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 75 | korganizer/$(MAKEFILE): |
76 | done | 76 | @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer" |
77 | 77 | cd korganizer && $(QMAKE) korganizer.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) | |
78 | build_qtopia_plugin: build_microkde | 78 | sub-korganizer: korganizer/$(MAKEFILE) FORCE |
79 | ifdef BUILD_NO_QTOPIA_PLUGIN | 79 | cd korganizer && $(MAKE) -f $(MAKEFILE) |
80 | @echo == qtopia plugin not build. | 80 | |
81 | else | 81 | kaddressbook/$(MAKEFILE): |
82 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ | 82 | @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook" |
83 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 83 | cd kaddressbook && $(QMAKE) kaddressbook.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
84 | done | 84 | sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE |
85 | endif | 85 | cd kaddressbook && $(MAKE) -f $(MAKEFILE) |
86 | 86 | ||
87 | build_opie_plugin: build_microkde | 87 | kabc/plugins/file/$(MAKEFILE): |
88 | ifdef BUILD_NO_OPIE_PLUGIN | 88 | @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" |
89 | @echo == opie plugin not build. | 89 | cd kabc/plugins/file && $(QMAKE) file.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) |
90 | else | 90 | sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE |
91 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ | 91 | cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) |
92 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 92 | |
93 | done | 93 | kabc/plugins/dir/$(MAKEFILE): |
94 | endif | 94 | @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir" |
95 | 95 | cd kabc/plugins/dir && $(QMAKE) dir.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) | |
96 | build_sharp_plugin: build_microkde | 96 | sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE |
97 | ifdef BUILD_NO_SHARP_PLUGIN | 97 | cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE) |
98 | @echo == ldap plugin not build. | 98 | |
99 | else | 99 | Makefile: kdepim-desktop.pro /usr/local/qtgcc/mkspecs/default/qmake.conf |
100 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ | 100 | $(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kdepim-desktop.pro |
101 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 101 | qmake: qmake_all |
102 | done | 102 | @$(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kdepim-desktop.pro |
103 | endif | 103 | |
104 | 104 | all: $(SUBTARGETS) | |
105 | build_ldap_plugin: build_microkde | 105 | qmake_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) |
106 | ifdef BUILD_NO_LDAP_PLUGIN | 106 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
107 | @echo == ldap plugin not build. | 107 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
108 | else | 108 | ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
109 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ | 109 | ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
110 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 110 | ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
111 | done | 111 | ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
112 | endif | 112 | ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
113 | 113 | ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | |
114 | 114 | ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | |
115 | build_micromail: build_microkde | 115 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
116 | ifdef BUILD_NO_MICROMAIL | 116 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
117 | @echo == kmicromail not build. | 117 | clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE |
118 | else | 118 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
119 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ | 119 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
120 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 120 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
121 | done | 121 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
122 | endif | 122 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
123 | 123 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true | |
124 | build_gammu: variable_test tmake | 124 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
125 | ifdef BUILD_NO_GAMMU | 125 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
126 | @echo == gammu not build. | 126 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
127 | else | 127 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
128 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ | 128 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
129 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 129 | uninstall_subdirs: qmake_all FORCE |
130 | done | 130 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
131 | endif | 131 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
132 | 132 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | |
133 | build_pwmanager: build_microkde | 133 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
134 | ifdef BUILD_NO_PWMANAGER | 134 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
135 | @echo == pwmanager not build. | 135 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
136 | else | 136 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
137 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ | 137 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
138 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 138 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
139 | done | 139 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
140 | endif | 140 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
141 | 141 | install_subdirs: qmake_all FORCE | |
142 | 142 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true | |
143 | variable_info: | 143 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) install; ) || true |
144 | @echo -------------------------------------- | 144 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true |
145 | @echo KDEPIM buildsystem, variableinfo... | 145 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true |
146 | @echo KDEPIMDIR=$(KDEPIMDIR) | 146 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true |
147 | @echo QTDIR=$(QTDIR) | 147 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true |
148 | @echo QPEDIR=$(QPEDIR) | 148 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true |
149 | @echo OPIEDIR=$(OPIEDIR) | 149 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true |
150 | @echo PLATFORM=$(PLATFORM) | 150 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true |
151 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) | 151 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true |
152 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) | 152 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true |
153 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) | 153 | distclean: qmake_all FORCE |
154 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) | 154 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
155 | @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) | 155 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
156 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) | 156 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
157 | ifndef BUILD_NO_SHARP_PLUGIN | 157 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
158 | @echo SHARPDTMSDK=$(SHARPDTMSDK) | 158 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
159 | endif | 159 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
160 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) | 160 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
161 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) | 161 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
162 | @echo -------------------------------------- | 162 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
163 | 163 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | |
164 | variable_test: variable_info | 164 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
165 | @echo KDEPIM buildsystem, variablecheck... | 165 | |
166 | ifndef KDEPIMDIR | 166 | install: install_subdirs |
167 | @echo KDEPIMDIR is not defined. | 167 | |
168 | $(error KDEPIMDIR is not defined) | 168 | uninstall: uninstall_subdirs |
169 | endif | 169 | |
170 | ifndef PLATFORM | 170 | FORCE: |
171 | @echo PLATFORM is not defined. | ||
172 | $(error PLATFORM is not defined) | ||
173 | endif | ||
174 | ifdef BUILD_NO_LDAP_PLUGIN | ||
175 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) | ||
176 | endif | ||
177 | ifdef BUILD_NO_OPIE_PLUGIN | ||
178 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) | ||
179 | endif | ||
180 | ifdef BUILD_NO_QTOPIA_PLUGIN | ||
181 | @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) | ||
182 | endif | ||
183 | ifdef BUILD_NO_MICROMAIL | ||
184 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) | ||
185 | endif | ||
186 | ifdef BUILD_NO_SHARP_PLUGIN | ||
187 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) | ||
188 | else | ||
189 | ifndef SHARPDTMSDK | ||
190 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) | ||
191 | $(error SHARPDTMSDK is not defined) | ||
192 | endif | ||
193 | endif | ||
194 | ifdef BUILD_NO_GAMMU | ||
195 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) | ||
196 | endif | ||
197 | ifdef BUILD_NO_PWMANAGER | ||
198 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) | ||
199 | endif | ||
200 | @echo -------------------------------------- | ||
201 | |||
202 | |||
203 | objects: | ||
204 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done | ||
205 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done | ||
206 | mkdir -p libical/lib/$(PLATFORM) | ||
207 | |||
208 | clean: | ||
209 | rm -rf libical/lib/$(PLATFORM)/*; | ||
210 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ | ||
211 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ | ||
212 | done | ||
213 | |||
214 | install: | ||
215 | |||
216 | cd bin/kdepim; make install | ||
217 | cp -r Pim $(QPEDIR)/apps | ||
218 | cp db2file/db2file $(QPEDIR)/bin/db2file | ||
219 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop | ||
220 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop | ||
221 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop | ||
222 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop | ||
223 | |||
224 | dist: | ||
225 | @echo Dont forget to do "make install" before "make dist" | ||
226 | rm -f *arm.ipk | ||
227 | rm -f *~ | ||
228 | cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim | ||
229 | ./mkipks kmicrokdelibs.control | ||
230 | ./mkipks korganizer.control | ||
231 | ./mkipks kaddressbook.control | ||
232 | ifndef BUILD_NO_MICROMAIL | ||
233 | ./mkipks kopiemail.control | ||
234 | endif | ||
235 | ./mkipks korganizer-alarm.control | ||
236 | ifndef BUILD_NO_GAMMU | ||
237 | ./mkipks phoneaccess.control | ||
238 | endif | ||
239 | ifndef BUILD_NO_PWMANAGER | ||
240 | ./mkipks pwmanager.control | ||
241 | endif | ||
242 | ./mkipks pim_TAB_icon.control | ||
243 | |||
244 | tmake: objects \ | ||
245 | qtcompat/Makefile$(PLATFORM) \ | ||
246 | microkde/Makefile$(PLATFORM) \ | ||
247 | libkcal/Makefile$(PLATFORM) \ | ||
248 | libkdepim/Makefile$(PLATFORM) \ | ||
249 | korganizer/Makefile$(PLATFORM) \ | ||
250 | kalarmd/Makefile$(PLATFORM) \ | ||
251 | libical/src/libical/Makefile$(PLATFORM) \ | ||
252 | libical/src/libicalss/Makefile$(PLATFORM) \ | ||
253 | kabc/Makefile$(PLATFORM) \ | ||
254 | kabc/formats/binary/Makefile$(PLATFORM) \ | ||
255 | kabc/plugins/file/Makefile$(PLATFORM) \ | ||
256 | kabc/plugins/dir/Makefile$(PLATFORM) \ | ||
257 | kabc/plugins/ldap/Makefile$(PLATFORM) \ | ||
258 | kabc/plugins/opie/Makefile$(PLATFORM) \ | ||
259 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ | ||
260 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ | ||
261 | kaddressbook/Makefile$(PLATFORM) \ | ||
262 | kmicromail/Makefile$(PLATFORM) \ | ||
263 | kmicromail/libetpan/Makefile$(PLATFORM) \ | ||
264 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ | ||
265 | gammu/emb/common/Makefile$(PLATFORM) \ | ||
266 | gammu/emb/gammu/Makefile$(PLATFORM) \ | ||
267 | pwmanager/pwmanager/Makefile$(PLATFORM) \ | ||
268 | |||
269 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro | ||
270 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) | ||
271 | |||
272 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro | ||
273 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) | ||
274 | |||
275 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro | ||
276 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) | ||
277 | |||
278 | |||
279 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro | ||
280 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) | ||
281 | |||
282 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro | ||
283 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) | ||
284 | |||
285 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro | ||
286 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) | ||
287 | |||
288 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro | ||
289 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) | ||
290 | |||
291 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro | ||
292 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) | ||
293 | |||
294 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro | ||
295 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) | ||
296 | |||
297 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | ||
298 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) | ||
299 | |||
300 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro | ||
301 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) | ||
302 | |||
303 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro | ||
304 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) | ||
305 | |||
306 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro | ||
307 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) | ||
308 | |||
309 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro | ||
310 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) | ||
311 | |||
312 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro | ||
313 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) | ||
314 | |||
315 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro | ||
316 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) | ||
317 | |||
318 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro | ||
319 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) | ||
320 | |||
321 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro | ||
322 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) | ||
323 | |||
324 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro | ||
325 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) | ||
326 | |||
327 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro | ||
328 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) | ||
329 | |||
330 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro | ||
331 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) | ||
332 | |||
333 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro | ||
334 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) | ||
335 | |||
336 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro | ||
337 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) | ||
338 | 171 | ||
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp index 95ae29e..76bfad3 100644 --- a/kde2file/caldump/main.cpp +++ b/kde2file/caldump/main.cpp | |||
@@ -66,139 +66,143 @@ static const char progDisplay[] = "KDE_Calendar"; | |||
66 | static const char progVersion[] = "33.1/3"; | 66 | static const char progVersion[] = "33.1/3"; |
67 | static const char progDesc[] = "A command line interface to KDE calendars"; | 67 | static const char progDesc[] = "A command line interface to KDE calendars"; |
68 | 68 | ||
69 | 69 | ||
70 | static KCmdLineOptions options[] = | 70 | static KCmdLineOptions options[] = |
71 | { | 71 | { |
72 | { "dump", | 72 | { "dump", |
73 | I18N_NOOP( "Dumps calendar" ), 0 }, | 73 | I18N_NOOP( "Dumps calendar" ), 0 }, |
74 | { "read", | 74 | { "read", |
75 | I18N_NOOP( "Reads calendar" ), 0 }, | 75 | I18N_NOOP( "Reads calendar" ), 0 }, |
76 | KCmdLineLastOption | 76 | KCmdLineLastOption |
77 | }; | 77 | }; |
78 | 78 | ||
79 | int main( int argc, char *argv[] ) | 79 | int main( int argc, char *argv[] ) |
80 | { | 80 | { |
81 | KAboutData aboutData( | 81 | KAboutData aboutData( |
82 | progName, // internal program name | 82 | progName, // internal program name |
83 | I18N_NOOP( progDisplay ), // displayable program name. | 83 | I18N_NOOP( progDisplay ), // displayable program name. |
84 | progVersion, // version string | 84 | progVersion, // version string |
85 | I18N_NOOP( progDesc ), // short porgram description | 85 | I18N_NOOP( progDesc ), // short porgram description |
86 | KAboutData::License_GPL, // license type | 86 | KAboutData::License_GPL, // license type |
87 | "(c) 2004, Lutz Rogowski", // copyright statement | 87 | "(c) 2004, Lutz Rogowski", // copyright statement |
88 | 0, // any free form text | 88 | 0, // any free form text |
89 | "", // program home page address | 89 | "", // program home page address |
90 | "bugs.kde.org" // bug report email address | 90 | "bugs.kde.org" // bug report email address |
91 | ); | 91 | ); |
92 | 92 | ||
93 | 93 | ||
94 | // KCmdLineArgs::init() final 'true' argument indicates no commandline options | 94 | // KCmdLineArgs::init() final 'true' argument indicates no commandline options |
95 | // for QApplication/KApplication (no KDE or Qt options) | 95 | // for QApplication/KApplication (no KDE or Qt options) |
96 | KCmdLineArgs::init( argc, argv, &aboutData, true ); | 96 | KCmdLineArgs::init( argc, argv, &aboutData, true ); |
97 | KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. | 97 | KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. |
98 | 98 | ||
99 | KInstance ins ( progName ); | 99 | KInstance ins ( progName ); |
100 | 100 | ||
101 | KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); | 101 | KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); |
102 | 102 | ||
103 | bool read = false; | 103 | bool read = false; |
104 | if ( args->isSet( "read" ) ) { | 104 | if ( args->isSet( "read" ) ) { |
105 | read = true; | 105 | read = true; |
106 | qDebug("read "); | 106 | qDebug("read "); |
107 | } | 107 | } |
108 | CalendarResources *calendarResource = 0; | 108 | CalendarResources *calendarResource = 0; |
109 | CalendarLocal *localCalendar = 0; | 109 | CalendarLocal *localCalendar = 0; |
110 | 110 | ||
111 | calendarResource = new CalendarResources( "" ); | 111 | calendarResource = new CalendarResources( "" ); |
112 | calendarResource->readConfig(); | 112 | calendarResource->readConfig(); |
113 | calendarResource->load(); | 113 | calendarResource->load(); |
114 | qDebug("************************************* "); | 114 | qDebug("************************************* "); |
115 | qDebug("************************************* "); | 115 | qDebug("************************************* "); |
116 | qDebug("************************************* "); | 116 | qDebug("************************************* "); |
117 | qDebug("Using timezone id: %s", calendarResource->timeZoneId().latin1()); | 117 | qDebug("Using timezone id: %s", calendarResource->timeZoneId().latin1()); |
118 | 118 | ||
119 | if ( !read ) { | 119 | if ( !read ) { |
120 | localCalendar = new CalendarLocal(); | 120 | localCalendar = new CalendarLocal(); |
121 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); | 121 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); |
122 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); | 122 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); |
123 | Incidence::List::ConstIterator it; | 123 | Incidence::List::ConstIterator it; |
124 | int num = 0; | 124 | int num = 0; |
125 | for( it = allInc.begin(); it != allInc.end(); ++it ) { | 125 | for( it = allInc.begin(); it != allInc.end(); ++it ) { |
126 | ResourceCalendar * re = calendarResource->resource( (*it) ); | 126 | ResourceCalendar * re = calendarResource->resource( (*it) ); |
127 | if ( re && !re->readOnly() ) { | 127 | if ( re && !re->readOnly() ) { |
128 | ++num; | 128 | ++num; |
129 | Incidence* cl = (*it)->clone(); | 129 | Incidence* cl = (*it)->clone(); |
130 | cl->setLastModified( (*it)->lastModified() ); | ||
130 | if ( cl->type() == "Journal" ) | 131 | if ( cl->type() == "Journal" ) |
131 | localCalendar->addJournal( (Journal *) cl ); | 132 | localCalendar->addJournal( (Journal *) cl ); |
132 | else if ( cl->type() == "Todo" ) | 133 | else if ( cl->type() == "Todo" ) |
133 | localCalendar->addTodo( (Todo *) cl ); | 134 | localCalendar->addTodo( (Todo *) cl ); |
134 | else if ( cl->type() == "Event" ) | 135 | else if ( cl->type() == "Event" ) |
135 | localCalendar->addEvent( (Event *) cl ); | 136 | localCalendar->addEvent( (Event *) cl ); |
136 | } | 137 | } |
137 | } | 138 | } |
138 | 139 | ||
139 | FileStorage* storage = new FileStorage( calendarResource ); | 140 | FileStorage* storage = new FileStorage( calendarResource ); |
140 | storage->setFileName( "/tmp/kdedumpall.ics" ); | 141 | storage->setFileName( "/tmp/kdedumpall.ics" ); |
141 | storage->setSaveFormat( new ICalFormat() ); | 142 | storage->setSaveFormat( new ICalFormat() ); |
142 | storage->save(); | 143 | storage->save(); |
143 | delete storage; | 144 | delete storage; |
144 | qDebug("************************************* "); | 145 | qDebug("************************************* "); |
145 | qDebug("************************************* "); | 146 | qDebug("************************************* "); |
146 | qDebug("************************************* "); | 147 | qDebug("************************************* "); |
147 | qDebug("%d calendar entries dumped to file /tmp/kdedumpall.ics", num); | 148 | qDebug("%d calendar entries dumped to file /tmp/kdedumpall.ics", num); |
148 | 149 | ||
149 | } else { | 150 | } else { |
150 | localCalendar = new CalendarLocal(); | 151 | localCalendar = new CalendarLocal(); |
151 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); | 152 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); |
152 | FileStorage* storage = new FileStorage( localCalendar ); | 153 | FileStorage* storage = new FileStorage( localCalendar ); |
153 | storage->setFileName( "/tmp/kdedumpall.ics" ); | 154 | storage->setFileName( "/tmp/kdedumpall.ics" ); |
154 | int num = 0; | 155 | int num = 0; |
155 | int del = 0; | 156 | int del = 0; |
156 | if ( storage->load() ) { | 157 | if ( storage->load() ) { |
157 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); | 158 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); |
158 | KCal::Incidence::List newInc = localCalendar->rawIncidences(); | 159 | KCal::Incidence::List newInc = localCalendar->rawIncidences(); |
159 | Incidence::List::ConstIterator it; | 160 | Incidence::List::ConstIterator it; |
160 | for( it = allInc.begin(); it != allInc.end(); ++it ) { | 161 | for( it = allInc.begin(); it != allInc.end(); ++it ) { |
161 | ResourceCalendar * re = calendarResource->resource( (*it) ); | 162 | ResourceCalendar * re = calendarResource->resource( (*it) ); |
162 | if ( re && !re->readOnly() ) { | 163 | if ( re && !re->readOnly() ) { |
163 | Incidence* cl = localCalendar->incidence( (*it)->uid() ); | 164 | Incidence* cl = localCalendar->incidence( (*it)->uid() ); |
164 | if ( cl ) { | 165 | if ( cl ) { |
166 | QDateTime lm = cl->lastModified(); | ||
165 | cl->setResources( (*it)->resources() ); | 167 | cl->setResources( (*it)->resources() ); |
168 | cl->setLastModified(lm); | ||
166 | } | 169 | } |
167 | ++del; | 170 | ++del; |
168 | cl = (*it); | 171 | cl = (*it); |
169 | if ( cl->type() == "Journal" ) | 172 | if ( cl->type() == "Journal" ) |
170 | calendarResource->deleteJournal( (Journal *) cl ); | 173 | calendarResource->deleteJournal( (Journal *) cl ); |
171 | else if ( cl->type() == "Todo" ) | 174 | else if ( cl->type() == "Todo" ) |
172 | calendarResource->deleteTodo( (Todo *) cl ); | 175 | calendarResource->deleteTodo( (Todo *) cl ); |
173 | else if ( cl->type() == "Event" ) | 176 | else if ( cl->type() == "Event" ) |
174 | calendarResource->deleteEvent( (Event *) cl ); | 177 | calendarResource->deleteEvent( (Event *) cl ); |
175 | } | 178 | } |
176 | } | 179 | } |
177 | for( it = newInc.begin(); it != newInc.end(); ++it ) { | 180 | for( it = newInc.begin(); it != newInc.end(); ++it ) { |
178 | Incidence* cl = (*it)->clone(); | 181 | Incidence* cl = (*it)->clone(); |
179 | ++num; | 182 | ++num; |
180 | calendarResource->addIncidence( cl ); | 183 | calendarResource->addIncidence( cl ); |
184 | //cl->setLastModified( (*it)->lastModified() ); | ||
181 | } | 185 | } |
182 | calendarResource->save(); | 186 | calendarResource->save(); |
183 | qDebug("************************************* "); | 187 | qDebug("************************************* "); |
184 | qDebug("************************************* "); | 188 | qDebug("************************************* "); |
185 | qDebug("************************************* "); | 189 | qDebug("************************************* "); |
186 | qDebug("%d calendar entries deleted/ %d added from file /tmp/kdedumpall.ics", del, num); | 190 | qDebug("%d calendar entries deleted/ %d added from file /tmp/kdedumpall.ics", del, num); |
187 | 191 | ||
188 | } else | 192 | } else |
189 | qDebug("error loading file /tmp/kdedumpall.ics"); | 193 | qDebug("error loading file /tmp/kdedumpall.ics"); |
190 | 194 | ||
191 | } | 195 | } |
192 | 196 | ||
193 | if ( localCalendar ) { | 197 | if ( localCalendar ) { |
194 | localCalendar->close(); | 198 | localCalendar->close(); |
195 | delete localCalendar; | 199 | delete localCalendar; |
196 | } | 200 | } |
197 | if ( calendarResource ) { | 201 | if ( calendarResource ) { |
198 | calendarResource->close(); | 202 | calendarResource->close(); |
199 | delete calendarResource; | 203 | delete calendarResource; |
200 | } | 204 | } |
201 | 205 | ||
202 | qDebug("ente "); | 206 | qDebug("ente "); |
203 | return 0; | 207 | return 0; |
204 | } | 208 | } |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 5175f94..7ee56e4 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -38,216 +38,230 @@ | |||
38 | #include <qprogressbar.h> | 38 | #include <qprogressbar.h> |
39 | #include <qpopupmenu.h> | 39 | #include <qpopupmenu.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qradiobutton.h> | 41 | #include <qradiobutton.h> |
42 | #include <qbuttongroup.h> | 42 | #include <qbuttongroup.h> |
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
44 | #include <qmessagebox.h> | 44 | #include <qmessagebox.h> |
45 | #include <qapplication.h> | 45 | #include <qapplication.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qtextcodec.h> | 49 | #include <qtextcodec.h> |
50 | #include <qlabel.h> | 50 | #include <qlabel.h> |
51 | 51 | ||
52 | #include <klocale.h> | 52 | #include <klocale.h> |
53 | #include <kglobal.h> | 53 | #include <kglobal.h> |
54 | #include <kconfig.h> | 54 | #include <kconfig.h> |
55 | #include <kfiledialog.h> | 55 | #include <kfiledialog.h> |
56 | 56 | ||
57 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) | 57 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) |
58 | : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs ),mSyncMenu(syncmenu) | 58 | : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs ),mSyncMenu(syncmenu) |
59 | { | 59 | { |
60 | mServerSocket = 0; | 60 | mServerSocket = 0; |
61 | bar = new QProgressBar ( 1, 0 ); | 61 | bar = new QProgressBar ( 1, 0 ); |
62 | bar->setCaption (""); | 62 | bar->setCaption (""); |
63 | 63 | ||
64 | int w = 300; | 64 | int w = 300; |
65 | if ( QApplication::desktop()->width() < 320 ) | 65 | if ( QApplication::desktop()->width() < 320 ) |
66 | w = 220; | 66 | w = 220; |
67 | int h = bar->sizeHint().height() ; | 67 | int h = bar->sizeHint().height() ; |
68 | int dw = QApplication::desktop()->width(); | 68 | int dw = QApplication::desktop()->width(); |
69 | int dh = QApplication::desktop()->height(); | 69 | int dh = QApplication::desktop()->height(); |
70 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 70 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
71 | 71 | ||
72 | } | 72 | } |
73 | 73 | ||
74 | KSyncManager::~KSyncManager() | 74 | KSyncManager::~KSyncManager() |
75 | { | 75 | { |
76 | delete bar; | 76 | delete bar; |
77 | } | 77 | } |
78 | 78 | ||
79 | 79 | ||
80 | void KSyncManager::fillSyncMenu() | 80 | void KSyncManager::fillSyncMenu() |
81 | { | 81 | { |
82 | if ( mSyncMenu->count() ) | 82 | if ( mSyncMenu->count() ) |
83 | mSyncMenu->clear(); | 83 | mSyncMenu->clear(); |
84 | 84 | ||
85 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); | 85 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); |
86 | mSyncMenu->insertSeparator(); | 86 | mSyncMenu->insertSeparator(); |
87 | if ( mServerSocket == 0 ) { | 87 | if ( mServerSocket == 0 ) { |
88 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); | 88 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); |
89 | } else { | 89 | } else { |
90 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); | 90 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); |
91 | } | 91 | } |
92 | mSyncMenu->insertSeparator(); | 92 | mSyncMenu->insertSeparator(); |
93 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); | 93 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); |
94 | mSyncMenu->insertSeparator(); | 94 | mSyncMenu->insertSeparator(); |
95 | 95 | ||
96 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 96 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
97 | config.setGroup("General"); | 97 | config.setGroup("General"); |
98 | QStringList prof = config.readListEntry("SyncProfileNames"); | 98 | QStringList prof = config.readListEntry("SyncProfileNames"); |
99 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 99 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
100 | if ( prof.count() < 2 ) { | 100 | if ( prof.count() < 2 ) { |
101 | prof.clear(); | 101 | prof.clear(); |
102 | #ifdef DESKTOP_VERSION | ||
103 | #ifdef _WIN32_ | ||
104 | prof << i18n("OutLook(not_implemented)"); | ||
105 | #else | ||
106 | prof << i18n("KDE_Desktop"); | ||
107 | #endif | ||
108 | #else | ||
102 | prof << i18n("Sharp_DTM"); | 109 | prof << i18n("Sharp_DTM"); |
110 | #endif | ||
103 | prof << i18n("Local_file"); | 111 | prof << i18n("Local_file"); |
104 | prof << i18n("Last_file"); | 112 | prof << i18n("Last_file"); |
105 | KSyncProfile* temp = new KSyncProfile (); | 113 | KSyncProfile* temp = new KSyncProfile (); |
106 | temp->setName( prof[0] ); | 114 | temp->setName( prof[0] ); |
107 | temp->writeConfig(&config); | 115 | temp->writeConfig(&config); |
108 | temp->setName( prof[1] ); | 116 | temp->setName( prof[1] ); |
109 | temp->writeConfig(&config); | 117 | temp->writeConfig(&config); |
110 | temp->setName( prof[2] ); | 118 | temp->setName( prof[2] ); |
111 | temp->writeConfig(&config); | 119 | temp->writeConfig(&config); |
112 | config.setGroup("General"); | 120 | config.setGroup("General"); |
113 | config.writeEntry("SyncProfileNames",prof); | 121 | config.writeEntry("SyncProfileNames",prof); |
114 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); | 122 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); |
115 | config.sync(); | 123 | config.sync(); |
116 | delete temp; | 124 | delete temp; |
117 | } | 125 | } |
118 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 126 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
119 | mSyncProfileNames = prof; | 127 | mSyncProfileNames = prof; |
120 | unsigned int i; | 128 | unsigned int i; |
121 | for ( i = 0; i < prof.count(); ++i ) { | 129 | for ( i = 0; i < prof.count(); ++i ) { |
122 | mSyncMenu->insertItem( prof[i], 1000+i ); | 130 | mSyncMenu->insertItem( prof[i], 1000+i ); |
123 | if ( i == 2 ) | 131 | if ( i == 2 ) |
124 | mSyncMenu->insertSeparator(); | 132 | mSyncMenu->insertSeparator(); |
125 | } | 133 | } |
126 | QDir app_dir; | 134 | QDir app_dir; |
127 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available | 135 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available |
128 | if ( mTargetApp == PWMPI) { | 136 | if ( mTargetApp == PWMPI) { |
129 | mSyncMenu->removeItem( 1000 ); | 137 | mSyncMenu->removeItem( 1000 ); |
130 | } | 138 | } |
139 | #ifndef DESKTOP_VERSION | ||
131 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 140 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
132 | mSyncMenu->removeItem( 1000 ); | 141 | mSyncMenu->removeItem( 1000 ); |
133 | } | 142 | } |
143 | #endif | ||
134 | mSyncMenu->removeItem( 1002 ); | 144 | mSyncMenu->removeItem( 1002 ); |
135 | } | 145 | } |
136 | 146 | ||
137 | void KSyncManager::slotSyncMenu( int action ) | 147 | void KSyncManager::slotSyncMenu( int action ) |
138 | { | 148 | { |
139 | //qDebug("syncaction %d ", action); | 149 | //qDebug("syncaction %d ", action); |
140 | if ( action == 0 ) { | 150 | if ( action == 0 ) { |
141 | 151 | ||
142 | // seems to be a Qt2 event handling bug | 152 | // seems to be a Qt2 event handling bug |
143 | // syncmenu.clear causes a segfault at first time | 153 | // syncmenu.clear causes a segfault at first time |
144 | // when we call it after the main event loop, it is ok | 154 | // when we call it after the main event loop, it is ok |
145 | // same behaviour when calling OM/Pi via QCOP for the first time | 155 | // same behaviour when calling OM/Pi via QCOP for the first time |
146 | QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); | 156 | QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); |
147 | //confSync(); | 157 | //confSync(); |
148 | 158 | ||
149 | return; | 159 | return; |
150 | } | 160 | } |
151 | if ( action == 1 ) { | 161 | if ( action == 1 ) { |
152 | multiSync( true ); | 162 | multiSync( true ); |
153 | return; | 163 | return; |
154 | } | 164 | } |
155 | if ( action == 2 ) { | 165 | if ( action == 2 ) { |
156 | enableQuick(); | 166 | enableQuick(); |
157 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 167 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
158 | return; | 168 | return; |
159 | } | 169 | } |
160 | if ( action == 3 ) { | 170 | if ( action == 3 ) { |
161 | delete mServerSocket; | 171 | delete mServerSocket; |
162 | mServerSocket = 0; | 172 | mServerSocket = 0; |
163 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 173 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
164 | return; | 174 | return; |
165 | } | 175 | } |
166 | 176 | ||
167 | if (blockSave()) | 177 | if (blockSave()) |
168 | return; | 178 | return; |
169 | 179 | ||
170 | setBlockSave(true); | 180 | setBlockSave(true); |
171 | 181 | ||
172 | mCurrentSyncProfile = action - 1000 ; | 182 | mCurrentSyncProfile = action - 1000 ; |
173 | mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; | 183 | mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; |
174 | mCurrentSyncName = mLocalMachineName ; | 184 | mCurrentSyncName = mLocalMachineName ; |
175 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 185 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
176 | KSyncProfile* temp = new KSyncProfile (); | 186 | KSyncProfile* temp = new KSyncProfile (); |
177 | temp->setName(mSyncProfileNames[mCurrentSyncProfile]); | 187 | temp->setName(mSyncProfileNames[mCurrentSyncProfile]); |
178 | temp->readConfig(&config); | 188 | temp->readConfig(&config); |
179 | mAskForPreferences = temp->getAskForPreferences(); | 189 | mAskForPreferences = temp->getAskForPreferences(); |
180 | mSyncAlgoPrefs = temp->getSyncPrefs(); | 190 | mSyncAlgoPrefs = temp->getSyncPrefs(); |
181 | mWriteBackFile = temp->getWriteBackFile(); | 191 | mWriteBackFile = temp->getWriteBackFile(); |
182 | mWriteBackExistingOnly = temp->getWriteBackExisting(); | 192 | mWriteBackExistingOnly = temp->getWriteBackExisting(); |
183 | mIsKapiFile = temp->getIsKapiFile(); | 193 | mIsKapiFile = temp->getIsKapiFile(); |
184 | mWriteBackInFuture = 0; | 194 | mWriteBackInFuture = 0; |
185 | if ( temp->getWriteBackFuture() ) | 195 | if ( temp->getWriteBackFuture() ) |
186 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); | 196 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); |
187 | mShowSyncSummary = temp->getShowSummaryAfterSync(); | 197 | mShowSyncSummary = temp->getShowSummaryAfterSync(); |
188 | if ( action == 1000 ) { | 198 | if ( action == 1000 ) { |
199 | #ifdef DESKTOP_VERSION | ||
200 | syncKDE(); | ||
201 | #else | ||
189 | syncSharp(); | 202 | syncSharp(); |
203 | #endif | ||
190 | 204 | ||
191 | } else if ( action == 1001 ) { | 205 | } else if ( action == 1001 ) { |
192 | syncLocalFile(); | 206 | syncLocalFile(); |
193 | 207 | ||
194 | } else if ( action == 1002 ) { | 208 | } else if ( action == 1002 ) { |
195 | mWriteBackFile = false; | 209 | mWriteBackFile = false; |
196 | mAskForPreferences = false; | 210 | mAskForPreferences = false; |
197 | mShowSyncSummary = false; | 211 | mShowSyncSummary = false; |
198 | mSyncAlgoPrefs = 3; | 212 | mSyncAlgoPrefs = 3; |
199 | quickSyncLocalFile(); | 213 | quickSyncLocalFile(); |
200 | 214 | ||
201 | } else if ( action >= 1003 ) { | 215 | } else if ( action >= 1003 ) { |
202 | if ( temp->getIsLocalFileSync() ) { | 216 | if ( temp->getIsLocalFileSync() ) { |
203 | switch(mTargetApp) | 217 | switch(mTargetApp) |
204 | { | 218 | { |
205 | case (KAPI): | 219 | case (KAPI): |
206 | if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) | 220 | if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) |
207 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); | 221 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); |
208 | break; | 222 | break; |
209 | case (KOPI): | 223 | case (KOPI): |
210 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) | 224 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) |
211 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); | 225 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); |
212 | break; | 226 | break; |
213 | case (PWMPI): | 227 | case (PWMPI): |
214 | if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) | 228 | if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) |
215 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); | 229 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); |
216 | break; | 230 | break; |
217 | default: | 231 | default: |
218 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); | 232 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); |
219 | break; | 233 | break; |
220 | 234 | ||
221 | } | 235 | } |
222 | } else { | 236 | } else { |
223 | if ( temp->getIsPhoneSync() ) { | 237 | if ( temp->getIsPhoneSync() ) { |
224 | mPhoneDevice = temp->getPhoneDevice( ) ; | 238 | mPhoneDevice = temp->getPhoneDevice( ) ; |
225 | mPhoneConnection = temp->getPhoneConnection( ); | 239 | mPhoneConnection = temp->getPhoneConnection( ); |
226 | mPhoneModel = temp->getPhoneModel( ); | 240 | mPhoneModel = temp->getPhoneModel( ); |
227 | syncPhone(); | 241 | syncPhone(); |
228 | } else if ( temp->getIsPiSync() ) { | 242 | } else if ( temp->getIsPiSync() ) { |
229 | if ( mTargetApp == KAPI ) { | 243 | if ( mTargetApp == KAPI ) { |
230 | mPassWordPiSync = temp->getRemotePwAB(); | 244 | mPassWordPiSync = temp->getRemotePwAB(); |
231 | mActiveSyncPort = temp->getRemotePortAB(); | 245 | mActiveSyncPort = temp->getRemotePortAB(); |
232 | mActiveSyncIP = temp->getRemoteIPAB(); | 246 | mActiveSyncIP = temp->getRemoteIPAB(); |
233 | } else if ( mTargetApp == KOPI ) { | 247 | } else if ( mTargetApp == KOPI ) { |
234 | mPassWordPiSync = temp->getRemotePw(); | 248 | mPassWordPiSync = temp->getRemotePw(); |
235 | mActiveSyncPort = temp->getRemotePort(); | 249 | mActiveSyncPort = temp->getRemotePort(); |
236 | mActiveSyncIP = temp->getRemoteIP(); | 250 | mActiveSyncIP = temp->getRemoteIP(); |
237 | } else { | 251 | } else { |
238 | mPassWordPiSync = temp->getRemotePwPWM(); | 252 | mPassWordPiSync = temp->getRemotePwPWM(); |
239 | mActiveSyncPort = temp->getRemotePortPWM(); | 253 | mActiveSyncPort = temp->getRemotePortPWM(); |
240 | mActiveSyncIP = temp->getRemoteIPPWM(); | 254 | mActiveSyncIP = temp->getRemoteIPPWM(); |
241 | } | 255 | } |
242 | syncPi(); | 256 | syncPi(); |
243 | } else | 257 | } else |
244 | syncRemote( temp ); | 258 | syncRemote( temp ); |
245 | 259 | ||
246 | } | 260 | } |
247 | } | 261 | } |
248 | delete temp; | 262 | delete temp; |
249 | setBlockSave(false); | 263 | setBlockSave(false); |
250 | } | 264 | } |
251 | 265 | ||
252 | void KSyncManager::enableQuick() | 266 | void KSyncManager::enableQuick() |
253 | { | 267 | { |
@@ -680,128 +694,158 @@ void KSyncManager::edit_sync_options() | |||
680 | ask.setChecked( true); | 694 | ask.setChecked( true); |
681 | break; | 695 | break; |
682 | case 4: | 696 | case 4: |
683 | f_loc.setChecked( true); | 697 | f_loc.setChecked( true); |
684 | break; | 698 | break; |
685 | case 5: | 699 | case 5: |
686 | f_rem.setChecked( true); | 700 | f_rem.setChecked( true); |
687 | break; | 701 | break; |
688 | case 6: | 702 | case 6: |
689 | // both.setChecked( true); | 703 | // both.setChecked( true); |
690 | break; | 704 | break; |
691 | default: | 705 | default: |
692 | break; | 706 | break; |
693 | } | 707 | } |
694 | if ( dia.exec() ) { | 708 | if ( dia.exec() ) { |
695 | mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; | 709 | mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; |
696 | } | 710 | } |
697 | 711 | ||
698 | 712 | ||
699 | } | 713 | } |
700 | 714 | ||
701 | QString KSyncManager::getPassword( ) | 715 | QString KSyncManager::getPassword( ) |
702 | { | 716 | { |
703 | QString retfile = ""; | 717 | QString retfile = ""; |
704 | QDialog dia ( mParent, "input-dialog", true ); | 718 | QDialog dia ( mParent, "input-dialog", true ); |
705 | QLineEdit lab ( &dia ); | 719 | QLineEdit lab ( &dia ); |
706 | lab.setEchoMode( QLineEdit::Password ); | 720 | lab.setEchoMode( QLineEdit::Password ); |
707 | QVBoxLayout lay( &dia ); | 721 | QVBoxLayout lay( &dia ); |
708 | lay.setMargin(7); | 722 | lay.setMargin(7); |
709 | lay.setSpacing(7); | 723 | lay.setSpacing(7); |
710 | lay.addWidget( &lab); | 724 | lay.addWidget( &lab); |
711 | dia.setFixedSize( 230,50 ); | 725 | dia.setFixedSize( 230,50 ); |
712 | dia.setCaption( i18n("Enter password") ); | 726 | dia.setCaption( i18n("Enter password") ); |
713 | QPushButton pb ( "OK", &dia); | 727 | QPushButton pb ( "OK", &dia); |
714 | lay.addWidget( &pb ); | 728 | lay.addWidget( &pb ); |
715 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); | 729 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); |
716 | dia.show(); | 730 | dia.show(); |
717 | int res = dia.exec(); | 731 | int res = dia.exec(); |
718 | if ( res ) | 732 | if ( res ) |
719 | retfile = lab.text(); | 733 | retfile = lab.text(); |
720 | dia.hide(); | 734 | dia.hide(); |
721 | qApp->processEvents(); | 735 | qApp->processEvents(); |
722 | return retfile; | 736 | return retfile; |
723 | 737 | ||
724 | } | 738 | } |
725 | 739 | ||
726 | 740 | ||
727 | void KSyncManager::confSync() | 741 | void KSyncManager::confSync() |
728 | { | 742 | { |
729 | static KSyncPrefsDialog* sp = 0; | 743 | static KSyncPrefsDialog* sp = 0; |
730 | if ( ! sp ) { | 744 | if ( ! sp ) { |
731 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); | 745 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); |
732 | } | 746 | } |
733 | sp->usrReadConfig(); | 747 | sp->usrReadConfig(); |
734 | #ifndef DESKTOP_VERSION | 748 | #ifndef DESKTOP_VERSION |
735 | sp->showMaximized(); | 749 | sp->showMaximized(); |
736 | #else | 750 | #else |
737 | sp->show(); | 751 | sp->show(); |
738 | #endif | 752 | #endif |
739 | sp->exec(); | 753 | sp->exec(); |
740 | mSyncProfileNames = sp->getSyncProfileNames(); | 754 | mSyncProfileNames = sp->getSyncProfileNames(); |
741 | mLocalMachineName = sp->getLocalMachineName (); | 755 | mLocalMachineName = sp->getLocalMachineName (); |
742 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 756 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
743 | } | 757 | } |
758 | void KSyncManager::syncKDE() | ||
759 | { | ||
760 | emit save(); | ||
761 | switch(mTargetApp) | ||
762 | { | ||
763 | case (KAPI): | ||
764 | |||
765 | break; | ||
766 | case (KOPI): | ||
767 | { | ||
768 | QString command ="./kdecaldump"; | ||
769 | system ( command.latin1()); | ||
770 | if ( syncWithFile( "/tmp/kdedumpall.ics",true ) ) { | ||
771 | if ( mWriteBackFile ) { | ||
772 | command += " --read"; | ||
773 | system ( command.latin1()); | ||
774 | } | ||
775 | } | ||
776 | |||
777 | } | ||
778 | break; | ||
779 | case (PWMPI): | ||
780 | |||
781 | break; | ||
782 | default: | ||
783 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); | ||
784 | break; | ||
785 | |||
786 | } | ||
787 | } | ||
744 | 788 | ||
745 | void KSyncManager::syncSharp() | 789 | void KSyncManager::syncSharp() |
746 | { | 790 | { |
747 | 791 | ||
748 | if ( ! syncExternalApplication("sharp") ) | 792 | if ( ! syncExternalApplication("sharp") ) |
749 | qDebug("ERROR sync sharp "); | 793 | qDebug("ERROR sync sharp "); |
750 | } | 794 | } |
751 | 795 | ||
752 | bool KSyncManager::syncExternalApplication(QString resource) | 796 | bool KSyncManager::syncExternalApplication(QString resource) |
753 | { | 797 | { |
754 | 798 | ||
755 | emit save(); | 799 | emit save(); |
756 | 800 | ||
757 | if ( mAskForPreferences ) | 801 | if ( mAskForPreferences ) |
758 | edit_sync_options(); | 802 | edit_sync_options(); |
759 | 803 | ||
760 | qDebug("Sync extern %s", resource.latin1()); | 804 | qDebug("Sync extern %s", resource.latin1()); |
761 | 805 | ||
762 | bool syncOK = mImplementation->syncExternal(this, resource); | 806 | bool syncOK = mImplementation->syncExternal(this, resource); |
763 | 807 | ||
764 | return syncOK; | 808 | return syncOK; |
765 | 809 | ||
766 | } | 810 | } |
767 | 811 | ||
768 | void KSyncManager::syncPhone() | 812 | void KSyncManager::syncPhone() |
769 | { | 813 | { |
770 | 814 | ||
771 | syncExternalApplication("phone"); | 815 | syncExternalApplication("phone"); |
772 | 816 | ||
773 | } | 817 | } |
774 | 818 | ||
775 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) | 819 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) |
776 | { | 820 | { |
777 | if (!bar->isVisible()) | 821 | if (!bar->isVisible()) |
778 | { | 822 | { |
779 | bar->setCaption (caption); | 823 | bar->setCaption (caption); |
780 | bar->setTotalSteps ( total ) ; | 824 | bar->setTotalSteps ( total ) ; |
781 | 825 | ||
782 | bar->show(); | 826 | bar->show(); |
783 | } | 827 | } |
784 | 828 | ||
785 | bar->setProgress( percentage ); | 829 | bar->setProgress( percentage ); |
786 | } | 830 | } |
787 | 831 | ||
788 | void KSyncManager::hideProgressBar() | 832 | void KSyncManager::hideProgressBar() |
789 | { | 833 | { |
790 | bar->hide(); | 834 | bar->hide(); |
791 | } | 835 | } |
792 | 836 | ||
793 | bool KSyncManager::isProgressBarCanceled() | 837 | bool KSyncManager::isProgressBarCanceled() |
794 | { | 838 | { |
795 | return !bar->isVisible(); | 839 | return !bar->isVisible(); |
796 | } | 840 | } |
797 | 841 | ||
798 | QString KSyncManager::syncFileName() | 842 | QString KSyncManager::syncFileName() |
799 | { | 843 | { |
800 | 844 | ||
801 | QString fn = "tempfile"; | 845 | QString fn = "tempfile"; |
802 | switch(mTargetApp) | 846 | switch(mTargetApp) |
803 | { | 847 | { |
804 | case (KAPI): | 848 | case (KAPI): |
805 | fn = "tempsyncab.vcf"; | 849 | fn = "tempsyncab.vcf"; |
806 | break; | 850 | break; |
807 | case (KOPI): | 851 | case (KOPI): |
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 9094aac..7d5b05e 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -109,101 +109,102 @@ class KSyncManager : public QObject | |||
109 | enum TargetApp { | 109 | enum TargetApp { |
110 | KOPI = 0, | 110 | KOPI = 0, |
111 | KAPI = 1, | 111 | KAPI = 1, |
112 | PWMPI = 2 }; | 112 | PWMPI = 2 }; |
113 | 113 | ||
114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
115 | ~KSyncManager() ; | 115 | ~KSyncManager() ; |
116 | 116 | ||
117 | void multiSync( bool askforPrefs ); | 117 | void multiSync( bool askforPrefs ); |
118 | bool blockSave() { return mBlockSaveFlag; } | 118 | bool blockSave() { return mBlockSaveFlag; } |
119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
120 | void setDefaultFileName( QString s) { mDefFileName = s ;} | 120 | void setDefaultFileName( QString s) { mDefFileName = s ;} |
121 | QString defaultFileName() { return mDefFileName ;} | 121 | QString defaultFileName() { return mDefFileName ;} |
122 | QString syncFileName(); | 122 | QString syncFileName(); |
123 | 123 | ||
124 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } | 124 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
125 | QString getCurrentSyncName() { return mCurrentSyncName; } | 125 | QString getCurrentSyncName() { return mCurrentSyncName; } |
126 | 126 | ||
127 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 127 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
128 | void hideProgressBar(); | 128 | void hideProgressBar(); |
129 | bool isProgressBarCanceled(); | 129 | bool isProgressBarCanceled(); |
130 | 130 | ||
131 | // sync stuff | 131 | // sync stuff |
132 | QString mLocalMachineName; | 132 | QString mLocalMachineName; |
133 | QStringList mExternSyncProfiles; | 133 | QStringList mExternSyncProfiles; |
134 | QStringList mSyncProfileNames; | 134 | QStringList mSyncProfileNames; |
135 | bool mAskForPreferences; | 135 | bool mAskForPreferences; |
136 | bool mShowSyncSummary; | 136 | bool mShowSyncSummary; |
137 | bool mIsKapiFile; | 137 | bool mIsKapiFile; |
138 | bool mWriteBackExistingOnly; | 138 | bool mWriteBackExistingOnly; |
139 | int mSyncAlgoPrefs; | 139 | int mSyncAlgoPrefs; |
140 | bool mWriteBackFile; | 140 | bool mWriteBackFile; |
141 | int mWriteBackInFuture; | 141 | int mWriteBackInFuture; |
142 | QString mPhoneDevice; | 142 | QString mPhoneDevice; |
143 | QString mPhoneConnection; | 143 | QString mPhoneConnection; |
144 | QString mPhoneModel; | 144 | QString mPhoneModel; |
145 | QString mPassWordPiSync; | 145 | QString mPassWordPiSync; |
146 | QString mActiveSyncPort; | 146 | QString mActiveSyncPort; |
147 | QString mActiveSyncIP ; | 147 | QString mActiveSyncIP ; |
148 | 148 | ||
149 | signals: | 149 | signals: |
150 | void save(); | 150 | void save(); |
151 | void request_file(); | 151 | void request_file(); |
152 | void getFile( bool ); | 152 | void getFile( bool ); |
153 | 153 | ||
154 | public slots: | 154 | public slots: |
155 | void slotSyncMenu( int ); | 155 | void slotSyncMenu( int ); |
156 | void deleteCommandSocket(KCommandSocket*s, int state); | 156 | void deleteCommandSocket(KCommandSocket*s, int state); |
157 | void readFileFromSocket(); | 157 | void readFileFromSocket(); |
158 | void fillSyncMenu(); | 158 | void fillSyncMenu(); |
159 | 159 | ||
160 | private: | 160 | private: |
161 | void syncPi(); | 161 | void syncPi(); |
162 | KServerSocket * mServerSocket; | 162 | KServerSocket * mServerSocket; |
163 | void enableQuick(); | 163 | void enableQuick(); |
164 | KPimPrefs* mPrefs; | 164 | KPimPrefs* mPrefs; |
165 | QString mDefFileName; | 165 | QString mDefFileName; |
166 | QString mCurrentSyncDevice; | 166 | QString mCurrentSyncDevice; |
167 | QString mCurrentSyncName; | 167 | QString mCurrentSyncName; |
168 | void quickSyncLocalFile(); | 168 | void quickSyncLocalFile(); |
169 | bool syncWithFile( QString fn , bool quick ); | 169 | bool syncWithFile( QString fn , bool quick ); |
170 | void syncLocalFile(); | 170 | void syncLocalFile(); |
171 | void syncPhone(); | 171 | void syncPhone(); |
172 | void syncSharp(); | 172 | void syncSharp(); |
173 | void syncKDE(); | ||
173 | bool syncExternalApplication(QString); | 174 | bool syncExternalApplication(QString); |
174 | int mCurrentSyncProfile ; | 175 | int mCurrentSyncProfile ; |
175 | void syncRemote( KSyncProfile* prof, bool ask = true); | 176 | void syncRemote( KSyncProfile* prof, bool ask = true); |
176 | void edit_sync_options(); | 177 | void edit_sync_options(); |
177 | void edit_pisync_options(); | 178 | void edit_pisync_options(); |
178 | int ringSync(); | 179 | int ringSync(); |
179 | QString getPassword( ); | 180 | QString getPassword( ); |
180 | 181 | ||
181 | private slots: | 182 | private slots: |
182 | void confSync(); | 183 | void confSync(); |
183 | private: | 184 | private: |
184 | bool mBlockSaveFlag; | 185 | bool mBlockSaveFlag; |
185 | QWidget* mParent; | 186 | QWidget* mParent; |
186 | KSyncInterface* mImplementation; | 187 | KSyncInterface* mImplementation; |
187 | TargetApp mTargetApp; | 188 | TargetApp mTargetApp; |
188 | QPopupMenu* mSyncMenu; | 189 | QPopupMenu* mSyncMenu; |
189 | QProgressBar* bar; | 190 | QProgressBar* bar; |
190 | 191 | ||
191 | }; | 192 | }; |
192 | 193 | ||
193 | 194 | ||
194 | class KSyncInterface | 195 | class KSyncInterface |
195 | { | 196 | { |
196 | public : | 197 | public : |
197 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; | 198 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; |
198 | virtual bool syncExternal(KSyncManager* manager, QString resource) | 199 | virtual bool syncExternal(KSyncManager* manager, QString resource) |
199 | { | 200 | { |
200 | // empty implementation, because some syncable applications do not | 201 | // empty implementation, because some syncable applications do not |
201 | // have an external(sharpdtm) syncmode, like pwmanager. | 202 | // have an external(sharpdtm) syncmode, like pwmanager. |
202 | return false; | 203 | return false; |
203 | } | 204 | } |
204 | 205 | ||
205 | 206 | ||
206 | }; | 207 | }; |
207 | 208 | ||
208 | 209 | ||
209 | #endif | 210 | #endif |