author | zautrix <zautrix> | 2004-12-04 22:11:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-04 22:11:00 (UTC) |
commit | ac994c86c3037dbe2273e62c46115b942b09fdcc (patch) (unidiff) | |
tree | 5c33da571f716ff91f300cf26ebf619d43a03fdc | |
parent | 9c7f3267a1d7db2dbc3bd6384e75cf8ffea1c3df (diff) | |
download | kdepimpi-ac994c86c3037dbe2273e62c46115b942b09fdcc.zip kdepimpi-ac994c86c3037dbe2273e62c46115b942b09fdcc.tar.gz kdepimpi-ac994c86c3037dbe2273e62c46115b942b09fdcc.tar.bz2 |
ompi fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 4fff7e1..6be5222 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,617 +1,621 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 1.9.14 ************ | 3 | ********** VERSION 1.9.14 ************ |
4 | 4 | ||
5 | Fixed some problems with the dialog sizes when switching | 5 | Fixed some problems with the dialog sizes when switching |
6 | portrait/landscape mode on 640x480 PDA display. | 6 | portrait/landscape mode on 640x480 PDA display. |
7 | 7 | ||
8 | Fixed some other small bugs. | 8 | Fixed some other small bugs. |
9 | 9 | ||
10 | Fixed an ugly bug in KOpieMail: | 10 | Fixed an ugly bug in KOpieMail: |
11 | KOpieMail was not able to write files (mails) to MSDOS file system, | 11 | KOpieMail was not able to write files (mails) to MSDOS file system, |
12 | like on an usual preformatted SD card. That should work now. | 12 | like on an usual preformatted SD card. That should work now. |
13 | To save your mail data on the Sd card do the following: | 13 | To save your mail data on the Sd card do the following: |
14 | Create a dir on the SD card: | 14 | Create a dir on the SD card: |
15 | mkdir /mnt/card/localmail | 15 | mkdir /mnt/card/localmail |
16 | Go to your home dir: | 16 | Go to your home dir: |
17 | cd | 17 | cd |
18 | Go to kopiemail data storage dir: | 18 | Go to kopiemail data storage dir: |
19 | cd kdepim/apps/kopiemail | 19 | cd kdepim/apps/kopiemail |
20 | Create a symlink to the SD card: | 20 | Create a symlink to the SD card: |
21 | ls -s /mnt/card/localmail | 21 | ls -s /mnt/card/localmail |
22 | Now KOpieMail will store all mails on the SD card. | 22 | Now KOpieMail will store all mails on the SD card. |
23 | 23 | ||
24 | KO/Pi Monthview: | 24 | KO/Pi Monthview: |
25 | Now "Go to Today" selects the current month from day 1-end, | 25 | Now "Go to Today" selects the current month from day 1-end, |
26 | not the current date + some days. | 26 | not the current date + some days. |
27 | I.e. "Go to Today" shows now always | 27 | I.e. "Go to Today" shows now always |
28 | the current month with first day of month in the first row. | 28 | the current month with first day of month in the first row. |
29 | 29 | ||
30 | Added missing German translation. | ||
31 | |||
32 | Fixed icons of executeable on Wintendo. | ||
33 | |||
30 | 34 | ||
31 | ********** VERSION 1.9.13 ************ | 35 | ********** VERSION 1.9.13 ************ |
32 | 36 | ||
33 | Fixed nasty PwM/Pi file reading bug, when | 37 | Fixed nasty PwM/Pi file reading bug, when |
34 | the used hash algo of file is different then the global | 38 | the used hash algo of file is different then the global |
35 | hash algo. | 39 | hash algo. |
36 | 40 | ||
37 | Added KA/Pi support for opie mailit mailapplication. | 41 | Added KA/Pi support for opie mailit mailapplication. |
38 | 42 | ||
39 | Fixed some bugs in OM/Pi. | 43 | Fixed some bugs in OM/Pi. |
40 | Now character conversion tables are available for the Zaurus | 44 | Now character conversion tables are available for the Zaurus |
41 | to make OM/Pi working properly. | 45 | to make OM/Pi working properly. |
42 | To get the character conversion in OM/Pi working, please download | 46 | To get the character conversion in OM/Pi working, please download |
43 | at the sourceforge project site the package | 47 | at the sourceforge project site the package |
44 | sr-character-conversion_SharpROM_arm.ipk.zip | 48 | sr-character-conversion_SharpROM_arm.ipk.zip |
45 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) | 49 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) |
46 | from the section "general files for KDE/Pim" | 50 | from the section "general files for KDE/Pim" |
47 | Instructions how to install this package are in a ReadMe in this file. | 51 | Instructions how to install this package are in a ReadMe in this file. |
48 | 52 | ||
49 | 53 | ||
50 | Fixed the orientation change problem in KA/Pi when switching | 54 | Fixed the orientation change problem in KA/Pi when switching |
51 | portrait/landscape mode. | 55 | portrait/landscape mode. |
52 | 56 | ||
53 | French translation available for KA/Pi and OM/Pi. | 57 | French translation available for KA/Pi and OM/Pi. |
54 | 58 | ||
55 | Fixed some problems with categories in KO/Pi in DTM sync. | 59 | Fixed some problems with categories in KO/Pi in DTM sync. |
56 | 60 | ||
57 | Added selection dialog for export to phone in KA/Pi. | 61 | Added selection dialog for export to phone in KA/Pi. |
58 | 62 | ||
59 | If in KO/Pi is an attendee selected to add to a meeting and this | 63 | If in KO/Pi is an attendee selected to add to a meeting and this |
60 | attendee is already in the list of attendees, this person is not added | 64 | attendee is already in the list of attendees, this person is not added |
61 | again. | 65 | again. |
62 | 66 | ||
63 | Some menu cleanup in KA/Pi. | 67 | Some menu cleanup in KA/Pi. |
64 | 68 | ||
65 | ********** VERSION 1.9.12 ************ | 69 | ********** VERSION 1.9.12 ************ |
66 | 70 | ||
67 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. | 71 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. |
68 | 72 | ||
69 | Bugfix: Licence file is now shown again. | 73 | Bugfix: Licence file is now shown again. |
70 | 74 | ||
71 | OM/Pi now supports Unicode (utf8 charset). | 75 | OM/Pi now supports Unicode (utf8 charset). |
72 | Fixed some bugs in OM/Pi. | 76 | Fixed some bugs in OM/Pi. |
73 | 77 | ||
74 | KA/Pi has more German translation. | 78 | KA/Pi has more German translation. |
75 | 79 | ||
76 | 80 | ||
77 | ********** VERSION 1.9.11 ************ | 81 | ********** VERSION 1.9.11 ************ |
78 | 82 | ||
79 | Fixed several problems in PWM/Pi, like | 83 | Fixed several problems in PWM/Pi, like |
80 | asking the user, if unsaved changed are pending | 84 | asking the user, if unsaved changed are pending |
81 | when closing the app. | 85 | when closing the app. |
82 | And PwM/Pi handles now different texts for the | 86 | And PwM/Pi handles now different texts for the |
83 | fields Description, Username, Password, configurable per category. | 87 | fields Description, Username, Password, configurable per category. |
84 | 88 | ||
85 | Fixed a crash in KO/Pi , when importing/loading vcs files | 89 | Fixed a crash in KO/Pi , when importing/loading vcs files |
86 | which have an entry with an attendee with state: | 90 | which have an entry with an attendee with state: |
87 | NEEDS ACTION | 91 | NEEDS ACTION |
88 | 92 | ||
89 | Fixed some problems in the German translation of OM/Pi, | 93 | Fixed some problems in the German translation of OM/Pi, |
90 | which makes some dialogs not fitting on the screen | 94 | which makes some dialogs not fitting on the screen |
91 | of the Z 5500. | 95 | of the Z 5500. |
92 | 96 | ||
93 | Fixed Qtopia crash, when disabling/deinstalling | 97 | Fixed Qtopia crash, when disabling/deinstalling |
94 | KO/Pi alarm applet. | 98 | KO/Pi alarm applet. |
95 | 99 | ||
96 | Implemented direct KDE<->KA/Pi sync for KA/Pi running | 100 | Implemented direct KDE<->KA/Pi sync for KA/Pi running |
97 | on Linux desktop. | 101 | on Linux desktop. |
98 | 102 | ||
99 | Added feature "remove sync info" to sync menu. | 103 | Added feature "remove sync info" to sync menu. |
100 | 104 | ||
101 | Tweaked the KO/Pi What's next view a bit, added | 105 | Tweaked the KO/Pi What's next view a bit, added |
102 | setting to hide events that are done. | 106 | setting to hide events that are done. |
103 | 107 | ||
104 | Disabled "beam receive enabled" on startup to | 108 | Disabled "beam receive enabled" on startup to |
105 | avoid problems if Fastload is enabled. | 109 | avoid problems if Fastload is enabled. |
106 | Please set "beam receive enabled", | 110 | Please set "beam receive enabled", |
107 | if you want to receive data via IR. | 111 | if you want to receive data via IR. |
108 | 112 | ||
109 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running | 113 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running |
110 | on Linux desktop. | 114 | on Linux desktop. |
111 | 115 | ||
112 | Made in KA/Pi scrolling possible, if details view is selected. | 116 | Made in KA/Pi scrolling possible, if details view is selected. |
113 | (The keyboard focus is set automatically to the search line) | 117 | (The keyboard focus is set automatically to the search line) |
114 | 118 | ||
115 | Fixed a bug in DMT sync, that a new entry in DTM was added | 119 | Fixed a bug in DMT sync, that a new entry in DTM was added |
116 | on every sync to Kx/Pi. | 120 | on every sync to Kx/Pi. |
117 | 121 | ||
118 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. | 122 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. |
119 | 123 | ||
120 | Fixed a bug in DMT sync with todos created in KO/Pi containing | 124 | Fixed a bug in DMT sync with todos created in KO/Pi containing |
121 | non-latin1 characters. | 125 | non-latin1 characters. |
122 | 126 | ||
123 | Rearranged package contents of Sharp-ipks and made all | 127 | Rearranged package contents of Sharp-ipks and made all |
124 | packages installable on SD again. | 128 | packages installable on SD again. |
125 | 129 | ||
126 | Fixed the writing of addressbook data in DTM sync. | 130 | Fixed the writing of addressbook data in DTM sync. |
127 | Empty fields in KA/Pi were not removed. | 131 | Empty fields in KA/Pi were not removed. |
128 | 132 | ||
129 | Added better category handling in KA/Pi: | 133 | Added better category handling in KA/Pi: |
130 | Added item | 134 | Added item |
131 | Edit Categories and | 135 | Edit Categories and |
132 | Manage new categories | 136 | Manage new categories |
133 | to the settings menu. | 137 | to the settings menu. |
134 | Possible to configure a view to display categories. | 138 | Possible to configure a view to display categories. |
135 | 139 | ||
136 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. | 140 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. |
137 | 141 | ||
138 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. | 142 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. |
139 | 143 | ||
140 | ... and many other bugfixes. | 144 | ... and many other bugfixes. |
141 | 145 | ||
142 | ********** VERSION 1.9.10 ************ | 146 | ********** VERSION 1.9.10 ************ |
143 | 147 | ||
144 | Many internal small bugfixes. | 148 | Many internal small bugfixes. |
145 | And fix of the "big" bug in KO/Pi, | 149 | And fix of the "big" bug in KO/Pi, |
146 | that after Syncing the appointments had an offset by several hours. | 150 | that after Syncing the appointments had an offset by several hours. |
147 | That was a problem with the internal timezone setting, | 151 | That was a problem with the internal timezone setting, |
148 | introduced by the changed timezone configuration settings. | 152 | introduced by the changed timezone configuration settings. |
149 | 153 | ||
150 | German translation for OM/Pi is now available. | 154 | German translation for OM/Pi is now available. |
151 | 155 | ||
152 | 156 | ||
153 | ********** VERSION 1.9.9 ************ | 157 | ********** VERSION 1.9.9 ************ |
154 | 158 | ||
155 | KDE-Pim/Pi has a new Member! | 159 | KDE-Pim/Pi has a new Member! |
156 | It is called PWM/Pi (Passwordmanager/platform-independent) | 160 | It is called PWM/Pi (Passwordmanager/platform-independent) |
157 | and it is available for the Zaurus. | 161 | and it is available for the Zaurus. |
158 | It is planned, that it will be available later for Windows. | 162 | It is planned, that it will be available later for Windows. |
159 | (And for Linux, of course). | 163 | (And for Linux, of course). |
160 | It is a port of the Passwordmanager of KDE. | 164 | It is a port of the Passwordmanager of KDE. |
161 | It will need the MicroKDElibs to run. | 165 | It will need the MicroKDElibs to run. |
162 | 166 | ||
163 | Made loading of addressbooks in KA/Pi up to 7 times faster! | 167 | Made loading of addressbooks in KA/Pi up to 7 times faster! |
164 | The bigger your addressbook file, the more starting speed | 168 | The bigger your addressbook file, the more starting speed |
165 | will you gain. (relatively) | 169 | will you gain. (relatively) |
166 | 170 | ||
167 | The Qtopia addressbook connector is now platform independend | 171 | The Qtopia addressbook connector is now platform independend |
168 | as well and should work on any platform for importing/exporting | 172 | as well and should work on any platform for importing/exporting |
169 | Qtopia and Opie XML files. | 173 | Qtopia and Opie XML files. |
170 | 174 | ||
171 | Added a +30min feature to the timezone settings to make | 175 | Added a +30min feature to the timezone settings to make |
172 | KDE-Pim/Pi useable in Australia and other parts on the | 176 | KDE-Pim/Pi useable in Australia and other parts on the |
173 | world with strange timezones ;-) | 177 | world with strange timezones ;-) |
174 | 178 | ||
175 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. | 179 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. |
176 | 180 | ||
177 | It is now possible to disable the | 181 | It is now possible to disable the |
178 | "receive data via infrared" feature, such that syncing with | 182 | "receive data via infrared" feature, such that syncing with |
179 | Outlook is now possible again with Kx/Pi runing. | 183 | Outlook is now possible again with Kx/Pi runing. |
180 | Please disable it, before syncing Sharp DTM with Outlook. | 184 | Please disable it, before syncing Sharp DTM with Outlook. |
181 | For your convenience, the "receive data via infrared" feature | 185 | For your convenience, the "receive data via infrared" feature |
182 | is disabled automatically, if you sync Kx/Pi with DTM. | 186 | is disabled automatically, if you sync Kx/Pi with DTM. |
183 | You have to enable it again manually after syncing. | 187 | You have to enable it again manually after syncing. |
184 | Enabling this feature makes it impossible to start the | 188 | Enabling this feature makes it impossible to start the |
185 | Sharp DTM apps. If this feature is enabled, you will only get the | 189 | Sharp DTM apps. If this feature is enabled, you will only get the |
186 | alarm notification from KO/Pi and not from the Sharp calendar. | 190 | alarm notification from KO/Pi and not from the Sharp calendar. |
187 | This is very useful if you sync KO/Pi with Sharp DTM, | 191 | This is very useful if you sync KO/Pi with Sharp DTM, |
188 | because after syncing you usually would get notified about | 192 | because after syncing you usually would get notified about |
189 | an alarm by KO/Pi and the Sharp Calendar. | 193 | an alarm by KO/Pi and the Sharp Calendar. |
190 | 194 | ||
191 | Together with the Linux desktop version of KO/Pi | 195 | Together with the Linux desktop version of KO/Pi |
192 | it is now possible to sync KO/Pi on the Zaurus | 196 | it is now possible to sync KO/Pi on the Zaurus |
193 | with the complete KDE-desktop (3.3 or later) | 197 | with the complete KDE-desktop (3.3 or later) |
194 | calendar data easily. | 198 | calendar data easily. |
195 | That makes it possible to sync the Z with one | 199 | That makes it possible to sync the Z with one |
196 | click of a mouse with the KDE-Desktop. | 200 | click of a mouse with the KDE-Desktop. |
197 | This feature it available for all Zaurus platforms KO/Pi | 201 | This feature it available for all Zaurus platforms KO/Pi |
198 | is running on. | 202 | is running on. |
199 | The only thing needed is a running KO/Pi on Linux and | 203 | The only thing needed is a running KO/Pi on Linux and |
200 | a compiled version of the small | 204 | a compiled version of the small |
201 | KDE-Pim/Pi<->KDE-Desktop access command line program, | 205 | KDE-Pim/Pi<->KDE-Desktop access command line program, |
202 | which is in the KDE-Pim/Pi sources available. | 206 | which is in the KDE-Pim/Pi sources available. |
203 | 207 | ||
204 | The "KDE-desktop" syncing feature for KA/Pi will follow | 208 | The "KDE-desktop" syncing feature for KA/Pi will follow |
205 | in the next releases. | 209 | in the next releases. |
206 | 210 | ||
207 | Fixed the vcard export bug, which had the version 1.9.8. | 211 | Fixed the vcard export bug, which had the version 1.9.8. |
208 | 212 | ||
209 | Added missing GERMAN translation to KO/Pi. | 213 | Added missing GERMAN translation to KO/Pi. |
210 | Hi PsionX, could you add the missing french translation?Thx! | 214 | Hi PsionX, could you add the missing french translation?Thx! |
211 | 215 | ||
212 | Translation files for KA/Pi are available as well. | 216 | Translation files for KA/Pi are available as well. |
213 | GERMAN translation will be available in the next release. | 217 | GERMAN translation will be available in the next release. |
214 | PsionX ( yres, you again ;-) ), could you start translating | 218 | PsionX ( yres, you again ;-) ), could you start translating |
215 | KA/Pi? Thx! | 219 | KA/Pi? Thx! |
216 | 220 | ||
217 | You can download the version 1.9.9 at | 221 | You can download the version 1.9.9 at |
218 | 222 | ||
219 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 | 223 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 |
220 | 224 | ||
221 | Note: | 225 | Note: |
222 | To run the mail program OM/Pi you need libopenssl. | 226 | To run the mail program OM/Pi you need libopenssl. |
223 | A link to a download loaction is available at | 227 | A link to a download loaction is available at |
224 | ZSI at www.killefiz.de | 228 | ZSI at www.killefiz.de |
225 | 229 | ||
226 | 230 | ||
227 | ********** VERSION 1.9.8 ************ | 231 | ********** VERSION 1.9.8 ************ |
228 | 232 | ||
229 | Fixed character decoding in OM/Pi. | 233 | Fixed character decoding in OM/Pi. |
230 | (e.g. German "Umlaute" were not displayed properly.) | 234 | (e.g. German "Umlaute" were not displayed properly.) |
231 | 235 | ||
232 | Made is possible to reparent todos in KO/Pi. | 236 | Made is possible to reparent todos in KO/Pi. |
233 | Use contextmenu or keys (look at Help-Keys + Colors) for that. | 237 | Use contextmenu or keys (look at Help-Keys + Colors) for that. |
234 | 238 | ||
235 | Added the missing Sync-Howto and WhatsNew to the packages. | 239 | Added the missing Sync-Howto and WhatsNew to the packages. |
236 | 240 | ||
237 | KO/Pi on Linux desktop can now sync with KDE desktop. | 241 | KO/Pi on Linux desktop can now sync with KDE desktop. |
238 | That means: When using KO/Pi on Linux desktop for syncing with | 242 | That means: When using KO/Pi on Linux desktop for syncing with |
239 | KDE desktop and the Zaurus, the Zaurus can be synced now | 243 | KDE desktop and the Zaurus, the Zaurus can be synced now |
240 | with all KDE-Calendar resources, not only with one local file. | 244 | with all KDE-Calendar resources, not only with one local file. |
241 | (That makes it possible to sync the Zaurus with the | 245 | (That makes it possible to sync the Zaurus with the |
242 | calendar data on a Kolab server) | 246 | calendar data on a Kolab server) |
243 | 247 | ||
244 | KA/Pi syncing with KDE desktop will be available in the next version. | 248 | KA/Pi syncing with KDE desktop will be available in the next version. |
245 | 249 | ||
246 | 250 | ||
247 | ********** VERSION 1.9.7 ************ | 251 | ********** VERSION 1.9.7 ************ |
248 | 252 | ||
249 | KO/Pi - KA/Pi on Windows: | 253 | KO/Pi - KA/Pi on Windows: |
250 | Now a directory can be defined by the user, where the | 254 | Now a directory can be defined by the user, where the |
251 | application/config data should be saved. | 255 | application/config data should be saved. |
252 | Define your desired path in the evironment variable | 256 | Define your desired path in the evironment variable |
253 | MICROKDEHOME | 257 | MICROKDEHOME |
254 | before starting KO/Pi or KA/Pi. | 258 | before starting KO/Pi or KA/Pi. |
255 | 259 | ||
256 | An easy Kx/Pi to Kx/Pi syncing is now possible | 260 | An easy Kx/Pi to Kx/Pi syncing is now possible |
257 | (it is called Pi-Sync) via network. | 261 | (it is called Pi-Sync) via network. |
258 | Please look at the Sync Howto. | 262 | Please look at the Sync Howto. |
259 | 263 | ||
260 | Exporting of calendar data and contacts to mobile phones is now possible. | 264 | Exporting of calendar data and contacts to mobile phones is now possible. |
261 | The SyncHowto is updated with information howto | 265 | The SyncHowto is updated with information howto |
262 | access/sync mobile phones. | 266 | access/sync mobile phones. |
263 | Please look at the Sync Howto. | 267 | Please look at the Sync Howto. |
264 | 268 | ||
265 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. | 269 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. |
266 | Please disable Fastload for the original contact/calendar applications | 270 | Please disable Fastload for the original contact/calendar applications |
267 | and close them. | 271 | and close them. |
268 | KO/Pi and KA/Pi must be running in order to receive the data. | 272 | KO/Pi and KA/Pi must be running in order to receive the data. |
269 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) | 273 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) |
270 | 274 | ||
271 | In the KA/Pi details view are now the preferred tel. numbers displayed on top | 275 | In the KA/Pi details view are now the preferred tel. numbers displayed on top |
272 | of the other data ( emails/tel.numbers/addresses) | 276 | of the other data ( emails/tel.numbers/addresses) |
273 | 277 | ||
274 | Fixed some syncing problems in KA/Pi. | 278 | Fixed some syncing problems in KA/Pi. |
275 | 279 | ||
276 | Added font settings for the KA/Pi details view. | 280 | Added font settings for the KA/Pi details view. |
277 | Added fields "children's name" and "gender" to KA/Pi. | 281 | Added fields "children's name" and "gender" to KA/Pi. |
278 | 282 | ||
279 | Made searching in KA/Pi better: | 283 | Made searching in KA/Pi better: |
280 | Now the first item in a view is selected after a search automatically and | 284 | Now the first item in a view is selected after a search automatically and |
281 | the views can be scrolled up/down when the search input field has the keyboard focus. | 285 | the views can be scrolled up/down when the search input field has the keyboard focus. |
282 | 286 | ||
283 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. | 287 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. |
284 | 288 | ||
285 | 289 | ||
286 | ********** VERSION 1.9.6 ************ | 290 | ********** VERSION 1.9.6 ************ |
287 | 291 | ||
288 | Changes in the external application communication on the Zaurus | 292 | Changes in the external application communication on the Zaurus |
289 | in order to use less RAM when the apps are running. | 293 | in order to use less RAM when the apps are running. |
290 | First syncing of addressbooks (KA/Pi) is possible. | 294 | First syncing of addressbooks (KA/Pi) is possible. |
291 | 295 | ||
292 | 296 | ||
293 | ********** VERSION 1.9.5a ************ | 297 | ********** VERSION 1.9.5a ************ |
294 | 298 | ||
295 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. | 299 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. |
296 | Fixed some small bugs. | 300 | Fixed some small bugs. |
297 | KA/Pi shows now the birthday in summary view. | 301 | KA/Pi shows now the birthday in summary view. |
298 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi | 302 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi |
299 | for displaying dates. | 303 | for displaying dates. |
300 | 304 | ||
301 | 305 | ||
302 | ********** VERSION 1.9.5 ************ | 306 | ********** VERSION 1.9.5 ************ |
303 | 307 | ||
304 | There is still no Addressbook syncing! | 308 | There is still no Addressbook syncing! |
305 | 309 | ||
306 | New in 1.9.5: | 310 | New in 1.9.5: |
307 | 311 | ||
308 | Many bugfixes. | 312 | Many bugfixes. |
309 | Better searching in KA/Pi. | 313 | Better searching in KA/Pi. |
310 | You can configure in KA/Pi if you want to search only after | 314 | You can configure in KA/Pi if you want to search only after |
311 | <return> key pressed. | 315 | <return> key pressed. |
312 | 316 | ||
313 | Better mail downloading in OM/Pi. | 317 | Better mail downloading in OM/Pi. |
314 | 318 | ||
315 | First experimental alpha version of sync of KO/Pi with mobile phones. | 319 | First experimental alpha version of sync of KO/Pi with mobile phones. |
316 | See gammu documentation for supported phones. | 320 | See gammu documentation for supported phones. |
317 | You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp. | 321 | You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp. |
318 | Quick hint how to use: | 322 | Quick hint how to use: |
319 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! | 323 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! |
320 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. | 324 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. |
321 | Create syncprofile - mobile device | 325 | Create syncprofile - mobile device |
322 | Remove entry for model. (Leave empty ). | 326 | Remove entry for model. (Leave empty ). |
323 | Enable infrared on Zaurus and your Phone. | 327 | Enable infrared on Zaurus and your Phone. |
324 | Sync. | 328 | Sync. |
325 | To get a more detailed log, start kopi from konsole. | 329 | To get a more detailed log, start kopi from konsole. |
326 | 330 | ||
327 | ********** VERSION 1.9.4 ************ | 331 | ********** VERSION 1.9.4 ************ |
328 | 332 | ||
329 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. | 333 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. |
330 | 334 | ||
331 | WARNING: | 335 | WARNING: |
332 | PLEASE BACKUP ALL YOUR DATA! | 336 | PLEASE BACKUP ALL YOUR DATA! |
333 | We have changed a lot and maybe there are some unknown problems. | 337 | We have changed a lot and maybe there are some unknown problems. |
334 | 338 | ||
335 | SYNC HANDLING HAS CHANGED! | 339 | SYNC HANDLING HAS CHANGED! |
336 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. | 340 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. |
337 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). | 341 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). |
338 | 342 | ||
339 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. | 343 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. |
340 | If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well. | 344 | If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well. |
341 | 345 | ||
342 | As programs are available: | 346 | As programs are available: |
343 | KO/Pi (korganizer ipk) - a calendar program. | 347 | KO/Pi (korganizer ipk) - a calendar program. |
344 | KA/Pi (kaddressbook ipk ) - an addressbook | 348 | KA/Pi (kaddressbook ipk ) - an addressbook |
345 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. | 349 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. |
346 | 350 | ||
347 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. | 351 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. |
348 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) | 352 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) |
349 | 353 | ||
350 | All the applications are installed in a "Pim" TAB. | 354 | All the applications are installed in a "Pim" TAB. |
351 | If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk | 355 | If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk |
352 | 356 | ||
353 | All the application are integrated. | 357 | All the application are integrated. |
354 | Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail. | 358 | Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail. |
355 | 359 | ||
356 | HINT: | 360 | HINT: |
357 | If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. | 361 | If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. |
358 | 362 | ||
359 | What's new? | 363 | What's new? |
360 | 364 | ||
361 | SYNC HANDLING HAS CHANGED! | 365 | SYNC HANDLING HAS CHANGED! |
362 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. | 366 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. |
363 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). | 367 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). |
364 | 368 | ||
365 | New in OM/Pi: | 369 | New in OM/Pi: |
366 | When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails. | 370 | When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails. |
367 | 371 | ||
368 | New in KO/Pi: | 372 | New in KO/Pi: |
369 | French is now available for KO/Pi. | 373 | French is now available for KO/Pi. |
370 | Choose menu:Actions - Configure:TAB locale | 374 | Choose menu:Actions - Configure:TAB locale |
371 | Syncing has changed. | 375 | Syncing has changed. |
372 | Phone sync available soon. | 376 | Phone sync available soon. |
373 | Not much changes, I cannot remember them ... | 377 | Not much changes, I cannot remember them ... |
374 | 378 | ||
375 | New in KA/Pi: | 379 | New in KA/Pi: |
376 | Beaming possible. | 380 | Beaming possible. |
377 | Sharp DTM readonly access possible( create a new DTM resource ); | 381 | Sharp DTM readonly access possible( create a new DTM resource ); |
378 | Better searching possible. | 382 | Better searching possible. |
379 | Search is performed only after pressing the return key. | 383 | Search is performed only after pressing the return key. |
380 | Use wildcard * to specify parts of a name. | 384 | Use wildcard * to specify parts of a name. |
381 | 385 | ||
382 | Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * . | 386 | Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * . |
383 | 387 | ||
384 | A big improvement is the new management of the contact access. | 388 | A big improvement is the new management of the contact access. |
385 | In version 1.9.3, every application was using their own addressbook access data. | 389 | In version 1.9.3, every application was using their own addressbook access data. |
386 | That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. | 390 | That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. |
387 | That was wasting of memory, if you had several hundreds of contacts. | 391 | That was wasting of memory, if you had several hundreds of contacts. |
388 | 392 | ||
389 | Now only KA/Pi accesses the addressbook. | 393 | Now only KA/Pi accesses the addressbook. |
390 | If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them. | 394 | If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them. |
391 | If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. | 395 | If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. |
392 | That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. | 396 | That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. |
393 | 397 | ||
394 | New in the KO/Pi alarm applet: | 398 | New in the KO/Pi alarm applet: |
395 | Configure your own timer popup menu! | 399 | Configure your own timer popup menu! |
396 | (Text and minutes for timer countdown) | 400 | (Text and minutes for timer countdown) |
397 | Just edit the file | 401 | Just edit the file |
398 | (yourhomedir)/.kopialarmtimerrc | 402 | (yourhomedir)/.kopialarmtimerrc |
399 | and start/stop a timer to get a new menu with the data of this file. | 403 | and start/stop a timer to get a new menu with the data of this file. |
400 | 404 | ||
401 | ********** VERSION 1.9.3 ************ | 405 | ********** VERSION 1.9.3 ************ |
402 | 1) | 406 | 1) |
403 | Now KO/Pi on Windows imports directly the calendar data of | 407 | Now KO/Pi on Windows imports directly the calendar data of |
404 | an installed Outlook. Should work with OL version >= 2000. | 408 | an installed Outlook. Should work with OL version >= 2000. |
405 | 409 | ||
406 | ********** VERSION 1.9.2 ************ | 410 | ********** VERSION 1.9.2 ************ |
407 | 1) | 411 | 1) |
408 | KDE-Pim/Pi has got a new member: | 412 | KDE-Pim/Pi has got a new member: |
409 | KmicroMail (KM/Pi) is a mail program, | 413 | KmicroMail (KM/Pi) is a mail program, |
410 | which can handle IMAP and POP mail access. | 414 | which can handle IMAP and POP mail access. |
411 | It is based on Opie-Mail v3. | 415 | It is based on Opie-Mail v3. |
412 | All dependencies to the Opie libraries ar removed, | 416 | All dependencies to the Opie libraries ar removed, |
413 | such that no additional Opie lib is needed. | 417 | such that no additional Opie lib is needed. |
414 | It is already integrated in KO/Pi and KA/Pi. | 418 | It is already integrated in KO/Pi and KA/Pi. |
415 | It it now available for the Zaurus,probably it | 419 | It it now available for the Zaurus,probably it |
416 | will be available for other platforms later. | 420 | will be available for other platforms later. |
417 | Hint: | 421 | Hint: |
418 | Create your own contact (name + email) | 422 | Create your own contact (name + email) |
419 | in KA/Pi, select this contact and choose menu: | 423 | in KA/Pi, select this contact and choose menu: |
420 | Settings - Set Who Am I. | 424 | Settings - Set Who Am I. |
421 | Now the settings of this contact are used as | 425 | Now the settings of this contact are used as |
422 | the sender data in KM/Pi. | 426 | the sender data in KM/Pi. |
423 | 2) | 427 | 2) |
424 | KDE-Pim/Pi is split up in five different | 428 | KDE-Pim/Pi is split up in five different |
425 | packages now precompiled for Sharp Zaurus: | 429 | packages now precompiled for Sharp Zaurus: |
426 | --kmicrokdelibs_1.9.2_arm.ipk | 430 | --kmicrokdelibs_1.9.2_arm.ipk |
427 | The libs are needed for any | 431 | The libs are needed for any |
428 | of the following programs: | 432 | of the following programs: |
429 | --kaddressbook_1.9.2_arm.ipk | 433 | --kaddressbook_1.9.2_arm.ipk |
430 | --kmicromail_1.9.2_arm.ipk | 434 | --kmicromail_1.9.2_arm.ipk |
431 | --korganizer_1.9.2_arm.ipk | 435 | --korganizer_1.9.2_arm.ipk |
432 | Independ from that, there is the alarm applet | 436 | Independ from that, there is the alarm applet |
433 | available for KO/Pi, which also offers | 437 | available for KO/Pi, which also offers |
434 | quick access for a new mail or | 438 | quick access for a new mail or |
435 | showing the addressbook.: | 439 | showing the addressbook.: |
436 | --korganizer-alarm_1.9.2_arm.ipk | 440 | --korganizer-alarm_1.9.2_arm.ipk |
437 | Independend means, that the alarm applet | 441 | Independend means, that the alarm applet |
438 | does not need any of the libs or programs above to run. | 442 | does not need any of the libs or programs above to run. |
439 | But it would be quite useless without these programs. | 443 | But it would be quite useless without these programs. |
440 | NOTE: | 444 | NOTE: |
441 | If you get a | 445 | If you get a |
442 | "This application depends on other programs" | 446 | "This application depends on other programs" |
443 | during installation of | 447 | during installation of |
444 | --kmicrokdelibs_1.9.2_arm.ipk | 448 | --kmicrokdelibs_1.9.2_arm.ipk |
445 | you probably do not have to care about that. | 449 | you probably do not have to care about that. |
446 | kmicrokdelibs_1.9.2 will come with some | 450 | kmicrokdelibs_1.9.2 will come with some |
447 | resource plugins, which needs additional libraries. | 451 | resource plugins, which needs additional libraries. |
448 | (E.g. libopie1, if you want to use the | 452 | (E.g. libopie1, if you want to use the |
449 | opie resource connector in KA/Pi). | 453 | opie resource connector in KA/Pi). |
450 | If you do not have this libraries installed, | 454 | If you do not have this libraries installed, |
451 | you simply cannot use the resource. | 455 | you simply cannot use the resource. |
452 | To make it clear: | 456 | To make it clear: |
453 | If the libraries are missing, the applications | 457 | If the libraries are missing, the applications |
454 | using kmicrokdelibs will start, | 458 | using kmicrokdelibs will start, |
455 | because the resources are plugins. | 459 | because the resources are plugins. |
456 | 3) | 460 | 3) |
457 | KO/Pi and friends are now installable on SD-Card! | 461 | KO/Pi and friends are now installable on SD-Card! |
458 | It is recommended to install all libs and apps | 462 | It is recommended to install all libs and apps |
459 | on the SD card or all in the internal storage. | 463 | on the SD card or all in the internal storage. |
460 | There may be problems, if this is mixed. | 464 | There may be problems, if this is mixed. |
461 | 4) | 465 | 4) |
462 | Fixed two bugs in the alarm notification on Windows. | 466 | Fixed two bugs in the alarm notification on Windows. |
463 | 5) | 467 | 5) |
464 | Great improvement! | 468 | Great improvement! |
465 | KO/Pi uses now the latest version of libical. | 469 | KO/Pi uses now the latest version of libical. |
466 | Libical is the library which actually reads | 470 | Libical is the library which actually reads |
467 | the calendar files and extract the data from it. | 471 | the calendar files and extract the data from it. |
468 | With the old version, there were problems | 472 | With the old version, there were problems |
469 | (crashes or program hangs) when licical did read | 473 | (crashes or program hangs) when licical did read |
470 | files, which were not stored from KO/Pi. | 474 | files, which were not stored from KO/Pi. |
471 | I do not know, if the new libical works perfect, | 475 | I do not know, if the new libical works perfect, |
472 | but actually it works much better than | 476 | but actually it works much better than |
473 | the old version. | 477 | the old version. |
474 | There are no problems with compatibility with | 478 | There are no problems with compatibility with |
475 | old calendar files of KO/Pi, of course! | 479 | old calendar files of KO/Pi, of course! |
476 | 6) | 480 | 6) |
477 | New in KA/Pi: | 481 | New in KA/Pi: |
478 | Opie addressbook resource connector available! | 482 | Opie addressbook resource connector available! |
479 | You will need libopie1 and the opie addressbook, | 483 | You will need libopie1 and the opie addressbook, |
480 | of course. | 484 | of course. |
481 | With the Opie addressbook resource connector, | 485 | With the Opie addressbook resource connector, |
482 | you can access the Opie addressbook readonly in KA/Pi. | 486 | you can access the Opie addressbook readonly in KA/Pi. |
483 | If you want to edit or import the data into KA/Pi, | 487 | If you want to edit or import the data into KA/Pi, |
484 | do this: | 488 | do this: |
485 | a) Create an Opie resource. | 489 | a) Create an Opie resource. |
486 | (Menu: Settings-Configure Resources). | 490 | (Menu: Settings-Configure Resources). |
487 | After configuration and restarting KA/Pi you should see | 491 | After configuration and restarting KA/Pi you should see |
488 | the Opie contacts in KA/Pi. | 492 | the Opie contacts in KA/Pi. |
489 | b) Select some or all Opie contacts. | 493 | b) Select some or all Opie contacts. |
490 | (NOTE: +++++ | 494 | (NOTE: +++++ |
491 | To know exactly, what contacts are Opie contacts, | 495 | To know exactly, what contacts are Opie contacts, |
492 | do this: Choose menu: | 496 | do this: Choose menu: |
493 | View-Modify View - TAB Fields. | 497 | View-Modify View - TAB Fields. |
494 | Select in the above list "Resource" and click | 498 | Select in the above list "Resource" and click |
495 | down arrow to add it to the "Selected fields". | 499 | down arrow to add it to the "Selected fields". |
496 | Click OK. | 500 | Click OK. |
497 | Now you have a new column "Resource" in your list, | 501 | Now you have a new column "Resource" in your list, |
498 | where you can see, what an Opie resource is. | 502 | where you can see, what an Opie resource is. |
499 | ++++ NOTE end.) | 503 | ++++ NOTE end.) |
500 | Ok, we do have now some Opie contacts seleted. | 504 | Ok, we do have now some Opie contacts seleted. |
501 | (Use SHIFT or CTRL key in order to multiple select). | 505 | (Use SHIFT or CTRL key in order to multiple select). |
502 | c) Choose menu: Edit-Copy. | 506 | c) Choose menu: Edit-Copy. |
503 | d) Choose menu: Edit-Paste. | 507 | d) Choose menu: Edit-Paste. |
504 | e) Select the resource, you want to add the contacts to. | 508 | e) Select the resource, you want to add the contacts to. |
505 | Congrats! Now you have read/write access to the copied | 509 | Congrats! Now you have read/write access to the copied |
506 | opie contacts as "real" KA/Pi contacts. | 510 | opie contacts as "real" KA/Pi contacts. |
507 | 511 | ||
508 | 512 | ||
509 | ********** VERSION 1.9.1 ************ | 513 | ********** VERSION 1.9.1 ************ |
510 | 1) | 514 | 1) |
511 | +++ IMPORTANT 1 +++ | 515 | +++ IMPORTANT 1 +++ |
512 | 516 | ||
513 | The storing place of the default calendar | 517 | The storing place of the default calendar |
514 | file has changed! | 518 | file has changed! |
515 | The default calendar file was | 519 | The default calendar file was |
516 | Applications/korganizer/mycalendar.ics | 520 | Applications/korganizer/mycalendar.ics |
517 | on Zaurus and | 521 | on Zaurus and |
518 | (yourHomeDir)/korganizer/mycalendar.ics | 522 | (yourHomeDir)/korganizer/mycalendar.ics |
519 | on Windows/Linux desktop. Now it is | 523 | on Windows/Linux desktop. Now it is |
520 | (yourHomeDir)/kdepim/korganizer/mycalendar.ics | 524 | (yourHomeDir)/kdepim/korganizer/mycalendar.ics |
521 | on Zaurus, Windows and Linux. | 525 | on Zaurus, Windows and Linux. |
522 | To load the old file, choose menu | 526 | To load the old file, choose menu |
523 | File-Load calendar backup. | 527 | File-Load calendar backup. |
524 | (It should be loaded automatically | 528 | (It should be loaded automatically |
525 | at startup with a warning message displayed). | 529 | at startup with a warning message displayed). |
526 | The place of the configuration file has changed too. | 530 | The place of the configuration file has changed too. |
527 | If you want to use your old KO/Pi config, | 531 | If you want to use your old KO/Pi config, |
528 | copy it to | 532 | copy it to |
529 | (yourHomeDir)/kdepim/config/korganizerrc | 533 | (yourHomeDir)/kdepim/config/korganizerrc |
530 | Please read VERSION 1.9.0 - topic 3) as well! | 534 | Please read VERSION 1.9.0 - topic 3) as well! |
531 | 535 | ||
532 | +++ IMPORTANT 2 +++ | 536 | +++ IMPORTANT 2 +++ |
533 | 537 | ||
534 | Because of the new paths, you will need | 538 | Because of the new paths, you will need |
535 | a new version of the KO/Pi alarm applet | 539 | a new version of the KO/Pi alarm applet |
536 | for Zaurus. | 540 | for Zaurus. |
537 | Use version >= 1.9.1 | 541 | Use version >= 1.9.1 |
538 | 542 | ||
539 | 2) | 543 | 2) |
540 | Now the QWhat'sThis Icon works for items | 544 | Now the QWhat'sThis Icon works for items |
541 | in the month view as well. | 545 | in the month view as well. |
542 | (See VERSION 1.7.8 Topic 1) ). | 546 | (See VERSION 1.7.8 Topic 1) ). |
543 | 3) | 547 | 3) |
544 | You can import birtsdays/anniversaries | 548 | You can import birtsdays/anniversaries |
545 | from KA/Pi into KO/Pi. | 549 | from KA/Pi into KO/Pi. |
546 | Choose menu File-Import birthdays. | 550 | Choose menu File-Import birthdays. |
547 | If you import twice, already imported items | 551 | If you import twice, already imported items |
548 | will not be imported again, if they | 552 | will not be imported again, if they |
549 | have not been changed in KO/Pi. | 553 | have not been changed in KO/Pi. |
550 | 4) | 554 | 4) |
551 | When syncing with sharp DTM, now a progress | 555 | When syncing with sharp DTM, now a progress |
552 | is shown, when the data is written back. | 556 | is shown, when the data is written back. |
553 | If there is much data in KO/Pi and no data | 557 | If there is much data in KO/Pi and no data |
554 | in DTM, that can take a long time. | 558 | in DTM, that can take a long time. |
555 | (But only for the first time ). | 559 | (But only for the first time ). |
556 | 5) | 560 | 5) |
557 | In the search dialog, you can search | 561 | In the search dialog, you can search |
558 | now for the name/email of an attendee | 562 | now for the name/email of an attendee |
559 | of an event/todo. | 563 | of an event/todo. |
560 | To get more space for displaying | 564 | To get more space for displaying |
561 | search results, the buttons | 565 | search results, the buttons |
562 | for "search" and "close" on the | 566 | for "search" and "close" on the |
563 | bottom are removed in the PDA version. | 567 | bottom are removed in the PDA version. |
564 | You have to click OK in the top right | 568 | You have to click OK in the top right |
565 | corner to do a search. | 569 | corner to do a search. |
566 | 6) | 570 | 6) |
567 | Now it is possible to disable the displaying | 571 | Now it is possible to disable the displaying |
568 | of todo items in the Allday part of the Agenda. | 572 | of todo items in the Allday part of the Agenda. |
569 | Choose Menu Action-Configure, | 573 | Choose Menu Action-Configure, |
570 | TAB Todo View, checkbox | 574 | TAB Todo View, checkbox |
571 | "Allday Agenda view shows todos" | 575 | "Allday Agenda view shows todos" |
572 | 7) | 576 | 7) |
573 | If FastLoad is enabled, now the settings and the | 577 | If FastLoad is enabled, now the settings and the |
574 | calendar data are saved, when KO/Pi is closed. | 578 | calendar data are saved, when KO/Pi is closed. |
575 | (If no Fastload is enabled, KO/Pi saves | 579 | (If no Fastload is enabled, KO/Pi saves |
576 | the data as well, of course) | 580 | the data as well, of course) |
577 | 8) | 581 | 8) |
578 | The Agenda View has a minimize-splitter now, | 582 | The Agenda View has a minimize-splitter now, |
579 | such that the height of the allday part can be | 583 | such that the height of the allday part can be |
580 | changed quickly. | 584 | changed quickly. |
581 | 585 | ||
582 | ********** VERSION 1.9.0 ************ | 586 | ********** VERSION 1.9.0 ************ |
583 | 1) | 587 | 1) |
584 | KO/Pi is now merged with the new microKDE from KA/Pi. | 588 | KO/Pi is now merged with the new microKDE from KA/Pi. |
585 | KO/Pi accesses now KA/Pi as the addressbook. | 589 | KO/Pi accesses now KA/Pi as the addressbook. |
586 | The other ddressbook-plugins are not working any longer. | 590 | The other ddressbook-plugins are not working any longer. |
587 | (It is planned, that later KA/Pi itself uses these plugins) | 591 | (It is planned, that later KA/Pi itself uses these plugins) |
588 | New versions of KO/Pi are only available | 592 | New versions of KO/Pi are only available |
589 | together with KA/Pi as the KDE-Pim/Pi package. | 593 | together with KA/Pi as the KDE-Pim/Pi package. |
590 | 2) | 594 | 2) |
591 | If you click on an attendee of a meeting in the | 595 | If you click on an attendee of a meeting in the |
592 | event viewer, a detailed summary of the | 596 | event viewer, a detailed summary of the |
593 | attendee is shown. | 597 | attendee is shown. |
594 | 3) | 598 | 3) |
595 | The place of the configuration file has changed. | 599 | The place of the configuration file has changed. |
596 | If you want to use your old KO/Pi config, copy | 600 | If you want to use your old KO/Pi config, copy |
597 | Applications/korganizer/config_korganizerrc | 601 | Applications/korganizer/config_korganizerrc |
598 | to | 602 | to |
599 | Applications/korganizer/config/korganizerrc | 603 | Applications/korganizer/config/korganizerrc |
600 | 604 | ||
601 | ********** VERSION 1.7.8 ************ | 605 | ********** VERSION 1.7.8 ************ |
602 | 1) | 606 | 1) |
603 | Now the QWhat'sThis ist working. | 607 | Now the QWhat'sThis ist working. |
604 | Enable the QWhat'sThis icon in the toolbar. | 608 | Enable the QWhat'sThis icon in the toolbar. |
605 | (You have to restart to reload the changed toolbar config). | 609 | (You have to restart to reload the changed toolbar config). |
606 | Now click on the QWhat'sThis Icon | 610 | Now click on the QWhat'sThis Icon |
607 | in the top right corner of KO/Pi. | 611 | in the top right corner of KO/Pi. |
608 | Then click on an item in the Agenda View: | 612 | Then click on an item in the Agenda View: |
609 | You will get a detailed display of the items content. | 613 | You will get a detailed display of the items content. |
610 | 2) | 614 | 2) |
611 | Some other very minor changes. | 615 | Some other very minor changes. |
612 | But I have forgotten the details ... | 616 | But I have forgotten the details ... |
613 | For that reason I start this log here: | 617 | For that reason I start this log here: |
614 | To document my changes, when I am doing it. | 618 | To document my changes, when I am doing it. |
615 | 619 | ||
616 | ********** VERSION 1.7.7 ************ | 620 | ********** VERSION 1.7.7 ************ |
617 | Stable Version of KO/Pi | 621 | Stable Version of KO/Pi |
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index da7065f..b890725 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -1,1359 +1,1361 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <libetpan/libetpan.h> | 3 | #include <libetpan/libetpan.h> |
4 | #include <qpe/global.h> | 4 | #include <qpe/global.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include "imapwrapper.h" | 6 | #include "imapwrapper.h" |
7 | #include "mailtypes.h" | 7 | #include "mailtypes.h" |
8 | #include "logindialog.h" | 8 | #include "logindialog.h" |
9 | #include <qprogressbar.h> | 9 | #include <qprogressbar.h> |
10 | #include "genericwrapper.h" | 10 | #include "genericwrapper.h" |
11 | #include <kglobal.h> | 11 | #include <kglobal.h> |
12 | 12 | ||
13 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
14 | int IMAPwrapper::mMax = 0; | 14 | int IMAPwrapper::mMax = 0; |
15 | int IMAPwrapper::mCurrent = 0; | 15 | int IMAPwrapper::mCurrent = 0; |
16 | 16 | ||
17 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 17 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
18 | : AbstractMail() | 18 | : AbstractMail() |
19 | { | 19 | { |
20 | account = a; | 20 | account = a; |
21 | m_imap = 0; | 21 | m_imap = 0; |
22 | m_Lastmbox = ""; | 22 | m_Lastmbox = ""; |
23 | mCurrent = 0; | 23 | mCurrent = 0; |
24 | mMax = 0; | 24 | mMax = 0; |
25 | } | 25 | } |
26 | 26 | ||
27 | IMAPwrapper::~IMAPwrapper() | 27 | IMAPwrapper::~IMAPwrapper() |
28 | { | 28 | { |
29 | logout(); | 29 | logout(); |
30 | } | 30 | } |
31 | 31 | ||
32 | /* to avoid to often select statements in loops etc. | 32 | /* to avoid to often select statements in loops etc. |
33 | we trust that we are logged in and connection is established!*/ | 33 | we trust that we are logged in and connection is established!*/ |
34 | int IMAPwrapper::selectMbox(const QString&mbox) | 34 | int IMAPwrapper::selectMbox(const QString&mbox) |
35 | { | 35 | { |
36 | if (mbox == m_Lastmbox) { | 36 | if (mbox == m_Lastmbox) { |
37 | return MAILIMAP_NO_ERROR; | 37 | return MAILIMAP_NO_ERROR; |
38 | } | 38 | } |
39 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); | 39 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); |
40 | if ( err != MAILIMAP_NO_ERROR ) { | 40 | if ( err != MAILIMAP_NO_ERROR ) { |
41 | m_Lastmbox = ""; | 41 | m_Lastmbox = ""; |
42 | return err; | 42 | return err; |
43 | } | 43 | } |
44 | m_Lastmbox = mbox; | 44 | m_Lastmbox = mbox; |
45 | return err; | 45 | return err; |
46 | } | 46 | } |
47 | 47 | ||
48 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | 48 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) |
49 | { | 49 | { |
50 | qApp->processEvents(); | ||
51 | return; | ||
50 | //qDebug("imap progress %d of %d ",current,maximum ); | 52 | //qDebug("imap progress %d of %d ",current,maximum ); |
51 | //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum)); | 53 | //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum)); |
52 | //qApp->processEvents() | 54 | //qApp->processEvents() |
53 | static unsigned int last = 0; | 55 | static unsigned int last = 0; |
54 | if ( last != current ) | 56 | if ( last != current ) |
55 | IMAPwrapper::progress(); | 57 | IMAPwrapper::progress(); |
56 | last = current; | 58 | last = current; |
57 | } | 59 | } |
58 | void IMAPwrapper::progress( QString m ) | 60 | void IMAPwrapper::progress( QString m ) |
59 | { | 61 | { |
60 | 62 | ||
61 | static QString mProgrMess; | 63 | static QString mProgrMess; |
62 | if ( m != QString::null ) { | 64 | if ( m != QString::null ) { |
63 | mProgrMess = m; | 65 | mProgrMess = m; |
64 | mCurrent = 1; | 66 | mCurrent = 1; |
65 | return; | 67 | return; |
66 | } | 68 | } |
67 | QString mess; | 69 | QString mess; |
68 | //qDebug("progress "); | 70 | //qDebug("progress "); |
69 | if ( mMax ) mess = mProgrMess +i18n(" message %1 of %2").arg( mCurrent++).arg(mMax); | 71 | if ( mMax ) mess = mProgrMess +i18n(" message %1 of %2").arg( mCurrent++).arg(mMax); |
70 | else mess = mProgrMess +i18n(" message %1").arg( mCurrent++); | 72 | else mess = mProgrMess +i18n(" message %1").arg( mCurrent++); |
71 | Global::statusMessage(mess); | 73 | Global::statusMessage(mess); |
72 | //qDebug("Progress %s %s", mess.latin1(), m.latin1()); | 74 | //qDebug("Progress %s %s", mess.latin1(), m.latin1()); |
73 | qApp->processEvents(); | 75 | qApp->processEvents(); |
74 | } | 76 | } |
75 | bool IMAPwrapper::start_tls(bool force_tls) | 77 | bool IMAPwrapper::start_tls(bool force_tls) |
76 | { | 78 | { |
77 | int err; | 79 | int err; |
78 | bool try_tls = force_tls; | 80 | bool try_tls = force_tls; |
79 | mailimap_capability_data * cap_data = 0; | 81 | mailimap_capability_data * cap_data = 0; |
80 | 82 | ||
81 | err = mailimap_capability(m_imap,&cap_data); | 83 | err = mailimap_capability(m_imap,&cap_data); |
82 | if (err != MAILIMAP_NO_ERROR) { | 84 | if (err != MAILIMAP_NO_ERROR) { |
83 | Global::statusMessage("error getting capabilities!"); | 85 | Global::statusMessage("error getting capabilities!"); |
84 | return false; | 86 | return false; |
85 | } | 87 | } |
86 | clistiter * cur; | 88 | clistiter * cur; |
87 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { | 89 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { |
88 | struct mailimap_capability * cap; | 90 | struct mailimap_capability * cap; |
89 | cap = (struct mailimap_capability *)clist_content(cur); | 91 | cap = (struct mailimap_capability *)clist_content(cur); |
90 | if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) { | 92 | if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) { |
91 | if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) { | 93 | if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) { |
92 | try_tls = true; | 94 | try_tls = true; |
93 | break; | 95 | break; |
94 | } | 96 | } |
95 | } | 97 | } |
96 | } | 98 | } |
97 | if (cap_data) { | 99 | if (cap_data) { |
98 | mailimap_capability_data_free(cap_data); | 100 | mailimap_capability_data_free(cap_data); |
99 | } | 101 | } |
100 | if (try_tls) { | 102 | if (try_tls) { |
101 | err = mailimap_starttls(m_imap); | 103 | err = mailimap_starttls(m_imap); |
102 | if (err != MAILIMAP_NO_ERROR && force_tls) { | 104 | if (err != MAILIMAP_NO_ERROR && force_tls) { |
103 | Global::statusMessage(i18n("Server has no TLS support!")); | 105 | Global::statusMessage(i18n("Server has no TLS support!")); |
104 | try_tls = false; | 106 | try_tls = false; |
105 | } else { | 107 | } else { |
106 | mailstream_low * low; | 108 | mailstream_low * low; |
107 | mailstream_low * new_low; | 109 | mailstream_low * new_low; |
108 | low = mailstream_get_low(m_imap->imap_stream); | 110 | low = mailstream_get_low(m_imap->imap_stream); |
109 | if (!low) { | 111 | if (!low) { |
110 | try_tls = false; | 112 | try_tls = false; |
111 | } else { | 113 | } else { |
112 | int fd = mailstream_low_get_fd(low); | 114 | int fd = mailstream_low_get_fd(low); |
113 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { | 115 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { |
114 | mailstream_low_free(low); | 116 | mailstream_low_free(low); |
115 | mailstream_set_low(m_imap->imap_stream, new_low); | 117 | mailstream_set_low(m_imap->imap_stream, new_low); |
116 | } else { | 118 | } else { |
117 | try_tls = false; | 119 | try_tls = false; |
118 | } | 120 | } |
119 | } | 121 | } |
120 | } | 122 | } |
121 | } | 123 | } |
122 | return try_tls; | 124 | return try_tls; |
123 | } | 125 | } |
124 | 126 | ||
125 | void IMAPwrapper::login() | 127 | void IMAPwrapper::login() |
126 | { | 128 | { |
127 | QString server, user, pass; | 129 | QString server, user, pass; |
128 | uint16_t port; | 130 | uint16_t port; |
129 | int err = MAILIMAP_NO_ERROR; | 131 | int err = MAILIMAP_NO_ERROR; |
130 | 132 | ||
131 | if (account->getOffline()) return; | 133 | if (account->getOffline()) return; |
132 | /* we are connected this moment */ | 134 | /* we are connected this moment */ |
133 | /* TODO: setup a timer holding the line or if connection closed - delete the value */ | 135 | /* TODO: setup a timer holding the line or if connection closed - delete the value */ |
134 | if (m_imap) { | 136 | if (m_imap) { |
135 | err = mailimap_noop(m_imap); | 137 | err = mailimap_noop(m_imap); |
136 | if (err!=MAILIMAP_NO_ERROR) { | 138 | if (err!=MAILIMAP_NO_ERROR) { |
137 | logout(); | 139 | logout(); |
138 | } else { | 140 | } else { |
139 | mailstream_flush(m_imap->imap_stream); | 141 | mailstream_flush(m_imap->imap_stream); |
140 | return; | 142 | return; |
141 | } | 143 | } |
142 | } | 144 | } |
143 | server = account->getServer(); | 145 | server = account->getServer(); |
144 | port = account->getPort().toUInt(); | 146 | port = account->getPort().toUInt(); |
145 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { | 147 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
146 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | 148 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
147 | login.show(); | 149 | login.show(); |
148 | if ( QDialog::Accepted == login.exec() ) { | 150 | if ( QDialog::Accepted == login.exec() ) { |
149 | // ok | 151 | // ok |
150 | user = login.getUser(); | 152 | user = login.getUser(); |
151 | pass = login.getPassword(); | 153 | pass = login.getPassword(); |
152 | } else { | 154 | } else { |
153 | // cancel | 155 | // cancel |
154 | return; | 156 | return; |
155 | } | 157 | } |
156 | } else { | 158 | } else { |
157 | user = account->getUser(); | 159 | user = account->getUser(); |
158 | pass = account->getPassword(); | 160 | pass = account->getPassword(); |
159 | } | 161 | } |
160 | 162 | ||
161 | m_imap = mailimap_new( 20, &imap_progress ); | 163 | m_imap = mailimap_new( 20, &imap_progress ); |
162 | 164 | ||
163 | /* connect */ | 165 | /* connect */ |
164 | bool ssl = false; | 166 | bool ssl = false; |
165 | bool try_tls = false; | 167 | bool try_tls = false; |
166 | bool force_tls = false; | 168 | bool force_tls = false; |
167 | 169 | ||
168 | if ( account->ConnectionType() == 2 ) { | 170 | if ( account->ConnectionType() == 2 ) { |
169 | ssl = true; | 171 | ssl = true; |
170 | } | 172 | } |
171 | if (account->ConnectionType()==1) { | 173 | if (account->ConnectionType()==1) { |
172 | force_tls = true; | 174 | force_tls = true; |
173 | } | 175 | } |
174 | 176 | ||
175 | if ( ssl ) { | 177 | if ( ssl ) { |
176 | qDebug("using ssl "); | 178 | qDebug("using ssl "); |
177 | err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); | 179 | err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); |
178 | qDebug("back "); | 180 | qDebug("back "); |
179 | } else { | 181 | } else { |
180 | err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); | 182 | err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); |
181 | } | 183 | } |
182 | 184 | ||
183 | if ( err != MAILIMAP_NO_ERROR && | 185 | if ( err != MAILIMAP_NO_ERROR && |
184 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && | 186 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && |
185 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { | 187 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { |
186 | QString failure = ""; | 188 | QString failure = ""; |
187 | if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) { | 189 | if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) { |
188 | failure="Connection refused"; | 190 | failure="Connection refused"; |
189 | } else { | 191 | } else { |
190 | failure="Unknown failure"; | 192 | failure="Unknown failure"; |
191 | } | 193 | } |
192 | Global::statusMessage(i18n("error connecting imap server: %1").arg(failure)); | 194 | Global::statusMessage(i18n("error connecting imap server: %1").arg(failure)); |
193 | mailimap_free( m_imap ); | 195 | mailimap_free( m_imap ); |
194 | m_imap = 0; | 196 | m_imap = 0; |
195 | return; | 197 | return; |
196 | } | 198 | } |
197 | 199 | ||
198 | if (!ssl) { | 200 | if (!ssl) { |
199 | try_tls = start_tls(force_tls); | 201 | try_tls = start_tls(force_tls); |
200 | } | 202 | } |
201 | 203 | ||
202 | bool ok = true; | 204 | bool ok = true; |
203 | if (force_tls && !try_tls) { | 205 | if (force_tls && !try_tls) { |
204 | Global::statusMessage(i18n("Server has no TLS support!")); | 206 | Global::statusMessage(i18n("Server has no TLS support!")); |
205 | ok = false; | 207 | ok = false; |
206 | } | 208 | } |
207 | 209 | ||
208 | 210 | ||
209 | /* login */ | 211 | /* login */ |
210 | 212 | ||
211 | if (ok) { | 213 | if (ok) { |
212 | err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() ); | 214 | err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() ); |
213 | if ( err != MAILIMAP_NO_ERROR ) { | 215 | if ( err != MAILIMAP_NO_ERROR ) { |
214 | Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response)); | 216 | Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response)); |
215 | ok = false; | 217 | ok = false; |
216 | } | 218 | } |
217 | } | 219 | } |
218 | if (!ok) { | 220 | if (!ok) { |
219 | err = mailimap_close( m_imap ); | 221 | err = mailimap_close( m_imap ); |
220 | mailimap_free( m_imap ); | 222 | mailimap_free( m_imap ); |
221 | m_imap = 0; | 223 | m_imap = 0; |
222 | } | 224 | } |
223 | } | 225 | } |
224 | 226 | ||
225 | void IMAPwrapper::logout() | 227 | void IMAPwrapper::logout() |
226 | { | 228 | { |
227 | int err = MAILIMAP_NO_ERROR; | 229 | int err = MAILIMAP_NO_ERROR; |
228 | if (!m_imap) return; | 230 | if (!m_imap) return; |
229 | err = mailimap_logout( m_imap ); | 231 | err = mailimap_logout( m_imap ); |
230 | err = mailimap_close( m_imap ); | 232 | err = mailimap_close( m_imap ); |
231 | mailimap_free( m_imap ); | 233 | mailimap_free( m_imap ); |
232 | m_imap = 0; | 234 | m_imap = 0; |
233 | m_Lastmbox = ""; | 235 | m_Lastmbox = ""; |
234 | } | 236 | } |
235 | 237 | ||
236 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) | 238 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) |
237 | { | 239 | { |
238 | 240 | ||
239 | int tryAgain = 1; | 241 | int tryAgain = 1; |
240 | while ( tryAgain >= 0 ) { | 242 | while ( tryAgain >= 0 ) { |
241 | int err = MAILIMAP_NO_ERROR; | 243 | int err = MAILIMAP_NO_ERROR; |
242 | clist *result = 0; | 244 | clist *result = 0; |
243 | clistcell *current; | 245 | clistcell *current; |
244 | mailimap_fetch_type *fetchType = 0; | 246 | mailimap_fetch_type *fetchType = 0; |
245 | mailimap_set *set = 0; | 247 | mailimap_set *set = 0; |
246 | 248 | ||
247 | login(); | 249 | login(); |
248 | if (!m_imap) { | 250 | if (!m_imap) { |
249 | return; | 251 | return; |
250 | } | 252 | } |
251 | /* select mailbox READONLY for operations */ | 253 | /* select mailbox READONLY for operations */ |
252 | err = selectMbox(mailbox); | 254 | err = selectMbox(mailbox); |
253 | if ( err != MAILIMAP_NO_ERROR ) { | 255 | if ( err != MAILIMAP_NO_ERROR ) { |
254 | return; | 256 | return; |
255 | } | 257 | } |
256 | 258 | ||
257 | int last = m_imap->imap_selection_info->sel_exists; | 259 | int last = m_imap->imap_selection_info->sel_exists; |
258 | 260 | ||
259 | if (last == 0) { | 261 | if (last == 0) { |
260 | Global::statusMessage(i18n("Mailbox has no mails")); | 262 | Global::statusMessage(i18n("Mailbox has no mails")); |
261 | return; | 263 | return; |
262 | } else { | 264 | } else { |
263 | } | 265 | } |
264 | progress( i18n("Fetch ")); | 266 | progress( i18n("Fetch ")); |
265 | mMax = last; | 267 | mMax = last; |
266 | //qDebug("last %d ", last); | 268 | //qDebug("last %d ", last); |
267 | Global::statusMessage(i18n("Fetching header list")); | 269 | Global::statusMessage(i18n("Fetching header list")); |
268 | qApp->processEvents(); | 270 | qApp->processEvents(); |
269 | /* the range has to start at 1!!! not with 0!!!! */ | 271 | /* the range has to start at 1!!! not with 0!!!! */ |
270 | //LR the access to web.de imap server is no working with value 1 | 272 | //LR the access to web.de imap server is no working with value 1 |
271 | //qDebug("interval %d - %d ", tryAgain, last-1+tryAgain ); | 273 | //qDebug("interval %d - %d ", tryAgain, last-1+tryAgain ); |
272 | set = mailimap_set_new_interval( tryAgain, last ); | 274 | set = mailimap_set_new_interval( tryAgain, last ); |
273 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); | 275 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); |
274 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); | 276 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); |
275 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); | 277 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); |
276 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); | 278 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); |
277 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); | 279 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); |
278 | 280 | ||
279 | err = mailimap_fetch( m_imap, set, fetchType, &result ); | 281 | err = mailimap_fetch( m_imap, set, fetchType, &result ); |
280 | mailimap_set_free( set ); | 282 | mailimap_set_free( set ); |
281 | mailimap_fetch_type_free( fetchType ); | 283 | mailimap_fetch_type_free( fetchType ); |
282 | 284 | ||
283 | QString date,subject,from; | 285 | QString date,subject,from; |
284 | 286 | ||
285 | if ( err == MAILIMAP_NO_ERROR ) { | 287 | if ( err == MAILIMAP_NO_ERROR ) { |
286 | tryAgain = -1; | 288 | tryAgain = -1; |
287 | mailimap_msg_att * msg_att; | 289 | mailimap_msg_att * msg_att; |
288 | int i = 0; | 290 | int i = 0; |
289 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { | 291 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { |
290 | ++i; | 292 | ++i; |
291 | //qDebug("iii %d ",i); | 293 | //qDebug("iii %d ",i); |
292 | msg_att = (mailimap_msg_att*)current->data; | 294 | msg_att = (mailimap_msg_att*)current->data; |
293 | RecMail*m = parse_list_result(msg_att); | 295 | RecMail*m = parse_list_result(msg_att); |
294 | if (m) { | 296 | if (m) { |
295 | if ( maxSizeInKb == 0 || m->Msgsize()<=(unsigned int ) maxSizeInKb*1024 ) { | 297 | if ( maxSizeInKb == 0 || m->Msgsize()<=(unsigned int ) maxSizeInKb*1024 ) { |
296 | m->setNumber(i); | 298 | m->setNumber(i); |
297 | m->setMbox(mailbox); | 299 | m->setMbox(mailbox); |
298 | m->setWrapper(this); | 300 | m->setWrapper(this); |
299 | target.append(m); | 301 | target.append(m); |
300 | } | 302 | } |
301 | } | 303 | } |
302 | } | 304 | } |
303 | Global::statusMessage(i18n("Mailbox has %1 mails").arg(target.count())); | 305 | Global::statusMessage(i18n("Mailbox has %1 mails").arg(target.count())); |
304 | } else { | 306 | } else { |
305 | --tryAgain; | 307 | --tryAgain; |
306 | --tryAgain;//disabled tryagain by adding this line | 308 | --tryAgain;//disabled tryagain by adding this line |
307 | if ( tryAgain < 0 ) | 309 | if ( tryAgain < 0 ) |
308 | Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response)); | 310 | Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response)); |
309 | else | 311 | else |
310 | qDebug("try again... "); | 312 | qDebug("try again... "); |
311 | } | 313 | } |
312 | 314 | ||
313 | if (result) mailimap_fetch_list_free(result); | 315 | if (result) mailimap_fetch_list_free(result); |
314 | } | 316 | } |
315 | } | 317 | } |
316 | 318 | ||
317 | QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() | 319 | QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() |
318 | { | 320 | { |
319 | const char *path, *mask; | 321 | const char *path, *mask; |
320 | int err = MAILIMAP_NO_ERROR; | 322 | int err = MAILIMAP_NO_ERROR; |
321 | clist *result = 0; | 323 | clist *result = 0; |
322 | clistcell *current = 0; | 324 | clistcell *current = 0; |
323 | clistcell*cur_flag = 0; | 325 | clistcell*cur_flag = 0; |
324 | mailimap_mbx_list_flags*bflags = 0; | 326 | mailimap_mbx_list_flags*bflags = 0; |
325 | 327 | ||
326 | QValueList<FolderP>* folders = new QValueList<FolderP>(); | 328 | QValueList<FolderP>* folders = new QValueList<FolderP>(); |
327 | login(); | 329 | login(); |
328 | if (!m_imap) { | 330 | if (!m_imap) { |
329 | return folders; | 331 | return folders; |
330 | } | 332 | } |
331 | 333 | ||
332 | /* | 334 | /* |
333 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. | 335 | * First we have to check for INBOX 'cause it sometimes it's not inside the path. |
334 | * We must not forget to filter them out in next loop! | 336 | * We must not forget to filter them out in next loop! |
335 | * it seems like ugly code. and yes - it is ugly code. but the best way. | 337 | * it seems like ugly code. and yes - it is ugly code. but the best way. |
336 | */ | 338 | */ |
337 | Global::statusMessage(i18n("Fetching folder list")); | 339 | Global::statusMessage(i18n("Fetching folder list")); |
338 | qApp->processEvents(); | 340 | qApp->processEvents(); |
339 | QString temp; | 341 | QString temp; |
340 | mask = "INBOX" ; | 342 | mask = "INBOX" ; |
341 | mailimap_mailbox_list *list; | 343 | mailimap_mailbox_list *list; |
342 | err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); | 344 | err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); |
343 | QString del; | 345 | QString del; |
344 | bool selectable = true; | 346 | bool selectable = true; |
345 | bool no_inferiors = false; | 347 | bool no_inferiors = false; |
346 | if ( err == MAILIMAP_NO_ERROR ) { | 348 | if ( err == MAILIMAP_NO_ERROR ) { |
347 | current = result->first; | 349 | current = result->first; |
348 | for ( int i = result->count; i > 0; i-- ) { | 350 | for ( int i = result->count; i > 0; i-- ) { |
349 | list = (mailimap_mailbox_list *) current->data; | 351 | list = (mailimap_mailbox_list *) current->data; |
350 | // it is better use the deep copy mechanism of qt itself | 352 | // it is better use the deep copy mechanism of qt itself |
351 | // instead of using strdup! | 353 | // instead of using strdup! |
352 | temp = list->mb_name; | 354 | temp = list->mb_name; |
353 | del = list->mb_delimiter; | 355 | del = list->mb_delimiter; |
354 | current = current->next; | 356 | current = current->next; |
355 | if ( (bflags = list->mb_flag) ) { | 357 | if ( (bflags = list->mb_flag) ) { |
356 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& | 358 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& |
357 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); | 359 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); |
358 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { | 360 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { |
359 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { | 361 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { |
360 | no_inferiors = true; | 362 | no_inferiors = true; |
361 | } | 363 | } |
362 | } | 364 | } |
363 | } | 365 | } |
364 | folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); | 366 | folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); |
365 | } | 367 | } |
366 | } else { | 368 | } else { |
367 | qDebug("error fetching folders: "); | 369 | qDebug("error fetching folders: "); |
368 | 370 | ||
369 | } | 371 | } |
370 | mailimap_list_result_free( result ); | 372 | mailimap_list_result_free( result ); |
371 | 373 | ||
372 | /* | 374 | /* |
373 | * second stage - get the other then inbox folders | 375 | * second stage - get the other then inbox folders |
374 | */ | 376 | */ |
375 | mask = "*" ; | 377 | mask = "*" ; |
376 | path = account->getPrefix().latin1(); | 378 | path = account->getPrefix().latin1(); |
377 | if (!path) path = ""; | 379 | if (!path) path = ""; |
378 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); | 380 | err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); |
379 | if ( err == MAILIMAP_NO_ERROR ) { | 381 | if ( err == MAILIMAP_NO_ERROR ) { |
380 | current = result->first; | 382 | current = result->first; |
381 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { | 383 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { |
382 | no_inferiors = false; | 384 | no_inferiors = false; |
383 | list = (mailimap_mailbox_list *) current->data; | 385 | list = (mailimap_mailbox_list *) current->data; |
384 | // it is better use the deep copy mechanism of qt itself | 386 | // it is better use the deep copy mechanism of qt itself |
385 | // instead of using strdup! | 387 | // instead of using strdup! |
386 | temp = list->mb_name; | 388 | temp = list->mb_name; |
387 | if (temp.lower()=="inbox") | 389 | if (temp.lower()=="inbox") |
388 | continue; | 390 | continue; |
389 | if (temp.lower()==account->getPrefix().lower()) | 391 | if (temp.lower()==account->getPrefix().lower()) |
390 | continue; | 392 | continue; |
391 | if ( (bflags = list->mb_flag) ) { | 393 | if ( (bflags = list->mb_flag) ) { |
392 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& | 394 | selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&& |
393 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); | 395 | bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT); |
394 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { | 396 | for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) { |
395 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { | 397 | if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) { |
396 | no_inferiors = true; | 398 | no_inferiors = true; |
397 | } | 399 | } |
398 | } | 400 | } |
399 | } | 401 | } |
400 | del = list->mb_delimiter; | 402 | del = list->mb_delimiter; |
401 | folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); | 403 | folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); |
402 | } | 404 | } |
403 | } else { | 405 | } else { |
404 | qDebug("error fetching folders "); | 406 | qDebug("error fetching folders "); |
405 | 407 | ||
406 | } | 408 | } |
407 | if (result) mailimap_list_result_free( result ); | 409 | if (result) mailimap_list_result_free( result ); |
408 | return folders; | 410 | return folders; |
409 | } | 411 | } |
410 | 412 | ||
411 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | 413 | RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) |
412 | { | 414 | { |
413 | RecMail * m = 0; | 415 | RecMail * m = 0; |
414 | mailimap_msg_att_item *item=0; | 416 | mailimap_msg_att_item *item=0; |
415 | clistcell *current,*c,*cf; | 417 | clistcell *current,*c,*cf; |
416 | mailimap_msg_att_dynamic*flist; | 418 | mailimap_msg_att_dynamic*flist; |
417 | mailimap_flag_fetch*cflag; | 419 | mailimap_flag_fetch*cflag; |
418 | int size = 0; | 420 | int size = 0; |
419 | QBitArray mFlags(7); | 421 | QBitArray mFlags(7); |
420 | QStringList addresslist; | 422 | QStringList addresslist; |
421 | 423 | ||
422 | if (!m_att) { | 424 | if (!m_att) { |
423 | return m; | 425 | return m; |
424 | } | 426 | } |
425 | m = new RecMail(); | 427 | m = new RecMail(); |
426 | for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { | 428 | for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { |
427 | current = c; | 429 | current = c; |
428 | size = 0; | 430 | size = 0; |
429 | item = (mailimap_msg_att_item*)current->data; | 431 | item = (mailimap_msg_att_item*)current->data; |
430 | if ( !item ) | 432 | if ( !item ) |
431 | continue; | 433 | continue; |
432 | if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) { | 434 | if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) { |
433 | flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn; | 435 | flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn; |
434 | if (!flist || !flist->att_list) { | 436 | if (!flist || !flist->att_list) { |
435 | continue; | 437 | continue; |
436 | } | 438 | } |
437 | cf = flist->att_list->first; | 439 | cf = flist->att_list->first; |
438 | if( ! cf ) | 440 | if( ! cf ) |
439 | for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) { | 441 | for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) { |
440 | cflag = (mailimap_flag_fetch*)cf->data; | 442 | cflag = (mailimap_flag_fetch*)cf->data; |
441 | if( ! cflag ) | 443 | if( ! cflag ) |
442 | qDebug("imap:not cflag "); | 444 | qDebug("imap:not cflag "); |
443 | if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) { | 445 | if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) { |
444 | switch (cflag->fl_flag->fl_type) { | 446 | switch (cflag->fl_flag->fl_type) { |
445 | case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */ | 447 | case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */ |
446 | mFlags.setBit(FLAG_ANSWERED); | 448 | mFlags.setBit(FLAG_ANSWERED); |
447 | break; | 449 | break; |
448 | case MAILIMAP_FLAG_FLAGGED: /* \Flagged flag */ | 450 | case MAILIMAP_FLAG_FLAGGED: /* \Flagged flag */ |
449 | mFlags.setBit(FLAG_FLAGGED); | 451 | mFlags.setBit(FLAG_FLAGGED); |
450 | break; | 452 | break; |
451 | case MAILIMAP_FLAG_DELETED: /* \Deleted flag */ | 453 | case MAILIMAP_FLAG_DELETED: /* \Deleted flag */ |
452 | mFlags.setBit(FLAG_DELETED); | 454 | mFlags.setBit(FLAG_DELETED); |
453 | break; | 455 | break; |
454 | case MAILIMAP_FLAG_SEEN: /* \Seen flag */ | 456 | case MAILIMAP_FLAG_SEEN: /* \Seen flag */ |
455 | mFlags.setBit(FLAG_SEEN); | 457 | mFlags.setBit(FLAG_SEEN); |
456 | break; | 458 | break; |
457 | case MAILIMAP_FLAG_DRAFT: /* \Draft flag */ | 459 | case MAILIMAP_FLAG_DRAFT: /* \Draft flag */ |
458 | mFlags.setBit(FLAG_DRAFT); | 460 | mFlags.setBit(FLAG_DRAFT); |
459 | break; | 461 | break; |
460 | case MAILIMAP_FLAG_KEYWORD: /* keyword flag */ | 462 | case MAILIMAP_FLAG_KEYWORD: /* keyword flag */ |
461 | break; | 463 | break; |
462 | case MAILIMAP_FLAG_EXTENSION: /* \extension flag */ | 464 | case MAILIMAP_FLAG_EXTENSION: /* \extension flag */ |
463 | break; | 465 | break; |
464 | default: | 466 | default: |
465 | break; | 467 | break; |
466 | } | 468 | } |
467 | } else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) { | 469 | } else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) { |
468 | mFlags.setBit(FLAG_RECENT); | 470 | mFlags.setBit(FLAG_RECENT); |
469 | } | 471 | } |
470 | } | 472 | } |
471 | continue; | 473 | continue; |
472 | } | 474 | } |
473 | if ( item->att_data.att_static == NULL ) | 475 | if ( item->att_data.att_static == NULL ) |
474 | continue; | 476 | continue; |
475 | if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { | 477 | if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { |
476 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; | 478 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; |
477 | if ( head == NULL ) | 479 | if ( head == NULL ) |
478 | continue; | 480 | continue; |
479 | if ( head->env_date != NULL ) { | 481 | if ( head->env_date != NULL ) { |
480 | m->setDate(head->env_date); | 482 | m->setDate(head->env_date); |
481 | //struct mailimf_date_time result; | 483 | //struct mailimf_date_time result; |
482 | struct mailimf_date_time* date;// = &result; | 484 | struct mailimf_date_time* date;// = &result; |
483 | struct mailimf_date_time **re = &date; | 485 | struct mailimf_date_time **re = &date; |
484 | size_t length = m->getDate().length(); | 486 | size_t length = m->getDate().length(); |
485 | size_t index = 0; | 487 | size_t index = 0; |
486 | if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { | 488 | if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { |
487 | QDateTime dt = Genericwrapper::parseDateTime( date ); | 489 | QDateTime dt = Genericwrapper::parseDateTime( date ); |
488 | QString ret; | 490 | QString ret; |
489 | if ( dt.date() == QDate::currentDate () ) | 491 | if ( dt.date() == QDate::currentDate () ) |
490 | ret = KGlobal::locale()->formatTime( dt.time(),true); | 492 | ret = KGlobal::locale()->formatTime( dt.time(),true); |
491 | else { | 493 | else { |
492 | ret = KGlobal::locale()->formatDateTime( dt,true,true); | 494 | ret = KGlobal::locale()->formatDateTime( dt,true,true); |
493 | } | 495 | } |
494 | m->setDate( ret ); | 496 | m->setDate( ret ); |
495 | char tmp[20]; | 497 | char tmp[20]; |
496 | snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i", | 498 | snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i", |
497 | dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); | 499 | dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); |
498 | //qDebug("%d iso %s %s ", date->dt_zone, tmp, head->env_date); | 500 | //qDebug("%d iso %s %s ", date->dt_zone, tmp, head->env_date); |
499 | m->setIsoDate( QString( tmp ) ); | 501 | m->setIsoDate( QString( tmp ) ); |
500 | mailimf_date_time_free ( date ); | 502 | mailimf_date_time_free ( date ); |
501 | } else { | 503 | } else { |
502 | m->setIsoDate(head->env_date); | 504 | m->setIsoDate(head->env_date); |
503 | } | 505 | } |
504 | } | 506 | } |
505 | if ( head->env_subject != NULL ) | 507 | if ( head->env_subject != NULL ) |
506 | m->setSubject(convert_String((const char*)head->env_subject)); | 508 | m->setSubject(convert_String((const char*)head->env_subject)); |
507 | //m->setSubject(head->env_subject); | 509 | //m->setSubject(head->env_subject); |
508 | if (head->env_from!=NULL) { | 510 | if (head->env_from!=NULL) { |
509 | addresslist = address_list_to_stringlist(head->env_from->frm_list); | 511 | addresslist = address_list_to_stringlist(head->env_from->frm_list); |
510 | if (addresslist.count()) { | 512 | if (addresslist.count()) { |
511 | m->setFrom(addresslist.first()); | 513 | m->setFrom(addresslist.first()); |
512 | } | 514 | } |
513 | } | 515 | } |
514 | if (head->env_to!=NULL) { | 516 | if (head->env_to!=NULL) { |
515 | addresslist = address_list_to_stringlist(head->env_to->to_list); | 517 | addresslist = address_list_to_stringlist(head->env_to->to_list); |
516 | m->setTo(addresslist); | 518 | m->setTo(addresslist); |
517 | } | 519 | } |
518 | if (head->env_cc!=NULL) { | 520 | if (head->env_cc!=NULL) { |
519 | addresslist = address_list_to_stringlist(head->env_cc->cc_list); | 521 | addresslist = address_list_to_stringlist(head->env_cc->cc_list); |
520 | m->setCC(addresslist); | 522 | m->setCC(addresslist); |
521 | } | 523 | } |
522 | if (head->env_bcc!=NULL) { | 524 | if (head->env_bcc!=NULL) { |
523 | addresslist = address_list_to_stringlist(head->env_bcc->bcc_list); | 525 | addresslist = address_list_to_stringlist(head->env_bcc->bcc_list); |
524 | m->setBcc(addresslist); | 526 | m->setBcc(addresslist); |
525 | } | 527 | } |
526 | /* reply to address, eg. email. */ | 528 | /* reply to address, eg. email. */ |
527 | if (head->env_reply_to!=NULL) { | 529 | if (head->env_reply_to!=NULL) { |
528 | addresslist = address_list_to_stringlist(head->env_reply_to->rt_list); | 530 | addresslist = address_list_to_stringlist(head->env_reply_to->rt_list); |
529 | if (addresslist.count()) { | 531 | if (addresslist.count()) { |
530 | m->setReplyto(addresslist.first()); | 532 | m->setReplyto(addresslist.first()); |
531 | } | 533 | } |
532 | } | 534 | } |
533 | if (head->env_in_reply_to!=NULL) { | 535 | if (head->env_in_reply_to!=NULL) { |
534 | QString h(head->env_in_reply_to); | 536 | QString h(head->env_in_reply_to); |
535 | while (h.length()>0 && h[0]=='<') { | 537 | while (h.length()>0 && h[0]=='<') { |
536 | h.remove(0,1); | 538 | h.remove(0,1); |
537 | } | 539 | } |
538 | while (h.length()>0 && h[h.length()-1]=='>') { | 540 | while (h.length()>0 && h[h.length()-1]=='>') { |
539 | h.remove(h.length()-1,1); | 541 | h.remove(h.length()-1,1); |
540 | } | 542 | } |
541 | if (h.length()>0) { | 543 | if (h.length()>0) { |
542 | m->setInreply(QStringList(h)); | 544 | m->setInreply(QStringList(h)); |
543 | } | 545 | } |
544 | } | 546 | } |
545 | if (head->env_message_id != NULL) { | 547 | if (head->env_message_id != NULL) { |
546 | m->setMsgid(QString(head->env_message_id)); | 548 | m->setMsgid(QString(head->env_message_id)); |
547 | } | 549 | } |
548 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { | 550 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { |
549 | #if 0 | 551 | #if 0 |
550 | mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; | 552 | mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; |
551 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); | 553 | QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); |
552 | qDebug("time %s ",da.toString().latin1() ); | 554 | qDebug("time %s ",da.toString().latin1() ); |
553 | #endif | 555 | #endif |
554 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { | 556 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { |
555 | size = item->att_data.att_static->att_data.att_rfc822_size; | 557 | size = item->att_data.att_static->att_data.att_rfc822_size; |
556 | } | 558 | } |
557 | } | 559 | } |
558 | /* msg is already deleted */ | 560 | /* msg is already deleted */ |
559 | if (mFlags.testBit(FLAG_DELETED) && m) { | 561 | if (mFlags.testBit(FLAG_DELETED) && m) { |
560 | delete m; | 562 | delete m; |
561 | m = 0; | 563 | m = 0; |
562 | } | 564 | } |
563 | if (m) { | 565 | if (m) { |
564 | m->setFlags(mFlags); | 566 | m->setFlags(mFlags); |
565 | m->setMsgsize(size); | 567 | m->setMsgsize(size); |
566 | } | 568 | } |
567 | return m; | 569 | return m; |
568 | } | 570 | } |
569 | 571 | ||
570 | RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) | 572 | RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) |
571 | { | 573 | { |
572 | RecBodyP body = new RecBody(); | 574 | RecBodyP body = new RecBody(); |
573 | const char *mb; | 575 | const char *mb; |
574 | int err = MAILIMAP_NO_ERROR; | 576 | int err = MAILIMAP_NO_ERROR; |
575 | clist *result = 0; | 577 | clist *result = 0; |
576 | clistcell *current; | 578 | clistcell *current; |
577 | mailimap_fetch_att *fetchAtt = 0; | 579 | mailimap_fetch_att *fetchAtt = 0; |
578 | mailimap_fetch_type *fetchType = 0; | 580 | mailimap_fetch_type *fetchType = 0; |
579 | mailimap_set *set = 0; | 581 | mailimap_set *set = 0; |
580 | mailimap_body*body_desc = 0; | 582 | mailimap_body*body_desc = 0; |
581 | 583 | ||
582 | mb = mail->getMbox().latin1(); | 584 | mb = mail->getMbox().latin1(); |
583 | 585 | ||
584 | login(); | 586 | login(); |
585 | if (!m_imap) { | 587 | if (!m_imap) { |
586 | return body; | 588 | return body; |
587 | } | 589 | } |
588 | err = selectMbox(mail->getMbox()); | 590 | err = selectMbox(mail->getMbox()); |
589 | if ( err != MAILIMAP_NO_ERROR ) { | 591 | if ( err != MAILIMAP_NO_ERROR ) { |
590 | return body; | 592 | return body; |
591 | } | 593 | } |
592 | 594 | ||
593 | /* the range has to start at 1!!! not with 0!!!! */ | 595 | /* the range has to start at 1!!! not with 0!!!! */ |
594 | set = mailimap_set_new_interval( mail->getNumber(),mail->getNumber() ); | 596 | set = mailimap_set_new_interval( mail->getNumber(),mail->getNumber() ); |
595 | fetchAtt = mailimap_fetch_att_new_bodystructure(); | 597 | fetchAtt = mailimap_fetch_att_new_bodystructure(); |
596 | fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); | 598 | fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); |
597 | err = mailimap_fetch( m_imap, set, fetchType, &result ); | 599 | err = mailimap_fetch( m_imap, set, fetchType, &result ); |
598 | mailimap_set_free( set ); | 600 | mailimap_set_free( set ); |
599 | mailimap_fetch_type_free( fetchType ); | 601 | mailimap_fetch_type_free( fetchType ); |
600 | 602 | ||
601 | if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { | 603 | if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { |
602 | mailimap_msg_att * msg_att; | 604 | mailimap_msg_att * msg_att; |
603 | msg_att = (mailimap_msg_att*)current->data; | 605 | msg_att = (mailimap_msg_att*)current->data; |
604 | mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; | 606 | mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; |
605 | QValueList<int> path; | 607 | QValueList<int> path; |
606 | body_desc = item->att_data.att_static->att_data.att_body; | 608 | body_desc = item->att_data.att_static->att_data.att_body; |
607 | traverseBody(mail,body_desc,body,0,path); | 609 | traverseBody(mail,body_desc,body,0,path); |
608 | } else { | 610 | } else { |
609 | //odebug << "error fetching body: " << m_imap->imap_response << "" << oendl; | 611 | //odebug << "error fetching body: " << m_imap->imap_response << "" << oendl; |
610 | } | 612 | } |
611 | if (result) mailimap_fetch_list_free(result); | 613 | if (result) mailimap_fetch_list_free(result); |
612 | return body; | 614 | return body; |
613 | } | 615 | } |
614 | 616 | ||
615 | QStringList IMAPwrapper::address_list_to_stringlist(clist*list) | 617 | QStringList IMAPwrapper::address_list_to_stringlist(clist*list) |
616 | { | 618 | { |
617 | QStringList l; | 619 | QStringList l; |
618 | QString from; | 620 | QString from; |
619 | bool named_from; | 621 | bool named_from; |
620 | clistcell *current = NULL; | 622 | clistcell *current = NULL; |
621 | mailimap_address * current_address=NULL; | 623 | mailimap_address * current_address=NULL; |
622 | if (!list) { | 624 | if (!list) { |
623 | return l; | 625 | return l; |
624 | } | 626 | } |
625 | unsigned int count = 0; | 627 | unsigned int count = 0; |
626 | for (current=clist_begin(list);current!= NULL;current=clist_next(current)) { | 628 | for (current=clist_begin(list);current!= NULL;current=clist_next(current)) { |
627 | from = ""; | 629 | from = ""; |
628 | named_from = false; | 630 | named_from = false; |
629 | current_address=(mailimap_address*)current->data; | 631 | current_address=(mailimap_address*)current->data; |
630 | if (current_address->ad_personal_name){ | 632 | if (current_address->ad_personal_name){ |
631 | from+=convert_String((const char*)current_address->ad_personal_name); | 633 | from+=convert_String((const char*)current_address->ad_personal_name); |
632 | from+=" "; | 634 | from+=" "; |
633 | named_from = true; | 635 | named_from = true; |
634 | } | 636 | } |
635 | if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) { | 637 | if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) { |
636 | from+="<"; | 638 | from+="<"; |
637 | } | 639 | } |
638 | if (current_address->ad_mailbox_name) { | 640 | if (current_address->ad_mailbox_name) { |
639 | from+=QString(current_address->ad_mailbox_name); | 641 | from+=QString(current_address->ad_mailbox_name); |
640 | from+="@"; | 642 | from+="@"; |
641 | } | 643 | } |
642 | if (current_address->ad_host_name) { | 644 | if (current_address->ad_host_name) { |
643 | from+=QString(current_address->ad_host_name); | 645 | from+=QString(current_address->ad_host_name); |
644 | } | 646 | } |
645 | if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) { | 647 | if (named_from && (current_address->ad_mailbox_name || current_address->ad_host_name)) { |
646 | from+=">"; | 648 | from+=">"; |
647 | } | 649 | } |
648 | l.append(QString(from)); | 650 | l.append(QString(from)); |
649 | if (++count > 99) { | 651 | if (++count > 99) { |
650 | break; | 652 | break; |
651 | } | 653 | } |
652 | } | 654 | } |
653 | return l; | 655 | return l; |
654 | } | 656 | } |
655 | 657 | ||
656 | encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) | 658 | encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) |
657 | { | 659 | { |
658 | encodedString*res=new encodedString; | 660 | encodedString*res=new encodedString; |
659 | int err; | 661 | int err; |
660 | mailimap_fetch_type *fetchType; | 662 | mailimap_fetch_type *fetchType; |
661 | mailimap_set *set; | 663 | mailimap_set *set; |
662 | clistcell*current,*cur; | 664 | clistcell*current,*cur; |
663 | mailimap_section_part * section_part = 0; | 665 | mailimap_section_part * section_part = 0; |
664 | mailimap_section_spec * section_spec = 0; | 666 | mailimap_section_spec * section_spec = 0; |
665 | mailimap_section * section = 0; | 667 | mailimap_section * section = 0; |
666 | mailimap_fetch_att * fetch_att = 0; | 668 | mailimap_fetch_att * fetch_att = 0; |
667 | 669 | ||
668 | login(); | 670 | login(); |
669 | if (!m_imap) { | 671 | if (!m_imap) { |
670 | return res; | 672 | return res; |
671 | } | 673 | } |
672 | if (!internal_call) { | 674 | if (!internal_call) { |
673 | err = selectMbox(mail->getMbox()); | 675 | err = selectMbox(mail->getMbox()); |
674 | if ( err != MAILIMAP_NO_ERROR ) { | 676 | if ( err != MAILIMAP_NO_ERROR ) { |
675 | return res; | 677 | return res; |
676 | } | 678 | } |
677 | } | 679 | } |
678 | set = mailimap_set_new_single(mail->getNumber()); | 680 | set = mailimap_set_new_single(mail->getNumber()); |
679 | 681 | ||
680 | clist*id_list = 0; | 682 | clist*id_list = 0; |
681 | 683 | ||
682 | /* if path == empty then its a request for the whole rfc822 mail and generates | 684 | /* if path == empty then its a request for the whole rfc822 mail and generates |
683 | a "fetch <id> (body[])" statement on imap server */ | 685 | a "fetch <id> (body[])" statement on imap server */ |
684 | if (path.count()>0 ) { | 686 | if (path.count()>0 ) { |
685 | id_list = clist_new(); | 687 | id_list = clist_new(); |
686 | for (unsigned j=0; j < path.count();++j) { | 688 | for (unsigned j=0; j < path.count();++j) { |
687 | uint32_t * p_id = (uint32_t *)malloc(sizeof(*p_id)); | 689 | uint32_t * p_id = (uint32_t *)malloc(sizeof(*p_id)); |
688 | *p_id = path[j]; | 690 | *p_id = path[j]; |
689 | clist_append(id_list,p_id); | 691 | clist_append(id_list,p_id); |
690 | } | 692 | } |
691 | section_part = mailimap_section_part_new(id_list); | 693 | section_part = mailimap_section_part_new(id_list); |
692 | section_spec = mailimap_section_spec_new(MAILIMAP_SECTION_SPEC_SECTION_PART, NULL, section_part, NULL); | 694 | section_spec = mailimap_section_spec_new(MAILIMAP_SECTION_SPEC_SECTION_PART, NULL, section_part, NULL); |
693 | } | 695 | } |
694 | 696 | ||
695 | section = mailimap_section_new(section_spec); | 697 | section = mailimap_section_new(section_spec); |
696 | fetch_att = mailimap_fetch_att_new_body_section(section); | 698 | fetch_att = mailimap_fetch_att_new_body_section(section); |
697 | fetchType = mailimap_fetch_type_new_fetch_att(fetch_att); | 699 | fetchType = mailimap_fetch_type_new_fetch_att(fetch_att); |
698 | 700 | ||
699 | clist*result = 0; | 701 | clist*result = 0; |
700 | 702 | ||
701 | err = mailimap_fetch( m_imap, set, fetchType, &result ); | 703 | err = mailimap_fetch( m_imap, set, fetchType, &result ); |
702 | mailimap_set_free( set ); | 704 | mailimap_set_free( set ); |
703 | mailimap_fetch_type_free( fetchType ); | 705 | mailimap_fetch_type_free( fetchType ); |
704 | 706 | ||
705 | if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { | 707 | if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { |
706 | mailimap_msg_att * msg_att; | 708 | mailimap_msg_att * msg_att; |
707 | msg_att = (mailimap_msg_att*)current->data; | 709 | msg_att = (mailimap_msg_att*)current->data; |
708 | mailimap_msg_att_item*msg_att_item; | 710 | mailimap_msg_att_item*msg_att_item; |
709 | for(cur = clist_begin(msg_att->att_list) ; cur != NULL ; cur = clist_next(cur)) { | 711 | for(cur = clist_begin(msg_att->att_list) ; cur != NULL ; cur = clist_next(cur)) { |
710 | msg_att_item = (mailimap_msg_att_item*)clist_content(cur); | 712 | msg_att_item = (mailimap_msg_att_item*)clist_content(cur); |
711 | if (msg_att_item->att_type == MAILIMAP_MSG_ATT_ITEM_STATIC) { | 713 | if (msg_att_item->att_type == MAILIMAP_MSG_ATT_ITEM_STATIC) { |
712 | if (msg_att_item->att_data.att_static->att_type == MAILIMAP_MSG_ATT_BODY_SECTION) { | 714 | if (msg_att_item->att_data.att_static->att_type == MAILIMAP_MSG_ATT_BODY_SECTION) { |
713 | char*text = msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part; | 715 | char*text = msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part; |
714 | /* detach - we take over the content */ | 716 | /* detach - we take over the content */ |
715 | msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part = 0L; | 717 | msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part = 0L; |
716 | res->setContent(text,msg_att_item->att_data.att_static->att_data.att_body_section->sec_length); | 718 | res->setContent(text,msg_att_item->att_data.att_static->att_data.att_body_section->sec_length); |
717 | } | 719 | } |
718 | } | 720 | } |
719 | } | 721 | } |
720 | } else { | 722 | } else { |
721 | ;//odebug << "error fetching text: " << m_imap->imap_response << "" << oendl; | 723 | ;//odebug << "error fetching text: " << m_imap->imap_response << "" << oendl; |
722 | } | 724 | } |
723 | if (result) mailimap_fetch_list_free(result); | 725 | if (result) mailimap_fetch_list_free(result); |
724 | return res; | 726 | return res; |
725 | } | 727 | } |
726 | 728 | ||
727 | /* current_recursion is for recursive calls. | 729 | /* current_recursion is for recursive calls. |
728 | current_count means the position inside the internal loop! */ | 730 | current_count means the position inside the internal loop! */ |
729 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, | 731 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, |
730 | int current_recursion,QValueList<int>recList,int current_count) | 732 | int current_recursion,QValueList<int>recList,int current_count) |
731 | { | 733 | { |
732 | if (!body || current_recursion>=10) { | 734 | if (!body || current_recursion>=10) { |
733 | return; | 735 | return; |
734 | } | 736 | } |
735 | switch (body->bd_type) { | 737 | switch (body->bd_type) { |
736 | case MAILIMAP_BODY_1PART: | 738 | case MAILIMAP_BODY_1PART: |
737 | { | 739 | { |
738 | QValueList<int>countlist = recList; | 740 | QValueList<int>countlist = recList; |
739 | countlist.append(current_count); | 741 | countlist.append(current_count); |
740 | RecPartP currentPart = new RecPart(); | 742 | RecPartP currentPart = new RecPart(); |
741 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; | 743 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; |
742 | QString id(""); | 744 | QString id(""); |
743 | currentPart->setPositionlist(countlist); | 745 | currentPart->setPositionlist(countlist); |
744 | for (unsigned int j = 0; j < countlist.count();++j) { | 746 | for (unsigned int j = 0; j < countlist.count();++j) { |
745 | id+=(j>0?" ":""); | 747 | id+=(j>0?" ":""); |
746 | id+=QString("%1").arg(countlist[j]); | 748 | id+=QString("%1").arg(countlist[j]); |
747 | } | 749 | } |
748 | //odebug << "ID = " << id.latin1() << "" << oendl; | 750 | //odebug << "ID = " << id.latin1() << "" << oendl; |
749 | currentPart->setIdentifier(id); | 751 | currentPart->setIdentifier(id); |
750 | fillSinglePart(currentPart,part1); | 752 | fillSinglePart(currentPart,part1); |
751 | /* important: Check for is NULL 'cause a body can be empty! | 753 | /* important: Check for is NULL 'cause a body can be empty! |
752 | And we put it only into the mail if it is the FIRST part */ | 754 | And we put it only into the mail if it is the FIRST part */ |
753 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { | 755 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { |
754 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); | 756 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); |
755 | 757 | ||
756 | size_t index = 0; | 758 | size_t index = 0; |
757 | char*res = 0; | 759 | char*res = 0; |
758 | int err = MAILIMF_NO_ERROR; | 760 | int err = MAILIMF_NO_ERROR; |
759 | 761 | ||
760 | QString charset = currentPart->searchParamter( "charset"); | 762 | QString charset = currentPart->searchParamter( "charset"); |
761 | qDebug("CHARSET %s ",charset.latin1() ); | 763 | qDebug("CHARSET %s ",charset.latin1() ); |
762 | if ( false ) { | 764 | if ( false ) { |
763 | //if ( !charset.isEmpty() ) { | 765 | //if ( !charset.isEmpty() ) { |
764 | target_body->setCharset( charset ); | 766 | target_body->setCharset( charset ); |
765 | //err = mailmime_encoded_phrase_parse("iso-8859-1", | 767 | //err = mailmime_encoded_phrase_parse("iso-8859-1", |
766 | // text, strlen(text),&index, "iso-8859-1",&res); | 768 | // text, strlen(text),&index, "iso-8859-1",&res); |
767 | err = mailmime_encoded_phrase_parse(charset.latin1(), | 769 | err = mailmime_encoded_phrase_parse(charset.latin1(), |
768 | body_text.latin1(), body_text.length(),&index, "utf-8",&res); | 770 | body_text.latin1(), body_text.length(),&index, "utf-8",&res); |
769 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { | 771 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { |
770 | //qDebug("res %d %s ", index, res); | 772 | //qDebug("res %d %s ", index, res); |
771 | body_text = QString::fromUtf8(res); | 773 | body_text = QString::fromUtf8(res); |
772 | } | 774 | } |
773 | if (res) free(res); | 775 | if (res) free(res); |
774 | } | 776 | } |
775 | //qDebug("encoding %d text %s ",currentPart->Encoding().latin1(), body_text.latin1() ); | 777 | //qDebug("encoding %d text %s ",currentPart->Encoding().latin1(), body_text.latin1() ); |
776 | target_body->setDescription(currentPart); | 778 | target_body->setDescription(currentPart); |
777 | target_body->setBodytext(body_text); | 779 | target_body->setBodytext(body_text); |
778 | if (countlist.count()>1) { | 780 | if (countlist.count()>1) { |
779 | target_body->addPart(currentPart); | 781 | target_body->addPart(currentPart); |
780 | } | 782 | } |
781 | } else { | 783 | } else { |
782 | target_body->addPart(currentPart); | 784 | target_body->addPart(currentPart); |
783 | } | 785 | } |
784 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_MSG) { | 786 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_MSG) { |
785 | traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); | 787 | traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); |
786 | } | 788 | } |
787 | } | 789 | } |
788 | break; | 790 | break; |
789 | case MAILIMAP_BODY_MPART: | 791 | case MAILIMAP_BODY_MPART: |
790 | { | 792 | { |
791 | QValueList<int>countlist = recList; | 793 | QValueList<int>countlist = recList; |
792 | clistcell*current=0; | 794 | clistcell*current=0; |
793 | mailimap_body*current_body=0; | 795 | mailimap_body*current_body=0; |
794 | unsigned int ccount = 1; | 796 | unsigned int ccount = 1; |
795 | mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; | 797 | mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; |
796 | for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { | 798 | for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { |
797 | current_body = (mailimap_body*)current->data; | 799 | current_body = (mailimap_body*)current->data; |
798 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { | 800 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { |
799 | RecPartP targetPart = new RecPart(); | 801 | RecPartP targetPart = new RecPart(); |
800 | targetPart->setType("multipart"); | 802 | targetPart->setType("multipart"); |
801 | fillMultiPart(targetPart,mailDescription); | 803 | fillMultiPart(targetPart,mailDescription); |
802 | countlist.append(current_count); | 804 | countlist.append(current_count); |
803 | targetPart->setPositionlist(countlist); | 805 | targetPart->setPositionlist(countlist); |
804 | target_body->addPart(targetPart); | 806 | target_body->addPart(targetPart); |
805 | QString id(""); | 807 | QString id(""); |
806 | for (unsigned int j = 0; j < countlist.count();++j) { | 808 | for (unsigned int j = 0; j < countlist.count();++j) { |
807 | id+=(j>0?" ":""); | 809 | id+=(j>0?" ":""); |
808 | id+=QString("%1").arg(countlist[j]); | 810 | id+=QString("%1").arg(countlist[j]); |
809 | } | 811 | } |
810 | // odebug << "ID(mpart) = " << id.latin1() << "" << oendl; | 812 | // odebug << "ID(mpart) = " << id.latin1() << "" << oendl; |
811 | } | 813 | } |
812 | traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount); | 814 | traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount); |
813 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { | 815 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { |
814 | countlist = recList; | 816 | countlist = recList; |
815 | } | 817 | } |
816 | ++ccount; | 818 | ++ccount; |
817 | } | 819 | } |
818 | } | 820 | } |
819 | break; | 821 | break; |
820 | default: | 822 | default: |
821 | break; | 823 | break; |
822 | } | 824 | } |
823 | } | 825 | } |
824 | 826 | ||
825 | void IMAPwrapper::fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description) | 827 | void IMAPwrapper::fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description) |
826 | { | 828 | { |
827 | if (!Description) { | 829 | if (!Description) { |
828 | return; | 830 | return; |
829 | } | 831 | } |
830 | switch (Description->bd_type) { | 832 | switch (Description->bd_type) { |
831 | case MAILIMAP_BODY_TYPE_1PART_TEXT: | 833 | case MAILIMAP_BODY_TYPE_1PART_TEXT: |
832 | target_part->setType("text"); | 834 | target_part->setType("text"); |
833 | fillSingleTextPart(target_part,Description->bd_data.bd_type_text); | 835 | fillSingleTextPart(target_part,Description->bd_data.bd_type_text); |
834 | break; | 836 | break; |
835 | case MAILIMAP_BODY_TYPE_1PART_BASIC: | 837 | case MAILIMAP_BODY_TYPE_1PART_BASIC: |
836 | fillSingleBasicPart(target_part,Description->bd_data.bd_type_basic); | 838 | fillSingleBasicPart(target_part,Description->bd_data.bd_type_basic); |
837 | break; | 839 | break; |
838 | case MAILIMAP_BODY_TYPE_1PART_MSG: | 840 | case MAILIMAP_BODY_TYPE_1PART_MSG: |
839 | target_part->setType("message"); | 841 | target_part->setType("message"); |
840 | fillSingleMsgPart(target_part,Description->bd_data.bd_type_msg); | 842 | fillSingleMsgPart(target_part,Description->bd_data.bd_type_msg); |
841 | break; | 843 | break; |
842 | default: | 844 | default: |
843 | break; | 845 | break; |
844 | } | 846 | } |
845 | } | 847 | } |
846 | 848 | ||
847 | void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which) | 849 | void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which) |
848 | { | 850 | { |
849 | if (!which) { | 851 | if (!which) { |
850 | return; | 852 | return; |
851 | } | 853 | } |
852 | QString sub; | 854 | QString sub; |
853 | sub = which->bd_media_text; | 855 | sub = which->bd_media_text; |
854 | //odebug << "Type= text/" << which->bd_media_text << "" << oendl; | 856 | //odebug << "Type= text/" << which->bd_media_text << "" << oendl; |
855 | target_part->setSubtype(sub.lower()); | 857 | target_part->setSubtype(sub.lower()); |
856 | target_part->setLines(which->bd_lines); | 858 | target_part->setLines(which->bd_lines); |
857 | fillBodyFields(target_part,which->bd_fields); | 859 | fillBodyFields(target_part,which->bd_fields); |
858 | } | 860 | } |
859 | 861 | ||
860 | void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which) | 862 | void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which) |
861 | { | 863 | { |
862 | if (!which) { | 864 | if (!which) { |
863 | return; | 865 | return; |
864 | } | 866 | } |
865 | target_part->setSubtype("rfc822"); | 867 | target_part->setSubtype("rfc822"); |
866 | //odebug << "Message part" << oendl; | 868 | //odebug << "Message part" << oendl; |
867 | /* we set this type to text/plain */ | 869 | /* we set this type to text/plain */ |
868 | target_part->setLines(which->bd_lines); | 870 | target_part->setLines(which->bd_lines); |
869 | fillBodyFields(target_part,which->bd_fields); | 871 | fillBodyFields(target_part,which->bd_fields); |
870 | } | 872 | } |
871 | 873 | ||
872 | void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which) | 874 | void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which) |
873 | { | 875 | { |
874 | if (!which) return; | 876 | if (!which) return; |
875 | QString sub = which->bd_media_subtype; | 877 | QString sub = which->bd_media_subtype; |
876 | target_part->setSubtype(sub.lower()); | 878 | target_part->setSubtype(sub.lower()); |
877 | if (which->bd_ext_mpart && which->bd_ext_mpart->bd_parameter && which->bd_ext_mpart->bd_parameter->pa_list) { | 879 | if (which->bd_ext_mpart && which->bd_ext_mpart->bd_parameter && which->bd_ext_mpart->bd_parameter->pa_list) { |
878 | clistcell*cur = 0; | 880 | clistcell*cur = 0; |
879 | mailimap_single_body_fld_param*param=0; | 881 | mailimap_single_body_fld_param*param=0; |
880 | for (cur = clist_begin(which->bd_ext_mpart->bd_parameter->pa_list);cur!=NULL;cur=clist_next(cur)) { | 882 | for (cur = clist_begin(which->bd_ext_mpart->bd_parameter->pa_list);cur!=NULL;cur=clist_next(cur)) { |
881 | param = (mailimap_single_body_fld_param*)cur->data; | 883 | param = (mailimap_single_body_fld_param*)cur->data; |
882 | if (param) { | 884 | if (param) { |
883 | target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); | 885 | target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); |
884 | } | 886 | } |
885 | } | 887 | } |
886 | } | 888 | } |
887 | } | 889 | } |
888 | 890 | ||
889 | void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which) | 891 | void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which) |
890 | { | 892 | { |
891 | if (!which) { | 893 | if (!which) { |
892 | return; | 894 | return; |
893 | } | 895 | } |
894 | QString type,sub; | 896 | QString type,sub; |
895 | switch (which->bd_media_basic->med_type) { | 897 | switch (which->bd_media_basic->med_type) { |
896 | case MAILIMAP_MEDIA_BASIC_APPLICATION: | 898 | case MAILIMAP_MEDIA_BASIC_APPLICATION: |
897 | type = "application"; | 899 | type = "application"; |
898 | break; | 900 | break; |
899 | case MAILIMAP_MEDIA_BASIC_AUDIO: | 901 | case MAILIMAP_MEDIA_BASIC_AUDIO: |
900 | type = "audio"; | 902 | type = "audio"; |
901 | break; | 903 | break; |
902 | case MAILIMAP_MEDIA_BASIC_IMAGE: | 904 | case MAILIMAP_MEDIA_BASIC_IMAGE: |
903 | type = "image"; | 905 | type = "image"; |
904 | break; | 906 | break; |
905 | case MAILIMAP_MEDIA_BASIC_MESSAGE: | 907 | case MAILIMAP_MEDIA_BASIC_MESSAGE: |
906 | type = "message"; | 908 | type = "message"; |
907 | break; | 909 | break; |
908 | case MAILIMAP_MEDIA_BASIC_VIDEO: | 910 | case MAILIMAP_MEDIA_BASIC_VIDEO: |
909 | type = "video"; | 911 | type = "video"; |
910 | break; | 912 | break; |
911 | case MAILIMAP_MEDIA_BASIC_OTHER: | 913 | case MAILIMAP_MEDIA_BASIC_OTHER: |
912 | default: | 914 | default: |
913 | if (which->bd_media_basic->med_basic_type) { | 915 | if (which->bd_media_basic->med_basic_type) { |
914 | type = which->bd_media_basic->med_basic_type; | 916 | type = which->bd_media_basic->med_basic_type; |
915 | } else { | 917 | } else { |
916 | type = ""; | 918 | type = ""; |
917 | } | 919 | } |
918 | break; | 920 | break; |
919 | } | 921 | } |
920 | if (which->bd_media_basic->med_subtype) { | 922 | if (which->bd_media_basic->med_subtype) { |
921 | sub = which->bd_media_basic->med_subtype; | 923 | sub = which->bd_media_basic->med_subtype; |
922 | } else { | 924 | } else { |
923 | sub = ""; | 925 | sub = ""; |
924 | } | 926 | } |
925 | // odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl; | 927 | // odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl; |
926 | target_part->setType(type.lower()); | 928 | target_part->setType(type.lower()); |
927 | target_part->setSubtype(sub.lower()); | 929 | target_part->setSubtype(sub.lower()); |
928 | fillBodyFields(target_part,which->bd_fields); | 930 | fillBodyFields(target_part,which->bd_fields); |
929 | } | 931 | } |
930 | 932 | ||
931 | void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which) | 933 | void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which) |
932 | { | 934 | { |
933 | if (!which) return; | 935 | if (!which) return; |
934 | if (which->bd_parameter && which->bd_parameter->pa_list && which->bd_parameter->pa_list->count>0) { | 936 | if (which->bd_parameter && which->bd_parameter->pa_list && which->bd_parameter->pa_list->count>0) { |
935 | clistcell*cur; | 937 | clistcell*cur; |
936 | mailimap_single_body_fld_param*param=0; | 938 | mailimap_single_body_fld_param*param=0; |
937 | for (cur = clist_begin(which->bd_parameter->pa_list);cur!=NULL;cur=clist_next(cur)) { | 939 | for (cur = clist_begin(which->bd_parameter->pa_list);cur!=NULL;cur=clist_next(cur)) { |
938 | param = (mailimap_single_body_fld_param*)cur->data; | 940 | param = (mailimap_single_body_fld_param*)cur->data; |
939 | if (param) { | 941 | if (param) { |
940 | target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); | 942 | target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); |
941 | } | 943 | } |
942 | } | 944 | } |
943 | } | 945 | } |
944 | mailimap_body_fld_enc*enc = which->bd_encoding; | 946 | mailimap_body_fld_enc*enc = which->bd_encoding; |
945 | QString encoding(""); | 947 | QString encoding(""); |
946 | switch (enc->enc_type) { | 948 | switch (enc->enc_type) { |
947 | case MAILIMAP_BODY_FLD_ENC_7BIT: | 949 | case MAILIMAP_BODY_FLD_ENC_7BIT: |
948 | encoding = "7bit"; | 950 | encoding = "7bit"; |
949 | break; | 951 | break; |
950 | case MAILIMAP_BODY_FLD_ENC_8BIT: | 952 | case MAILIMAP_BODY_FLD_ENC_8BIT: |
951 | encoding = "8bit"; | 953 | encoding = "8bit"; |
952 | break; | 954 | break; |
953 | case MAILIMAP_BODY_FLD_ENC_BINARY: | 955 | case MAILIMAP_BODY_FLD_ENC_BINARY: |
954 | encoding="binary"; | 956 | encoding="binary"; |
955 | break; | 957 | break; |
956 | case MAILIMAP_BODY_FLD_ENC_BASE64: | 958 | case MAILIMAP_BODY_FLD_ENC_BASE64: |
957 | encoding="base64"; | 959 | encoding="base64"; |
958 | break; | 960 | break; |
959 | case MAILIMAP_BODY_FLD_ENC_QUOTED_PRINTABLE: | 961 | case MAILIMAP_BODY_FLD_ENC_QUOTED_PRINTABLE: |
960 | encoding="quoted-printable"; | 962 | encoding="quoted-printable"; |
961 | break; | 963 | break; |
962 | case MAILIMAP_BODY_FLD_ENC_OTHER: | 964 | case MAILIMAP_BODY_FLD_ENC_OTHER: |
963 | default: | 965 | default: |
964 | if (enc->enc_value) { | 966 | if (enc->enc_value) { |
965 | char*t=enc->enc_value; | 967 | char*t=enc->enc_value; |
966 | encoding=QString(enc->enc_value); | 968 | encoding=QString(enc->enc_value); |
967 | enc->enc_value=0L; | 969 | enc->enc_value=0L; |
968 | free(t); | 970 | free(t); |
969 | } | 971 | } |
970 | } | 972 | } |
971 | if (which->bd_description) { | 973 | if (which->bd_description) { |
972 | target_part->setDescription(QString(which->bd_description)); | 974 | target_part->setDescription(QString(which->bd_description)); |
973 | } | 975 | } |
974 | target_part->setEncoding(encoding); | 976 | target_part->setEncoding(encoding); |
975 | target_part->setSize(which->bd_size); | 977 | target_part->setSize(which->bd_size); |
976 | } | 978 | } |
977 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | 979 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) |
978 | { | 980 | { |
979 | //#if 0 | 981 | //#if 0 |
980 | mailimap_flag_list*flist; | 982 | mailimap_flag_list*flist; |
981 | mailimap_set *set; | 983 | mailimap_set *set; |
982 | mailimap_store_att_flags * store_flags; | 984 | mailimap_store_att_flags * store_flags; |
983 | int err; | 985 | int err; |
984 | login(); | 986 | login(); |
985 | //#endif | 987 | //#endif |
986 | if (!m_imap) { | 988 | if (!m_imap) { |
987 | return; | 989 | return; |
988 | } | 990 | } |
989 | int iii = 0; | 991 | int iii = 0; |
990 | int count = target.count(); | 992 | int count = target.count(); |
991 | // qDebug("imap remove count %d ", count); | 993 | // qDebug("imap remove count %d ", count); |
992 | 994 | ||
993 | 995 | ||
994 | mMax = count; | 996 | mMax = count; |
995 | progress( i18n("Delete")); | 997 | progress( i18n("Delete")); |
996 | 998 | ||
997 | QProgressBar wid ( count ); | 999 | QProgressBar wid ( count ); |
998 | wid.setCaption( i18n("Deleting ...")); | 1000 | wid.setCaption( i18n("Deleting ...")); |
999 | wid.show(); | 1001 | wid.show(); |
1000 | while (iii < count ) { | 1002 | while (iii < count ) { |
1001 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); | 1003 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); |
1002 | wid.setProgress( iii ); | 1004 | wid.setProgress( iii ); |
1003 | wid.raise(); | 1005 | wid.raise(); |
1004 | qApp->processEvents(); | 1006 | qApp->processEvents(); |
1005 | RecMailP mail = (*target.at( iii )); | 1007 | RecMailP mail = (*target.at( iii )); |
1006 | //#if 0 | 1008 | //#if 0 |
1007 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); | 1009 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); |
1008 | err = selectMbox(mail->getMbox()); | 1010 | err = selectMbox(mail->getMbox()); |
1009 | if ( err != MAILIMAP_NO_ERROR ) { | 1011 | if ( err != MAILIMAP_NO_ERROR ) { |
1010 | return; | 1012 | return; |
1011 | } | 1013 | } |
1012 | flist = mailimap_flag_list_new_empty(); | 1014 | flist = mailimap_flag_list_new_empty(); |
1013 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | 1015 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); |
1014 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 1016 | store_flags = mailimap_store_att_flags_new_set_flags(flist); |
1015 | set = mailimap_set_new_single(mail->getNumber()); | 1017 | set = mailimap_set_new_single(mail->getNumber()); |
1016 | err = mailimap_store(m_imap,set,store_flags); | 1018 | err = mailimap_store(m_imap,set,store_flags); |
1017 | mailimap_set_free( set ); | 1019 | mailimap_set_free( set ); |
1018 | mailimap_store_att_flags_free(store_flags); | 1020 | mailimap_store_att_flags_free(store_flags); |
1019 | 1021 | ||
1020 | if (err != MAILIMAP_NO_ERROR) { | 1022 | if (err != MAILIMAP_NO_ERROR) { |
1021 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; | 1023 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; |
1022 | return; | 1024 | return; |
1023 | } | 1025 | } |
1024 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; | 1026 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; |
1025 | /* should we realy do that at this moment? */ | 1027 | /* should we realy do that at this moment? */ |
1026 | 1028 | ||
1027 | // err = mailimap_expunge(m_imap); | 1029 | // err = mailimap_expunge(m_imap); |
1028 | //if (err != MAILIMAP_NO_ERROR) { | 1030 | //if (err != MAILIMAP_NO_ERROR) { |
1029 | // Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response)); | 1031 | // Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response)); |
1030 | // } | 1032 | // } |
1031 | //#endif | 1033 | //#endif |
1032 | //deleteMail( mail); | 1034 | //deleteMail( mail); |
1033 | ++iii; | 1035 | ++iii; |
1034 | } | 1036 | } |
1035 | //qDebug("Deleting imap mails... "); | 1037 | //qDebug("Deleting imap mails... "); |
1036 | err = mailimap_expunge(m_imap); | 1038 | err = mailimap_expunge(m_imap); |
1037 | if (err != MAILIMAP_NO_ERROR) { | 1039 | if (err != MAILIMAP_NO_ERROR) { |
1038 | Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response)); | 1040 | Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response)); |
1039 | } | 1041 | } |
1040 | } | 1042 | } |
1041 | void IMAPwrapper::deleteMail(const RecMailP&mail) | 1043 | void IMAPwrapper::deleteMail(const RecMailP&mail) |
1042 | { | 1044 | { |
1043 | mailimap_flag_list*flist; | 1045 | mailimap_flag_list*flist; |
1044 | mailimap_set *set; | 1046 | mailimap_set *set; |
1045 | mailimap_store_att_flags * store_flags; | 1047 | mailimap_store_att_flags * store_flags; |
1046 | int err; | 1048 | int err; |
1047 | login(); | 1049 | login(); |
1048 | if (!m_imap) { | 1050 | if (!m_imap) { |
1049 | return; | 1051 | return; |
1050 | } | 1052 | } |
1051 | err = selectMbox(mail->getMbox()); | 1053 | err = selectMbox(mail->getMbox()); |
1052 | if ( err != MAILIMAP_NO_ERROR ) { | 1054 | if ( err != MAILIMAP_NO_ERROR ) { |
1053 | return; | 1055 | return; |
1054 | } | 1056 | } |
1055 | flist = mailimap_flag_list_new_empty(); | 1057 | flist = mailimap_flag_list_new_empty(); |
1056 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | 1058 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); |
1057 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 1059 | store_flags = mailimap_store_att_flags_new_set_flags(flist); |
1058 | set = mailimap_set_new_single(mail->getNumber()); | 1060 | set = mailimap_set_new_single(mail->getNumber()); |
1059 | err = mailimap_store(m_imap,set,store_flags); | 1061 | err = mailimap_store(m_imap,set,store_flags); |
1060 | mailimap_set_free( set ); | 1062 | mailimap_set_free( set ); |
1061 | mailimap_store_att_flags_free(store_flags); | 1063 | mailimap_store_att_flags_free(store_flags); |
1062 | 1064 | ||
1063 | if (err != MAILIMAP_NO_ERROR) { | 1065 | if (err != MAILIMAP_NO_ERROR) { |
1064 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; | 1066 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; |
1065 | return; | 1067 | return; |
1066 | } | 1068 | } |
1067 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; | 1069 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; |
1068 | /* should we realy do that at this moment? */ | 1070 | /* should we realy do that at this moment? */ |
1069 | 1071 | ||
1070 | err = mailimap_expunge(m_imap); | 1072 | err = mailimap_expunge(m_imap); |
1071 | if (err != MAILIMAP_NO_ERROR) { | 1073 | if (err != MAILIMAP_NO_ERROR) { |
1072 | Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response)); | 1074 | Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response)); |
1073 | } | 1075 | } |
1074 | //qDebug("IMAPwrapper::deleteMail 2"); | 1076 | //qDebug("IMAPwrapper::deleteMail 2"); |
1075 | 1077 | ||
1076 | } | 1078 | } |
1077 | 1079 | ||
1078 | void IMAPwrapper::answeredMail(const RecMailP&mail) | 1080 | void IMAPwrapper::answeredMail(const RecMailP&mail) |
1079 | { | 1081 | { |
1080 | mailimap_flag_list*flist; | 1082 | mailimap_flag_list*flist; |
1081 | mailimap_set *set; | 1083 | mailimap_set *set; |
1082 | mailimap_store_att_flags * store_flags; | 1084 | mailimap_store_att_flags * store_flags; |
1083 | int err; | 1085 | int err; |
1084 | login(); | 1086 | login(); |
1085 | if (!m_imap) { | 1087 | if (!m_imap) { |
1086 | return; | 1088 | return; |
1087 | } | 1089 | } |
1088 | err = selectMbox(mail->getMbox()); | 1090 | err = selectMbox(mail->getMbox()); |
1089 | if ( err != MAILIMAP_NO_ERROR ) { | 1091 | if ( err != MAILIMAP_NO_ERROR ) { |
1090 | return; | 1092 | return; |
1091 | } | 1093 | } |
1092 | flist = mailimap_flag_list_new_empty(); | 1094 | flist = mailimap_flag_list_new_empty(); |
1093 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); | 1095 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); |
1094 | store_flags = mailimap_store_att_flags_new_add_flags(flist); | 1096 | store_flags = mailimap_store_att_flags_new_add_flags(flist); |
1095 | set = mailimap_set_new_single(mail->getNumber()); | 1097 | set = mailimap_set_new_single(mail->getNumber()); |
1096 | err = mailimap_store(m_imap,set,store_flags); | 1098 | err = mailimap_store(m_imap,set,store_flags); |
1097 | mailimap_set_free( set ); | 1099 | mailimap_set_free( set ); |
1098 | mailimap_store_att_flags_free(store_flags); | 1100 | mailimap_store_att_flags_free(store_flags); |
1099 | 1101 | ||
1100 | if (err != MAILIMAP_NO_ERROR) { | 1102 | if (err != MAILIMAP_NO_ERROR) { |
1101 | // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; | 1103 | // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; |
1102 | return; | 1104 | return; |
1103 | } | 1105 | } |
1104 | } | 1106 | } |
1105 | 1107 | ||
1106 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) | 1108 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) |
1107 | { | 1109 | { |
1108 | QString body(""); | 1110 | QString body(""); |
1109 | encodedString*res = fetchRawPart(mail,path,internal_call); | 1111 | encodedString*res = fetchRawPart(mail,path,internal_call); |
1110 | encodedString*r = decode_String(res,enc); | 1112 | encodedString*r = decode_String(res,enc); |
1111 | delete res; | 1113 | delete res; |
1112 | if (r) { | 1114 | if (r) { |
1113 | if (r->Length()>0) { | 1115 | if (r->Length()>0) { |
1114 | body = r->Content(); | 1116 | body = r->Content(); |
1115 | } | 1117 | } |
1116 | delete r; | 1118 | delete r; |
1117 | } | 1119 | } |
1118 | return body; | 1120 | return body; |
1119 | } | 1121 | } |
1120 | 1122 | ||
1121 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPartP&part) | 1123 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPartP&part) |
1122 | { | 1124 | { |
1123 | return fetchTextPart(mail,part->Positionlist(),false,part->Encoding()); | 1125 | return fetchTextPart(mail,part->Positionlist(),false,part->Encoding()); |
1124 | } | 1126 | } |
1125 | 1127 | ||
1126 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPartP&part) | 1128 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPartP&part) |
1127 | { | 1129 | { |
1128 | encodedString*res = fetchRawPart(mail,part->Positionlist(),false); | 1130 | encodedString*res = fetchRawPart(mail,part->Positionlist(),false); |
1129 | encodedString*r = decode_String(res,part->Encoding()); | 1131 | encodedString*r = decode_String(res,part->Encoding()); |
1130 | delete res; | 1132 | delete res; |
1131 | return r; | 1133 | return r; |
1132 | } | 1134 | } |
1133 | 1135 | ||
1134 | encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPartP&part) | 1136 | encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPartP&part) |
1135 | { | 1137 | { |
1136 | return fetchRawPart(mail,part->Positionlist(),false); | 1138 | return fetchRawPart(mail,part->Positionlist(),false); |
1137 | } | 1139 | } |
1138 | 1140 | ||
1139 | int IMAPwrapper::deleteAllMail(const FolderP&folder) | 1141 | int IMAPwrapper::deleteAllMail(const FolderP&folder) |
1140 | { | 1142 | { |
1141 | login(); | 1143 | login(); |
1142 | if (!m_imap) { | 1144 | if (!m_imap) { |
1143 | return 0; | 1145 | return 0; |
1144 | } | 1146 | } |
1145 | mailimap_flag_list*flist; | 1147 | mailimap_flag_list*flist; |
1146 | mailimap_set *set; | 1148 | mailimap_set *set; |
1147 | mailimap_store_att_flags * store_flags; | 1149 | mailimap_store_att_flags * store_flags; |
1148 | int err = selectMbox(folder->getName()); | 1150 | int err = selectMbox(folder->getName()); |
1149 | if ( err != MAILIMAP_NO_ERROR ) { | 1151 | if ( err != MAILIMAP_NO_ERROR ) { |
1150 | return 0; | 1152 | return 0; |
1151 | } | 1153 | } |
1152 | 1154 | ||
1153 | int last = m_imap->imap_selection_info->sel_exists; | 1155 | int last = m_imap->imap_selection_info->sel_exists; |
1154 | if (last == 0) { | 1156 | if (last == 0) { |
1155 | Global::statusMessage(i18n("Mailbox has no mails!")); | 1157 | Global::statusMessage(i18n("Mailbox has no mails!")); |
1156 | return 0; | 1158 | return 0; |
1157 | } | 1159 | } |
1158 | flist = mailimap_flag_list_new_empty(); | 1160 | flist = mailimap_flag_list_new_empty(); |
1159 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | 1161 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); |
1160 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 1162 | store_flags = mailimap_store_att_flags_new_set_flags(flist); |
1161 | set = mailimap_set_new_interval( 1, last ); | 1163 | set = mailimap_set_new_interval( 1, last ); |
1162 | err = mailimap_store(m_imap,set,store_flags); | 1164 | err = mailimap_store(m_imap,set,store_flags); |
1163 | mailimap_set_free( set ); | 1165 | mailimap_set_free( set ); |
1164 | mailimap_store_att_flags_free(store_flags); | 1166 | mailimap_store_att_flags_free(store_flags); |
1165 | if (err != MAILIMAP_NO_ERROR) { | 1167 | if (err != MAILIMAP_NO_ERROR) { |
1166 | Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response)); | 1168 | Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response)); |
1167 | return 0; | 1169 | return 0; |
1168 | } | 1170 | } |
1169 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; | 1171 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; |
1170 | /* should we realy do that at this moment? */ | 1172 | /* should we realy do that at this moment? */ |
1171 | err = mailimap_expunge(m_imap); | 1173 | err = mailimap_expunge(m_imap); |
1172 | if (err != MAILIMAP_NO_ERROR) { | 1174 | if (err != MAILIMAP_NO_ERROR) { |
1173 | Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response)); | 1175 | Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response)); |
1174 | return 0; | 1176 | return 0; |
1175 | } | 1177 | } |
1176 | // odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; | 1178 | // odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; |
1177 | return 1; | 1179 | return 1; |
1178 | } | 1180 | } |
1179 | 1181 | ||
1180 | int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) | 1182 | int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) |
1181 | { | 1183 | { |
1182 | if (folder.length()==0) return 0; | 1184 | if (folder.length()==0) return 0; |
1183 | login(); | 1185 | login(); |
1184 | if (!m_imap) {return 0;} | 1186 | if (!m_imap) {return 0;} |
1185 | QString pre = account->getPrefix(); | 1187 | QString pre = account->getPrefix(); |
1186 | if (delemiter.length()>0 && pre.findRev(delemiter)!=((int)pre.length())-1) { | 1188 | if (delemiter.length()>0 && pre.findRev(delemiter)!=((int)pre.length())-1) { |
1187 | pre+=delemiter; | 1189 | pre+=delemiter; |
1188 | } | 1190 | } |
1189 | if (parentfolder) { | 1191 | if (parentfolder) { |
1190 | pre += parentfolder->getDisplayName()+delemiter; | 1192 | pre += parentfolder->getDisplayName()+delemiter; |
1191 | } | 1193 | } |
1192 | pre+=folder; | 1194 | pre+=folder; |
1193 | if (getsubfolder) { | 1195 | if (getsubfolder) { |
1194 | if (delemiter.length()>0) { | 1196 | if (delemiter.length()>0) { |
1195 | pre+=delemiter; | 1197 | pre+=delemiter; |
1196 | } else { | 1198 | } else { |
1197 | Global::statusMessage(i18n("Cannot create folder %1 for holding subfolders").arg(pre)); | 1199 | Global::statusMessage(i18n("Cannot create folder %1 for holding subfolders").arg(pre)); |
1198 | return 0; | 1200 | return 0; |
1199 | } | 1201 | } |
1200 | } | 1202 | } |
1201 | // odebug << "Creating " << pre.latin1() << "" << oendl; | 1203 | // odebug << "Creating " << pre.latin1() << "" << oendl; |
1202 | int res = mailimap_create(m_imap,pre.latin1()); | 1204 | int res = mailimap_create(m_imap,pre.latin1()); |
1203 | if (res != MAILIMAP_NO_ERROR) { | 1205 | if (res != MAILIMAP_NO_ERROR) { |
1204 | Global::statusMessage(i18n("%1").arg(m_imap->imap_response)); | 1206 | Global::statusMessage(i18n("%1").arg(m_imap->imap_response)); |
1205 | return 0; | 1207 | return 0; |
1206 | } | 1208 | } |
1207 | return 1; | 1209 | return 1; |
1208 | } | 1210 | } |
1209 | 1211 | ||
1210 | int IMAPwrapper::deleteMbox(const FolderP&folder) | 1212 | int IMAPwrapper::deleteMbox(const FolderP&folder) |
1211 | { | 1213 | { |
1212 | if (!folder) return 0; | 1214 | if (!folder) return 0; |
1213 | login(); | 1215 | login(); |
1214 | if (!m_imap) {return 0;} | 1216 | if (!m_imap) {return 0;} |
1215 | int res = mailimap_delete(m_imap,folder->getName()); | 1217 | int res = mailimap_delete(m_imap,folder->getName()); |
1216 | if (res != MAILIMAP_NO_ERROR) { | 1218 | if (res != MAILIMAP_NO_ERROR) { |
1217 | Global::statusMessage(i18n("%1").arg(m_imap->imap_response)); | 1219 | Global::statusMessage(i18n("%1").arg(m_imap->imap_response)); |
1218 | return 0; | 1220 | return 0; |
1219 | } | 1221 | } |
1220 | return 1; | 1222 | return 1; |
1221 | } | 1223 | } |
1222 | 1224 | ||
1223 | void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | 1225 | void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) |
1224 | { | 1226 | { |
1225 | mailimap_status_att_list * att_list =0; | 1227 | mailimap_status_att_list * att_list =0; |
1226 | mailimap_mailbox_data_status * status=0; | 1228 | mailimap_mailbox_data_status * status=0; |
1227 | clistiter * cur = 0; | 1229 | clistiter * cur = 0; |
1228 | int r = 0; | 1230 | int r = 0; |
1229 | target_stat.message_count = 0; | 1231 | target_stat.message_count = 0; |
1230 | target_stat.message_unseen = 0; | 1232 | target_stat.message_unseen = 0; |
1231 | target_stat.message_recent = 0; | 1233 | target_stat.message_recent = 0; |
1232 | login(); | 1234 | login(); |
1233 | if (!m_imap) { | 1235 | if (!m_imap) { |
1234 | return; | 1236 | return; |
1235 | } | 1237 | } |
1236 | att_list = mailimap_status_att_list_new_empty(); | 1238 | att_list = mailimap_status_att_list_new_empty(); |
1237 | if (!att_list) return; | 1239 | if (!att_list) return; |
1238 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_MESSAGES); | 1240 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_MESSAGES); |
1239 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_RECENT); | 1241 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_RECENT); |
1240 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_UNSEEN); | 1242 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_UNSEEN); |
1241 | r = mailimap_status(m_imap, mailbox.latin1(), att_list, &status); | 1243 | r = mailimap_status(m_imap, mailbox.latin1(), att_list, &status); |
1242 | if (r==MAILIMAP_NO_ERROR&&status->st_info_list!=0) { | 1244 | if (r==MAILIMAP_NO_ERROR&&status->st_info_list!=0) { |
1243 | for (cur = clist_begin(status->st_info_list); | 1245 | for (cur = clist_begin(status->st_info_list); |
1244 | cur != NULL ; cur = clist_next(cur)) { | 1246 | cur != NULL ; cur = clist_next(cur)) { |
1245 | mailimap_status_info * status_info; | 1247 | mailimap_status_info * status_info; |
1246 | status_info = (mailimap_status_info *)clist_content(cur); | 1248 | status_info = (mailimap_status_info *)clist_content(cur); |
1247 | switch (status_info->st_att) { | 1249 | switch (status_info->st_att) { |
1248 | case MAILIMAP_STATUS_ATT_MESSAGES: | 1250 | case MAILIMAP_STATUS_ATT_MESSAGES: |
1249 | target_stat.message_count = status_info->st_value; | 1251 | target_stat.message_count = status_info->st_value; |
1250 | break; | 1252 | break; |
1251 | case MAILIMAP_STATUS_ATT_RECENT: | 1253 | case MAILIMAP_STATUS_ATT_RECENT: |
1252 | target_stat.message_recent = status_info->st_value; | 1254 | target_stat.message_recent = status_info->st_value; |
1253 | break; | 1255 | break; |
1254 | case MAILIMAP_STATUS_ATT_UNSEEN: | 1256 | case MAILIMAP_STATUS_ATT_UNSEEN: |
1255 | target_stat.message_unseen = status_info->st_value; | 1257 | target_stat.message_unseen = status_info->st_value; |
1256 | break; | 1258 | break; |
1257 | } | 1259 | } |
1258 | } | 1260 | } |
1259 | } else { | 1261 | } else { |
1260 | // odebug << "Error retrieving status" << oendl; | 1262 | // odebug << "Error retrieving status" << oendl; |
1261 | } | 1263 | } |
1262 | if (status) mailimap_mailbox_data_status_free(status); | 1264 | if (status) mailimap_mailbox_data_status_free(status); |
1263 | if (att_list) mailimap_status_att_list_free(att_list); | 1265 | if (att_list) mailimap_status_att_list_free(att_list); |
1264 | } | 1266 | } |
1265 | 1267 | ||
1266 | void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder) | 1268 | void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder) |
1267 | { | 1269 | { |
1268 | login(); | 1270 | login(); |
1269 | if (!m_imap) return; | 1271 | if (!m_imap) return; |
1270 | if (!msg) return; | 1272 | if (!msg) return; |
1271 | int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length); | 1273 | int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length); |
1272 | if (r != MAILIMAP_NO_ERROR) { | 1274 | if (r != MAILIMAP_NO_ERROR) { |
1273 | Global::statusMessage("Error storing mail!"); | 1275 | Global::statusMessage("Error storing mail!"); |
1274 | } | 1276 | } |
1275 | } | 1277 | } |
1276 | 1278 | ||
1277 | MAILLIB::ATYPE IMAPwrapper::getType()const | 1279 | MAILLIB::ATYPE IMAPwrapper::getType()const |
1278 | { | 1280 | { |
1279 | return account->getType(); | 1281 | return account->getType(); |
1280 | } | 1282 | } |
1281 | 1283 | ||
1282 | const QString&IMAPwrapper::getName()const | 1284 | const QString&IMAPwrapper::getName()const |
1283 | { | 1285 | { |
1284 | // odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl; | 1286 | // odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl; |
1285 | return account->getAccountName(); | 1287 | return account->getAccountName(); |
1286 | } | 1288 | } |
1287 | 1289 | ||
1288 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) | 1290 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) |
1289 | { | 1291 | { |
1290 | // dummy | 1292 | // dummy |
1291 | QValueList<int> path; | 1293 | QValueList<int> path; |
1292 | return fetchRawPart(mail,path,false); | 1294 | return fetchRawPart(mail,path,false); |
1293 | } | 1295 | } |
1294 | 1296 | ||
1295 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | 1297 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, |
1296 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) | 1298 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) |
1297 | { | 1299 | { |
1298 | if (targetWrapper != this || maxSizeInKb > 0 ) { | 1300 | if (targetWrapper != this || maxSizeInKb > 0 ) { |
1299 | mMax = 0; | 1301 | mMax = 0; |
1300 | progress( i18n("Copy")); | 1302 | progress( i18n("Copy")); |
1301 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); | 1303 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); |
1302 | //qDebug("IMAPwrapper::mvcpAllMails::Using generic"); | 1304 | //qDebug("IMAPwrapper::mvcpAllMails::Using generic"); |
1303 | // odebug << "Using generic" << oendl; | 1305 | // odebug << "Using generic" << oendl; |
1304 | return; | 1306 | return; |
1305 | } | 1307 | } |
1306 | mailimap_set *set = 0; | 1308 | mailimap_set *set = 0; |
1307 | login(); | 1309 | login(); |
1308 | if (!m_imap) { | 1310 | if (!m_imap) { |
1309 | return; | 1311 | return; |
1310 | } | 1312 | } |
1311 | int err = selectMbox(fromFolder->getName()); | 1313 | int err = selectMbox(fromFolder->getName()); |
1312 | if ( err != MAILIMAP_NO_ERROR ) { | 1314 | if ( err != MAILIMAP_NO_ERROR ) { |
1313 | return; | 1315 | return; |
1314 | } | 1316 | } |
1315 | Global::statusMessage( i18n("Copying mails on server...") ); | 1317 | Global::statusMessage( i18n("Copying mails on server...") ); |
1316 | int last = m_imap->imap_selection_info->sel_exists; | 1318 | int last = m_imap->imap_selection_info->sel_exists; |
1317 | set = mailimap_set_new_interval( 1, last ); | 1319 | set = mailimap_set_new_interval( 1, last ); |
1318 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); | 1320 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); |
1319 | mailimap_set_free( set ); | 1321 | mailimap_set_free( set ); |
1320 | if ( err != MAILIMAP_NO_ERROR ) { | 1322 | if ( err != MAILIMAP_NO_ERROR ) { |
1321 | QString error_msg = i18n("Error copy mails: %1").arg(m_imap->imap_response); | 1323 | QString error_msg = i18n("Error copy mails: %1").arg(m_imap->imap_response); |
1322 | Global::statusMessage(error_msg); | 1324 | Global::statusMessage(error_msg); |
1323 | // odebug << error_msg << oendl; | 1325 | // odebug << error_msg << oendl; |
1324 | return; | 1326 | return; |
1325 | } | 1327 | } |
1326 | if (moveit) { | 1328 | if (moveit) { |
1327 | deleteAllMail(fromFolder); | 1329 | deleteAllMail(fromFolder); |
1328 | } | 1330 | } |
1329 | } | 1331 | } |
1330 | 1332 | ||
1331 | void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1333 | void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
1332 | { | 1334 | { |
1333 | if (targetWrapper != this) { | 1335 | if (targetWrapper != this) { |
1334 | // odebug << "Using generic" << oendl; | 1336 | // odebug << "Using generic" << oendl; |
1335 | AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); | 1337 | AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); |
1336 | return; | 1338 | return; |
1337 | } | 1339 | } |
1338 | mailimap_set *set = 0; | 1340 | mailimap_set *set = 0; |
1339 | login(); | 1341 | login(); |
1340 | if (!m_imap) { | 1342 | if (!m_imap) { |
1341 | return; | 1343 | return; |
1342 | } | 1344 | } |
1343 | int err = selectMbox(mail->getMbox()); | 1345 | int err = selectMbox(mail->getMbox()); |
1344 | if ( err != MAILIMAP_NO_ERROR ) { | 1346 | if ( err != MAILIMAP_NO_ERROR ) { |
1345 | return; | 1347 | return; |
1346 | } | 1348 | } |
1347 | set = mailimap_set_new_single(mail->getNumber()); | 1349 | set = mailimap_set_new_single(mail->getNumber()); |
1348 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); | 1350 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); |
1349 | mailimap_set_free( set ); | 1351 | mailimap_set_free( set ); |
1350 | if ( err != MAILIMAP_NO_ERROR ) { | 1352 | if ( err != MAILIMAP_NO_ERROR ) { |
1351 | QString error_msg = i18n("error copy mail: %1").arg(m_imap->imap_response); | 1353 | QString error_msg = i18n("error copy mail: %1").arg(m_imap->imap_response); |
1352 | Global::statusMessage(error_msg); | 1354 | Global::statusMessage(error_msg); |
1353 | // odebug << error_msg << oendl; | 1355 | // odebug << error_msg << oendl; |
1354 | return; | 1356 | return; |
1355 | } | 1357 | } |
1356 | if (moveit) { | 1358 | if (moveit) { |
1357 | deleteMail(mail); | 1359 | deleteMail(mail); |
1358 | } | 1360 | } |
1359 | } | 1361 | } |