summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-29 10:15:34 (UTC)
committer zautrix <zautrix>2005-07-29 10:15:34 (UTC)
commit43a46672f4212c9617c753e0aa591f781d2e5240 (patch) (unidiff)
treec91a20a73aa042735e3e7141e443ae7d2bffc148
parent8feb7e617f1aa5cd5bb04d9a69d05409c3c4c60d (diff)
downloadkdepimpi-43a46672f4212c9617c753e0aa591f781d2e5240.zip
kdepimpi-43a46672f4212c9617c753e0aa591f781d2e5240.tar.gz
kdepimpi-43a46672f4212c9617c753e0aa591f781d2e5240.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--libkdepim/ksyncmanager.cpp8
2 files changed, 10 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 8264410..fd29b51 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,260 +1,263 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.1.18 ************ 3********** VERSION 2.1.18 ************
4 4
5Pi-Sync mode:
6The "Write back file" status dialog was updated too often such that writing back the file on the Z was very slow. Fixed.
7
5KO/Pi: 8KO/Pi:
6 9
7 10
8********** VERSION 2.1.17 ************ 11********** VERSION 2.1.17 ************
9 12
10KO/Pi: 13KO/Pi:
11Added option to display times in What's Next View on two lines. 14Added option to display times in What's Next View on two lines.
12(Useful for display on the Zaurus with 240x320 screen) 15(Useful for display on the Zaurus with 240x320 screen)
13Removed "Allday" for allday events of one day duration in What's Next View. 16Removed "Allday" for allday events of one day duration in What's Next View.
14Added date range for allday events of more than one day duration in What's Next View. 17Added date range for allday events of more than one day duration in What's Next View.
15Fixed two problems in the data importing from Outlook: 18Fixed two problems in the data importing from Outlook:
16 Fixed the duplicated import if the summary, location or description had whitespaces at the end. 19 Fixed the duplicated import if the summary, location or description had whitespaces at the end.
17 Fixed a problem importing certain recurrence rules. 20 Fixed a problem importing certain recurrence rules.
18 21
19A journal in an ics file may have no dtStart value (as files from KNotes, which stores its notes in an ics journal file). 22A journal in an ics file may have no dtStart value (as files from KNotes, which stores its notes in an ics journal file).
20If now a journal has no dtStart value the dtStart value is set to the created value of the journal when loading the file. That makes it possible to view and edit "notes" from KNotes. Simply add another Resource in KO/Pi which is a copy of the ics file from KNotes. You will find the "notes" in KO/Pi as a journal entry on the date you created it. 23If now a journal has no dtStart value the dtStart value is set to the created value of the journal when loading the file. That makes it possible to view and edit "notes" from KNotes. Simply add another Resource in KO/Pi which is a copy of the ics file from KNotes. You will find the "notes" in KO/Pi as a journal entry on the date you created it.
21 24
22And some minor fixes in KO/Pi. 25And some minor fixes in KO/Pi.
23 26
24Fixed a crash on the desktop when closing KO/Pi after accessing adressbook data (Linux + Windows ). 27Fixed a crash on the desktop when closing KO/Pi after accessing adressbook data (Linux + Windows ).
25 28
26 29
27********** VERSION 2.1.16 ************ 30********** VERSION 2.1.16 ************
28 31
29Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. 32Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus.
30Added columns for datetime in todo view: Last modified, created and last modified subtodo 33Added columns for datetime in todo view: Last modified, created and last modified subtodo
31Fixed a bug in agenda view displaying recurring multiday events which are longer than two days. 34Fixed a bug in agenda view displaying recurring multiday events which are longer than two days.
32Made conflict detection up to 4 times faster. 35Made conflict detection up to 4 times faster.
33 36
34********** VERSION 2.1.15 ************ 37********** VERSION 2.1.15 ************
35 38
36Fixed two layout problems on the Z: 39Fixed two layout problems on the Z:
37Made the with of the newly added buttons on the Quick-Todo smaller. 40Made the with of the newly added buttons on the Quick-Todo smaller.
38Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible. 41Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible.
39 42
40 43
41********** VERSION 2.1.14 ************ 44********** VERSION 2.1.14 ************
42 45
43Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done. 46Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done.
44Added a button to add a subtodo quickly. 47Added a button to add a subtodo quickly.
45 48
46Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). 49Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ).
47Added an option to change the layout of the list week to column mode. 50Added an option to change the layout of the list week to column mode.
48 51
49Fixed some usability problems in pi-sync mode by adding some progress information about file transfer. 52Fixed some usability problems in pi-sync mode by adding some progress information about file transfer.
50 53
51Fixed pi-sync problems with the new multi calendar feature. 54Fixed pi-sync problems with the new multi calendar feature.
52Now pi-sync behaviour should be: 55Now pi-sync behaviour should be:
531) Local sends file request ( as usual ) 561) Local sends file request ( as usual )
542) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars. 572) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars.
553) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ). 583) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ).
56 If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar. 59 If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar.
574) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote. 604) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote.
58 If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar. 61 If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar.
59 62
60Summary: 63Summary:
61No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner. 64No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner.
62If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour. 65If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour.
63Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars. 66Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars.
64 67
65********** VERSION 2.1.13 ************ 68********** VERSION 2.1.13 ************
66 69
67Fixed a problem in KA/Pi search. 70Fixed a problem in KA/Pi search.
68Fixed some minor problems in KO/Pi. 71Fixed some minor problems in KO/Pi.
69Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. 72Added calendar selection possibility to the todo view popup and to the event/todo/journal editor.
70 73
71Fixed memory usage problems in KA/Pi: 74Fixed memory usage problems in KA/Pi:
72When loading data KA/Pi did load the file data twice. 75When loading data KA/Pi did load the file data twice.
73Example: 76Example:
74 A 600k file did consume 1200k memory during loading process. 77 A 600k file did consume 1200k memory during loading process.
75 This is fixed, it does now consume only 600k during loading process. 78 This is fixed, it does now consume only 600k during loading process.
76When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. 79When saving data KA/Pi did consume a lot of memory for the data parsing during the save process.
77This is fixed. 80This is fixed.
78Example: 81Example:
79 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. 82 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram.
80 When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system. 83 When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system.
81 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. 84 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process.
82Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. 85Note: The memory usage of KA/Pi after the data is loaded/saved has not changed.
83The saving of data may be a bit slower now. 86The saving of data may be a bit slower now.
84 87
85Fixed memory usage problems in KO/Pi: 88Fixed memory usage problems in KO/Pi:
86When KO/Pi did save the data to file, it did not release the used buffers after saving. 89When KO/Pi did save the data to file, it did not release the used buffers after saving.
87The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. 90The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation.
88This is fixed. 91This is fixed.
89Example: 92Example:
90 When saving a 400k file KO/Pi do now use 400k less memory now. 93 When saving a 400k file KO/Pi do now use 400k less memory now.
91 94
92Optimized memory usage in KO/Pi Agenda view: 95Optimized memory usage in KO/Pi Agenda view:
93KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. 96KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view.
94These buffers were not made smaller (i.e. downsized) because of performance reasons. 97These buffers were not made smaller (i.e. downsized) because of performance reasons.
95The handling of these buffers are now much smarter: 98The handling of these buffers are now much smarter:
96Two (of six) buffers are removed completely. 99Two (of six) buffers are removed completely.
97The remaing four buffers are now downsized after not using the agenda view for 45 seconds. 100The remaing four buffers are now downsized after not using the agenda view for 45 seconds.
98Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi. 101Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi.
99 102
100Worst case example ( for a maximum size agenda content): 103Worst case example ( for a maximum size agenda content):
101 When resizing the agenda content to a large scale, KO/Pi did use 17Meg of mem ( and did not use less memory until it was stopped). Now KO/Pi is using on the same operation only 14.3 Meg of mem and after 45 seconds not using the agenda view it uses only 9.4 Meg of mem. 104 When resizing the agenda content to a large scale, KO/Pi did use 17Meg of mem ( and did not use less memory until it was stopped). Now KO/Pi is using on the same operation only 14.3 Meg of mem and after 45 seconds not using the agenda view it uses only 9.4 Meg of mem.
102 105
103When switching to an unused Agenda view now KO/Pi is upizing the buffers again. This takes less than a second. Such that switching to Agenda view (after not using it for more than 45 seconds) is now a bit slower. 106When switching to an unused Agenda view now KO/Pi is upizing the buffers again. This takes less than a second. Such that switching to Agenda view (after not using it for more than 45 seconds) is now a bit slower.
104 107
105Summary: 108Summary:
106Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus. 109Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus.
107 110
108********** VERSION 2.1.12 ************ 111********** VERSION 2.1.12 ************
109 112
110KO/Pi: 113KO/Pi:
111Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. 114Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus.
112Fixed a problem with the month view when file was saved but KO/Pi was not the active window. 115Fixed a problem with the month view when file was saved but KO/Pi was not the active window.
113Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). 116Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only).
114Fixed some other small problems. 117Fixed some other small problems.
115 118
116********** VERSION 2.1.11 ************ 119********** VERSION 2.1.11 ************
117 120
118KO/Pi: 121KO/Pi:
119Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. 122Because we can have many calendars now in KO/Pi we can have more than one journal entry per day.
120Added features to handle (and add ) more than one journal entry per day. 123Added features to handle (and add ) more than one journal entry per day.
121Added option for a journal title. 124Added option for a journal title.
122 125
123Added info about the calendar, the item belongs to, to the event/todo/journal viewer. 126Added info about the calendar, the item belongs to, to the event/todo/journal viewer.
124Fixed a problem of the alarm of completed recurring todos. 127Fixed a problem of the alarm of completed recurring todos.
125Added to the event/todo editor to set quickly the category of an item. 128Added to the event/todo editor to set quickly the category of an item.
126 129
127 130
128Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. 131Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet.
129 132
130Added KA/Pi multi sync to the multi sync called from the alarm applet. 133Added KA/Pi multi sync to the multi sync called from the alarm applet.
131 134
132********** VERSION 2.1.10 ************ 135********** VERSION 2.1.10 ************
133 136
134KO/Pi: 137KO/Pi:
135Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. 138Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file.
136When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. 139When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted.
137Fixed a bug in searching for a small timerange, i.e. one day. 140Fixed a bug in searching for a small timerange, i.e. one day.
138 141
139KA/Pi: 142KA/Pi:
140Fixed two problems in csv export. 143Fixed two problems in csv export.
141Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. 144Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi.
142 145
143********** VERSION 2.1.9 ************ 146********** VERSION 2.1.9 ************
144 147
145KO/Pi: 148KO/Pi:
146Fixed some problems of the new search options in the search dialog. 149Fixed some problems of the new search options in the search dialog.
147Fixed some problems in the new resource config options. 150Fixed some problems in the new resource config options.
148Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. 151Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page.
149Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: 152Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown:
150Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. 153Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup.
151 154
152Fixed a problem in recurrence range in syncing with DTM. 155Fixed a problem in recurrence range in syncing with DTM.
153 156
154KA/Pi: 157KA/Pi:
155Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) 158Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...)
156 159
157PwM/Pi: 160PwM/Pi:
158Added "sec" to the timeout config settings to make it clear the timeout values are seconds. 161Added "sec" to the timeout config settings to make it clear the timeout values are seconds.
159 162
160********** VERSION 2.1.8 ************ 163********** VERSION 2.1.8 ************
161 164
162KO/Pi: 165KO/Pi:
163Added info about the completion state of a todo in the ListView/Searchdialog. 166Added info about the completion state of a todo in the ListView/Searchdialog.
164If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. 167If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well.
165Fixed some updating problems when changing the filter. 168Fixed some updating problems when changing the filter.
166 169
167KA/Pi: 170KA/Pi:
168In the addressee selection dialog now the formatted name is shown, if not empty. 171In the addressee selection dialog now the formatted name is shown, if not empty.
169Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. 172Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category.
170Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. 173Now in the addressee selection dialog a selected contact is remove with a single click from the selected list.
171 174
172Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. 175Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
173Fixed the sorting for size in the file selector on the Z. 176Fixed the sorting for size in the file selector on the Z.
174 177
175Changed the color selection dialog on the Zaurus to a more user friendly version. 178Changed the color selection dialog on the Zaurus to a more user friendly version.
176 179
177********** VERSION 2.1.7 ************ 180********** VERSION 2.1.7 ************
178 181
179KO/Pi: 182KO/Pi:
180Fixed several problems in the new Resource handling. 183Fixed several problems in the new Resource handling.
181Added more options to the search dialog. 184Added more options to the search dialog.
182Fixed a problem in the Month view. 185Fixed a problem in the Month view.
183Added more options to the dialog when setting a todo to stopped. 186Added more options to the dialog when setting a todo to stopped.
184 187
185Fixed two small problems in KO/Pi Alarm applet. 188Fixed two small problems in KO/Pi Alarm applet.
186 189
187********** VERSION 2.1.6 ************ 190********** VERSION 2.1.6 ************
188 191
189This release is for testing only. 192This release is for testing only.
190 193
191KO/Pi: 194KO/Pi:
192Added to the list view (the list view is used in search dialog as well) the possibility to print it. 195Added to the list view (the list view is used in search dialog as well) the possibility to print it.
193Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. 196Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view.
194Added to the list view the possibility to add all subtodos of selected todos to an export/beam. 197Added to the list view the possibility to add all subtodos of selected todos to an export/beam.
195Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. 198Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout.
196Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. 199Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus.
197Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. 200Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly.
198 201
199Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. 202Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars.
200In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. 203In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later.
201Now on every sync the set of calendars is synced which are enabled in the resource view. 204Now on every sync the set of calendars is synced which are enabled in the resource view.
202 205
203A calendar is enabled in the resource view if the "eye" column is checked. 206A calendar is enabled in the resource view if the "eye" column is checked.
204You can set a calendar to be the default for new items( "+" column ). 207You can set a calendar to be the default for new items( "+" column ).
205You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. 208You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly.
206To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... 209To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ...
207 210
208 211
209********** VERSION 2.1.5 ************ 212********** VERSION 2.1.5 ************
210 213
211This is the new stable version. 214This is the new stable version.
212Bugfix: 215Bugfix:
213Fixed a problem with agenda popup on the desktop in KO/Pi. 216Fixed a problem with agenda popup on the desktop in KO/Pi.
214Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. 217Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization.
215Added config option to not display completed todos in agenda view. 218Added config option to not display completed todos in agenda view.
216Addressee view is now using the formatted name, if defined. 219Addressee view is now using the formatted name, if defined.
217That makes it possible to display "lastname, firstname" in that view now. 220That makes it possible to display "lastname, firstname" in that view now.
218To set the formatted name for all contacts, please use menu: 221To set the formatted name for all contacts, please use menu:
219Edit->Change->Set formatted name. 222Edit->Change->Set formatted name.
220Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. 223Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows.
221 224
222********** VERSION 2.1.4 ************ 225********** VERSION 2.1.4 ************
223 226
224Fixed two more bugs in the KA/Pi CSV import dialog: 227Fixed two more bugs in the KA/Pi CSV import dialog:
225Made it possible to read multi-line fields and import it to the "Note" field. 228Made it possible to read multi-line fields and import it to the "Note" field.
226Fixed a problem in mapping custom fields, whatever a custem field is... 229Fixed a problem in mapping custom fields, whatever a custem field is...
227 230
228********** VERSION 2.1.3 ************ 231********** VERSION 2.1.3 ************
229 232
230Changed the menu structure of the alarm applet: 233Changed the menu structure of the alarm applet:
231Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 234Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
232 235
233Fixed several problems in the KA/Pi CSV import dialog: 236Fixed several problems in the KA/Pi CSV import dialog:
234Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 237Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
235 238
236 239
237********** VERSION 2.1.2 ************ 240********** VERSION 2.1.2 ************
238 241
239Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 242Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
240 243
241Fixed a problem when importing data from Outlook with mutiple categories set. 244Fixed a problem when importing data from Outlook with mutiple categories set.
242 245
243Changed display of days in datenavigator: 246Changed display of days in datenavigator:
244Birthdays are now blue, not dark green. 247Birthdays are now blue, not dark green.
245When todo view is shown, no birtdays are shown and days with due todos are shown blue. 248When todo view is shown, no birtdays are shown and days with due todos are shown blue.
246When journal view is shown, only holidays are shown and days with journals are blue. 249When journal view is shown, only holidays are shown and days with journals are blue.
247 250
248Added Backup options to global config: 251Added Backup options to global config:
249You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). 252You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ).
250It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. 253It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again.
251The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. 254The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups.
252 255
253********** VERSION 2.1.1 ************ 256********** VERSION 2.1.1 ************
254 257
255Stable release 2.1.1! 258Stable release 2.1.1!
256 259
257KO/Pi: 260KO/Pi:
258Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 261Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
259 262
260********** VERSION 2.1.0 ************ 263********** VERSION 2.1.0 ************
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index f2ee0ab..2a75bfb 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1313,402 +1313,408 @@ void KServerSocket::error_connect( QString errmess )
1313 os.setEncoding( QTextStream::Latin1 ); 1313 os.setEncoding( QTextStream::Latin1 );
1314 os << errmess ; 1314 os << errmess ;
1315 mSocket->close(); 1315 mSocket->close();
1316 if ( mSocket->state() == QSocket::Idle ) { 1316 if ( mSocket->state() == QSocket::Idle ) {
1317 QTimer::singleShot( 0, this , SLOT ( discardClient())); 1317 QTimer::singleShot( 0, this , SLOT ( discardClient()));
1318 } 1318 }
1319} 1319}
1320void KServerSocket::end_connect() 1320void KServerSocket::end_connect()
1321{ 1321{
1322 delete mSyncActionDialog; 1322 delete mSyncActionDialog;
1323 mSyncActionDialog = 0; 1323 mSyncActionDialog = 0;
1324} 1324}
1325void KServerSocket::send_file() 1325void KServerSocket::send_file()
1326{ 1326{
1327 //qDebug("MainWindow::sendFile(QSocket* s) "); 1327 //qDebug("MainWindow::sendFile(QSocket* s) ");
1328 if ( mSyncActionDialog ) 1328 if ( mSyncActionDialog )
1329 delete mSyncActionDialog; 1329 delete mSyncActionDialog;
1330 mSyncActionDialog = new QDialog ( 0, "input-dialog", true ); 1330 mSyncActionDialog = new QDialog ( 0, "input-dialog", true );
1331 mSyncActionDialog->setCaption(i18n("Received sync request")); 1331 mSyncActionDialog->setCaption(i18n("Received sync request"));
1332 QLabel* label = new QLabel( i18n("Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog."), mSyncActionDialog ); 1332 QLabel* label = new QLabel( i18n("Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog."), mSyncActionDialog );
1333 label->setAlignment ( Qt::AlignHCenter ); 1333 label->setAlignment ( Qt::AlignHCenter );
1334 QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); 1334 QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog );
1335 lay->addWidget( label); 1335 lay->addWidget( label);
1336 lay->setMargin(7); 1336 lay->setMargin(7);
1337 lay->setSpacing(7); 1337 lay->setSpacing(7);
1338 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1338 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1339 int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent ); 1339 int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent );
1340 //secs = 333; 1340 //secs = 333;
1341 if ( secs < 0 ) 1341 if ( secs < 0 )
1342 secs = secs * (-1); 1342 secs = secs * (-1);
1343 if ( secs > 30 ) 1343 if ( secs > 30 )
1344 //if ( true ) 1344 //if ( true )
1345 { 1345 {
1346 QString warning = i18n("Clock skew of\nsyncing devices\nis %1 seconds!").arg( secs ); 1346 QString warning = i18n("Clock skew of\nsyncing devices\nis %1 seconds!").arg( secs );
1347 QLabel* label = new QLabel( warning, mSyncActionDialog ); 1347 QLabel* label = new QLabel( warning, mSyncActionDialog );
1348 label->setAlignment ( Qt::AlignHCenter ); 1348 label->setAlignment ( Qt::AlignHCenter );
1349 lay->addWidget( label); 1349 lay->addWidget( label);
1350 if ( secs > 180 ) 1350 if ( secs > 180 )
1351 { 1351 {
1352 if ( secs > 300 ) { 1352 if ( secs > 300 ) {
1353 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(0, i18n("The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!"), i18n("High clock skew!"),i18n("Synchronize!"))) { 1353 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(0, i18n("The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!"), i18n("High clock skew!"),i18n("Synchronize!"))) {
1354 qDebug("KSS::Sync cancelled ,cs"); 1354 qDebug("KSS::Sync cancelled ,cs");
1355 mErrorMessage = 0; 1355 mErrorMessage = 0;
1356 end_connect(); 1356 end_connect();
1357 error_connect("ERROR_CA\r\n\r\n"); 1357 error_connect("ERROR_CA\r\n\r\n");
1358 return ; 1358 return ;
1359 } 1359 }
1360 } 1360 }
1361 QFont f = label->font(); 1361 QFont f = label->font();
1362 f.setPointSize ( f.pointSize() *2 ); 1362 f.setPointSize ( f.pointSize() *2 );
1363 f. setBold (true ); 1363 f. setBold (true );
1364 QLabel* label = new QLabel( warning, mSyncActionDialog ); 1364 QLabel* label = new QLabel( warning, mSyncActionDialog );
1365 label->setFont( f ); 1365 label->setFont( f );
1366 warning = i18n("ADJUST\nYOUR\nCLOCKS!"); 1366 warning = i18n("ADJUST\nYOUR\nCLOCKS!");
1367 label->setText( warning ); 1367 label->setText( warning );
1368 label->setAlignment ( Qt::AlignHCenter ); 1368 label->setAlignment ( Qt::AlignHCenter );
1369 lay->addWidget( label); 1369 lay->addWidget( label);
1370 mSyncActionDialog->setFixedSize( 230, 300); 1370 mSyncActionDialog->setFixedSize( 230, 300);
1371 } else { 1371 } else {
1372 mSyncActionDialog->setFixedSize( 230, 200); 1372 mSyncActionDialog->setFixedSize( 230, 200);
1373 } 1373 }
1374 } else { 1374 } else {
1375 mSyncActionDialog->setFixedSize( 230, 120); 1375 mSyncActionDialog->setFixedSize( 230, 120);
1376 } 1376 }
1377 } else 1377 } else
1378 mSyncActionDialog->setFixedSize( 230, 120); 1378 mSyncActionDialog->setFixedSize( 230, 120);
1379 mSyncActionDialog->show(); 1379 mSyncActionDialog->show();
1380 mSyncActionDialog->raise(); 1380 mSyncActionDialog->raise();
1381 emit request_file(); 1381 emit request_file();
1382 qApp->processEvents(); 1382 qApp->processEvents();
1383 QString fileName = mFileName; 1383 QString fileName = mFileName;
1384 QFile file( fileName ); 1384 QFile file( fileName );
1385 if (!file.open( IO_ReadOnly ) ) { 1385 if (!file.open( IO_ReadOnly ) ) {
1386 mErrorMessage = 0; 1386 mErrorMessage = 0;
1387 end_connect(); 1387 end_connect();
1388 error_connect("ERROR_FI\r\n\r\n"); 1388 error_connect("ERROR_FI\r\n\r\n");
1389 return ; 1389 return ;
1390 } 1390 }
1391 mSyncActionDialog->setCaption( i18n("Sending file...") ); 1391 mSyncActionDialog->setCaption( i18n("Sending file...") );
1392 QTextStream ts( &file ); 1392 QTextStream ts( &file );
1393 ts.setEncoding( QTextStream::Latin1 ); 1393 ts.setEncoding( QTextStream::Latin1 );
1394 1394
1395 QTextStream os( mSocket ); 1395 QTextStream os( mSocket );
1396 os.setEncoding( QTextStream::Latin1 ); 1396 os.setEncoding( QTextStream::Latin1 );
1397 while ( ! ts.atEnd() ) { 1397 while ( ! ts.atEnd() ) {
1398 os << ts.readLine() << "\r\n"; 1398 os << ts.readLine() << "\r\n";
1399 } 1399 }
1400 os << "\r\n"; 1400 os << "\r\n";
1401 //os << ts.read(); 1401 //os << ts.read();
1402 file.close(); 1402 file.close();
1403 mSyncActionDialog->setCaption( i18n("Waiting for synced file...") ); 1403 mSyncActionDialog->setCaption( i18n("Waiting for synced file...") );
1404 mSocket->close(); 1404 mSocket->close();
1405 if ( mSocket->state() == QSocket::Idle ) 1405 if ( mSocket->state() == QSocket::Idle )
1406 QTimer::singleShot( 10, this , SLOT ( discardClient())); 1406 QTimer::singleShot( 10, this , SLOT ( discardClient()));
1407} 1407}
1408void KServerSocket::get_file() 1408void KServerSocket::get_file()
1409{ 1409{
1410 mSyncActionDialog->setCaption( i18n("Receiving synced file...") ); 1410 mSyncActionDialog->setCaption( i18n("Receiving synced file...") );
1411 1411
1412 piTime.start(); 1412 piTime.start();
1413 piFileString = ""; 1413 piFileString = "";
1414 QTimer::singleShot( 1, this , SLOT (readBackFileFromSocket( ) )); 1414 QTimer::singleShot( 1, this , SLOT (readBackFileFromSocket( ) ));
1415} 1415}
1416 1416
1417 1417
1418void KServerSocket::readBackFileFromSocket() 1418void KServerSocket::readBackFileFromSocket()
1419{ 1419{
1420 //qDebug("readBackFileFromSocket() %d ", piTime.elapsed ()); 1420 //qDebug("readBackFileFromSocket() %d ", piTime.elapsed ());
1421 while ( mSocket->canReadLine () ) { 1421 while ( mSocket->canReadLine () ) {
1422 piTime.restart(); 1422 piTime.restart();
1423 QString line = mSocket->readLine (); 1423 QString line = mSocket->readLine ();
1424 piFileString += line; 1424 piFileString += line;
1425 //qDebug("readline: %s ", line.latin1()); 1425 //qDebug("readline: %s ", line.latin1());
1426 mSyncActionDialog->setCaption( i18n("Received %1 bytes").arg( piFileString.length() ) ); 1426 mSyncActionDialog->setCaption( i18n("Received %1 bytes").arg( piFileString.length() ) );
1427 1427
1428 } 1428 }
1429 if ( piTime.elapsed () < 3000 ) { 1429 if ( piTime.elapsed () < 3000 ) {
1430 // wait for more 1430 // wait for more
1431 //qDebug("waitformore "); 1431 //qDebug("waitformore ");
1432 QTimer::singleShot( 100, this , SLOT (readBackFileFromSocket( ) )); 1432 QTimer::singleShot( 100, this , SLOT (readBackFileFromSocket( ) ));
1433 return; 1433 return;
1434 } 1434 }
1435 QString fileName = mFileName; 1435 QString fileName = mFileName;
1436 QFile file ( fileName ); 1436 QFile file ( fileName );
1437 if (!file.open( IO_WriteOnly ) ) { 1437 if (!file.open( IO_WriteOnly ) ) {
1438 delete mSyncActionDialog; 1438 delete mSyncActionDialog;
1439 mSyncActionDialog = 0; 1439 mSyncActionDialog = 0;
1440 qDebug("KSS:Error open read back file "); 1440 qDebug("KSS:Error open read back file ");
1441 piFileString = ""; 1441 piFileString = "";
1442 emit file_received( false ); 1442 emit file_received( false );
1443 blockRC = false; 1443 blockRC = false;
1444 return ; 1444 return ;
1445 1445
1446 } 1446 }
1447 1447
1448 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); 1448 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
1449 QTextStream ts ( &file ); 1449 QTextStream ts ( &file );
1450 ts.setEncoding( QTextStream::Latin1 ); 1450 ts.setEncoding( QTextStream::Latin1 );
1451 mSyncActionDialog->setCaption( i18n("Writing file to disk...") ); 1451 mSyncActionDialog->setCaption( i18n("Writing file to disk...") );
1452 ts << piFileString; 1452 ts << piFileString;
1453 mSocket->close(); 1453 mSocket->close();
1454 if ( mSocket->state() == QSocket::Idle ) 1454 if ( mSocket->state() == QSocket::Idle )
1455 QTimer::singleShot( 10, this , SLOT ( discardClient())); 1455 QTimer::singleShot( 10, this , SLOT ( discardClient()));
1456 file.close(); 1456 file.close();
1457 piFileString = ""; 1457 piFileString = "";
1458 emit file_received( true ); 1458 emit file_received( true );
1459 delete mSyncActionDialog; 1459 delete mSyncActionDialog;
1460 mSyncActionDialog = 0; 1460 mSyncActionDialog = 0;
1461 blockRC = false; 1461 blockRC = false;
1462 1462
1463} 1463}
1464 1464
1465KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent, QWidget * cap, const char * name ): QObject( parent, name ) 1465KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent, QWidget * cap, const char * name ): QObject( parent, name )
1466{ 1466{
1467 mPassWord = password; 1467 mPassWord = password;
1468 mSocket = 0; 1468 mSocket = 0;
1469 mFirst = false; 1469 mFirst = false;
1470 mFirstLine = true; 1470 mFirstLine = true;
1471 mPort = port; 1471 mPort = port;
1472 mHost = host; 1472 mHost = host;
1473 tlw = cap; 1473 tlw = cap;
1474 mRetVal = quiet; 1474 mRetVal = quiet;
1475 mTimerSocket = new QTimer ( this ); 1475 mTimerSocket = new QTimer ( this );
1476 connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( updateConnectDialog() ) ); 1476 connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( updateConnectDialog() ) );
1477 mConnectProgress.setCaption( i18n("Pi-Sync") ); 1477 mConnectProgress.setCaption( i18n("Pi-Sync") );
1478 connect( &mConnectProgress, SIGNAL ( cancelled () ), this, SLOT ( deleteSocket() ) ); 1478 connect( &mConnectProgress, SIGNAL ( cancelled () ), this, SLOT ( deleteSocket() ) );
1479 mConnectCount = -1; 1479 mConnectCount = -1;
1480} 1480}
1481void KCommandSocket::sendFileRequest() 1481void KCommandSocket::sendFileRequest()
1482{ 1482{
1483 if ( tlw ) 1483 if ( tlw )
1484 tlw->setCaption( i18n("Connected! Sending request for remote file ...") ); 1484 tlw->setCaption( i18n("Connected! Sending request for remote file ...") );
1485 mConnectProgress.hide(); 1485 mConnectProgress.hide();
1486 mConnectCount = 300;mConnectMax = 300; 1486 mConnectCount = 300;mConnectMax = 300;
1487 mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") ); 1487 mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") );
1488 mTimerSocket->start( 100, true ); 1488 mTimerSocket->start( 100, true );
1489 QTextStream os( mSocket ); 1489 QTextStream os( mSocket );
1490 os.setEncoding( QTextStream::Latin1 ); 1490 os.setEncoding( QTextStream::Latin1 );
1491 1491
1492 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); 1492 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate );
1493 os << "GET " << mPassWord << curDt <<"\r\n\r\n"; 1493 os << "GET " << mPassWord << curDt <<"\r\n\r\n";
1494} 1494}
1495 1495
1496void KCommandSocket::readFile( QString fn ) 1496void KCommandSocket::readFile( QString fn )
1497{ 1497{
1498 if ( !mSocket ) { 1498 if ( !mSocket ) {
1499 mSocket = new QSocket( this ); 1499 mSocket = new QSocket( this );
1500 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); 1500 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) );
1501 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1501 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1502 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() )); 1502 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() ));
1503 } 1503 }
1504 mFileString = ""; 1504 mFileString = "";
1505 mFileName = fn; 1505 mFileName = fn;
1506 mFirst = true; 1506 mFirst = true;
1507 if ( tlw ) 1507 if ( tlw )
1508 tlw->setCaption( i18n("Trying to connect to remote...") ); 1508 tlw->setCaption( i18n("Trying to connect to remote...") );
1509 mConnectCount = 30;mConnectMax = 30; 1509 mConnectCount = 30;mConnectMax = 30;
1510 mTimerSocket->start( 1000, true ); 1510 mTimerSocket->start( 1000, true );
1511 mSocket->connectToHost( mHost, mPort ); 1511 mSocket->connectToHost( mHost, mPort );
1512 qDebug("KSS: Waiting for connection"); 1512 qDebug("KSS: Waiting for connection");
1513} 1513}
1514void KCommandSocket::updateConnectDialog() 1514void KCommandSocket::updateConnectDialog()
1515{ 1515{
1516 1516
1517 if ( mConnectCount == mConnectMax ) { 1517 if ( mConnectCount == mConnectMax ) {
1518 //qDebug("MAXX %d", mConnectMax); 1518 //qDebug("MAXX %d", mConnectMax);
1519 mConnectProgress.setTotalSteps ( 30 ); 1519 mConnectProgress.setTotalSteps ( 30 );
1520 mConnectProgress.show(); 1520 mConnectProgress.show();
1521 mConnectProgress.setLabelText( i18n("Trying to connect to remote...") ); 1521 mConnectProgress.setLabelText( i18n("Trying to connect to remote...") );
1522 } 1522 }
1523 //qDebug("updateConnectDialog() %d", mConnectCount); 1523 //qDebug("updateConnectDialog() %d", mConnectCount);
1524 mConnectProgress.raise(); 1524 mConnectProgress.raise();
1525 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 ); 1525 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 );
1526 --mConnectCount; 1526 --mConnectCount;
1527 if ( mConnectCount > 0 ) 1527 if ( mConnectCount > 0 )
1528 mTimerSocket->start( 1000, true ); 1528 mTimerSocket->start( 1000, true );
1529 else 1529 else
1530 deleteSocket(); 1530 deleteSocket();
1531 1531
1532} 1532}
1533void KCommandSocket::writeFile( QString fileName ) 1533void KCommandSocket::writeFile( QString fileName )
1534{ 1534{
1535 if ( !mSocket ) { 1535 if ( !mSocket ) {
1536 mSocket = new QSocket( this ); 1536 mSocket = new QSocket( this );
1537 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1537 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1538 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) ); 1538 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) );
1539 } 1539 }
1540 mFileName = fileName ; 1540 mFileName = fileName ;
1541 mConnectCount = 30;mConnectMax = 30; 1541 mConnectCount = 30;mConnectMax = 30;
1542 mTimerSocket->start( 1000, true ); 1542 mTimerSocket->start( 1000, true );
1543 mSocket->connectToHost( mHost, mPort ); 1543 mSocket->connectToHost( mHost, mPort );
1544} 1544}
1545void KCommandSocket::writeFileToSocket() 1545void KCommandSocket::writeFileToSocket()
1546{ 1546{
1547 mTimerSocket->stop(); 1547 mTimerSocket->stop();
1548 QFile file2( mFileName ); 1548 QFile file2( mFileName );
1549 if (!file2.open( IO_ReadOnly ) ) { 1549 if (!file2.open( IO_ReadOnly ) ) {
1550 mConnectProgress.hide(); 1550 mConnectProgress.hide();
1551 mConnectCount = -1; 1551 mConnectCount = -1;
1552 mRetVal= errorW; 1552 mRetVal= errorW;
1553 mSocket->close(); 1553 mSocket->close();
1554 if ( mSocket->state() == QSocket::Idle ) 1554 if ( mSocket->state() == QSocket::Idle )
1555 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1555 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1556 return ; 1556 return ;
1557 } 1557 }
1558 mConnectProgress.setTotalSteps ( file2.size() ); 1558 mConnectProgress.setTotalSteps ( file2.size() );
1559 mConnectProgress.show(); 1559 mConnectProgress.show();
1560 int count = 0; 1560 int count = 0;
1561 mConnectProgress.setLabelText( i18n("Sending back synced file...") ); 1561 mConnectProgress.setLabelText( i18n("Sending back synced file...") );
1562 mConnectProgress.setProgress( count ); 1562 mConnectProgress.setProgress( count );
1563 mConnectProgress.blockSignals( true ); 1563 mConnectProgress.blockSignals( true );
1564 QTextStream ts2( &file2 ); 1564 QTextStream ts2( &file2 );
1565 ts2.setEncoding( QTextStream::Latin1 ); 1565 ts2.setEncoding( QTextStream::Latin1 );
1566 QTextStream os2( mSocket ); 1566 QTextStream os2( mSocket );
1567 os2.setEncoding( QTextStream::Latin1 ); 1567 os2.setEncoding( QTextStream::Latin1 );
1568 os2 << "PUT " << mPassWord << "\r\n\r\n";; 1568 os2 << "PUT " << mPassWord << "\r\n\r\n";;
1569 int byteCount = 0;
1570 int byteMax = file2.size()/53;
1569 while ( ! ts2.atEnd() ) { 1571 while ( ! ts2.atEnd() ) {
1570 qApp->processEvents(); 1572 qApp->processEvents();
1571 mConnectProgress.setProgress( count ); 1573 if ( byteCount > byteMax ) {
1574 byteCount = 0;
1575 mConnectProgress.setProgress( count );
1576 }
1572 QString temp = ts2.readLine(); 1577 QString temp = ts2.readLine();
1573 count += temp.length(); 1578 count += temp.length();
1579 byteCount += temp.length();
1574 os2 << temp << "\r\n"; 1580 os2 << temp << "\r\n";
1575 } 1581 }
1576 file2.close(); 1582 file2.close();
1577 mConnectProgress.hide(); 1583 mConnectProgress.hide();
1578 mConnectCount = -1; 1584 mConnectCount = -1;
1579 os2 << "\r\n"; 1585 os2 << "\r\n";
1580 mRetVal= successW; 1586 mRetVal= successW;
1581 mSocket->close(); 1587 mSocket->close();
1582 if ( mSocket->state() == QSocket::Idle ) 1588 if ( mSocket->state() == QSocket::Idle )
1583 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1589 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1584 mConnectProgress.blockSignals( false ); 1590 mConnectProgress.blockSignals( false );
1585} 1591}
1586void KCommandSocket::sendStop() 1592void KCommandSocket::sendStop()
1587{ 1593{
1588 if ( !mSocket ) { 1594 if ( !mSocket ) {
1589 mSocket = new QSocket( this ); 1595 mSocket = new QSocket( this );
1590 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1596 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1591 } 1597 }
1592 mSocket->connectToHost( mHost, mPort ); 1598 mSocket->connectToHost( mHost, mPort );
1593 QTextStream os2( mSocket ); 1599 QTextStream os2( mSocket );
1594 os2.setEncoding( QTextStream::Latin1 ); 1600 os2.setEncoding( QTextStream::Latin1 );
1595 os2 << "STOP\r\n\r\n"; 1601 os2 << "STOP\r\n\r\n";
1596 mSocket->close(); 1602 mSocket->close();
1597 if ( mSocket->state() == QSocket::Idle ) 1603 if ( mSocket->state() == QSocket::Idle )
1598 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1604 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1599} 1605}
1600 1606
1601void KCommandSocket::startReadFileFromSocket() 1607void KCommandSocket::startReadFileFromSocket()
1602{ 1608{
1603 if ( ! mFirst ) 1609 if ( ! mFirst )
1604 return; 1610 return;
1605 mConnectProgress.setLabelText( i18n("Receiving file from remote...") ); 1611 mConnectProgress.setLabelText( i18n("Receiving file from remote...") );
1606 mFirst = false; 1612 mFirst = false;
1607 mFileString = ""; 1613 mFileString = "";
1608 mTime.start(); 1614 mTime.start();
1609 mFirstLine = true; 1615 mFirstLine = true;
1610 QTimer::singleShot( 1, this , SLOT (readFileFromSocket( ) )); 1616 QTimer::singleShot( 1, this , SLOT (readFileFromSocket( ) ));
1611 1617
1612} 1618}
1613void KCommandSocket::readFileFromSocket() 1619void KCommandSocket::readFileFromSocket()
1614{ 1620{
1615 //qDebug("readBackFileFromSocket() %d ", mTime.elapsed ()); 1621 //qDebug("readBackFileFromSocket() %d ", mTime.elapsed ());
1616 while ( mSocket->canReadLine () ) { 1622 while ( mSocket->canReadLine () ) {
1617 mTime.restart(); 1623 mTime.restart();
1618 QString line = mSocket->readLine (); 1624 QString line = mSocket->readLine ();
1619 if ( mFirstLine ) { 1625 if ( mFirstLine ) {
1620 mFirstLine = false; 1626 mFirstLine = false;
1621 if ( line.left( 6 ) == "ERROR_" ) { 1627 if ( line.left( 6 ) == "ERROR_" ) {
1622 mTimerSocket->stop(); 1628 mTimerSocket->stop();
1623 mConnectCount = -1; 1629 mConnectCount = -1;
1624 if ( line.left( 8 ) == "ERROR_PW" ) { 1630 if ( line.left( 8 ) == "ERROR_PW" ) {
1625 mRetVal = errorPW; 1631 mRetVal = errorPW;
1626 deleteSocket(); 1632 deleteSocket();
1627 return ; 1633 return ;
1628 } 1634 }
1629 if ( line.left( 8 ) == "ERROR_CA" ) { 1635 if ( line.left( 8 ) == "ERROR_CA" ) {
1630 mRetVal = errorCA; 1636 mRetVal = errorCA;
1631 deleteSocket(); 1637 deleteSocket();
1632 return ; 1638 return ;
1633 } 1639 }
1634 if ( line.left( 8 ) == "ERROR_FI" ) { 1640 if ( line.left( 8 ) == "ERROR_FI" ) {
1635 mRetVal = errorFI; 1641 mRetVal = errorFI;
1636 deleteSocket(); 1642 deleteSocket();
1637 return ; 1643 return ;
1638 } 1644 }
1639 if ( line.left( 8 ) == "ERROR_ED" ) { 1645 if ( line.left( 8 ) == "ERROR_ED" ) {
1640 mRetVal = errorED; 1646 mRetVal = errorED;
1641 deleteSocket(); 1647 deleteSocket();
1642 return ; 1648 return ;
1643 } 1649 }
1644 mRetVal = errorUN; 1650 mRetVal = errorUN;
1645 deleteSocket(); 1651 deleteSocket();
1646 return ; 1652 return ;
1647 } 1653 }
1648 } 1654 }
1649 mFileString += line; 1655 mFileString += line;
1650 //qDebug("readline: %s ", line.latin1()); 1656 //qDebug("readline: %s ", line.latin1());
1651 } 1657 }
1652 if ( mTime.elapsed () < 3000 ) { 1658 if ( mTime.elapsed () < 3000 ) {
1653 // wait for more 1659 // wait for more
1654 //qDebug("waitformore "); 1660 //qDebug("waitformore ");
1655 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) )); 1661 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) ));
1656 return; 1662 return;
1657 } 1663 }
1658 mTimerSocket->stop(); 1664 mTimerSocket->stop();
1659 mConnectCount = -1; 1665 mConnectCount = -1;
1660 mConnectProgress.hide(); 1666 mConnectProgress.hide();
1661 QString fileName = mFileName; 1667 QString fileName = mFileName;
1662 QFile file ( fileName ); 1668 QFile file ( fileName );
1663 if (!file.open( IO_WriteOnly ) ) { 1669 if (!file.open( IO_WriteOnly ) ) {
1664 mFileString = ""; 1670 mFileString = "";
1665 mRetVal = errorR; 1671 mRetVal = errorR;
1666 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() ); 1672 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() );
1667 deleteSocket(); 1673 deleteSocket();
1668 return ; 1674 return ;
1669 1675
1670 } 1676 }
1671 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); 1677 // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
1672 QTextStream ts ( &file ); 1678 QTextStream ts ( &file );
1673 ts.setEncoding( QTextStream::Latin1 ); 1679 ts.setEncoding( QTextStream::Latin1 );
1674 ts << mFileString; 1680 ts << mFileString;
1675 file.close(); 1681 file.close();
1676 mFileString = ""; 1682 mFileString = "";
1677 mRetVal = successR; 1683 mRetVal = successR;
1678 mSocket->close(); 1684 mSocket->close();
1679 // if state is not idle, deleteSocket(); is called via 1685 // if state is not idle, deleteSocket(); is called via
1680 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1686 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1681 if ( mSocket->state() == QSocket::Idle ) 1687 if ( mSocket->state() == QSocket::Idle )
1682 deleteSocket(); 1688 deleteSocket();
1683} 1689}
1684 1690
1685void KCommandSocket::deleteSocket() 1691void KCommandSocket::deleteSocket()
1686{ 1692{
1687 //qDebug("KCommandSocket::deleteSocket() "); 1693 //qDebug("KCommandSocket::deleteSocket() ");
1688 mConnectProgress.hide(); 1694 mConnectProgress.hide();
1689 1695
1690 if ( mConnectCount >= 0 ) { 1696 if ( mConnectCount >= 0 ) {
1691 mTimerSocket->stop(); 1697 mTimerSocket->stop();
1692 mRetVal = errorTO; 1698 mRetVal = errorTO;
1693 qDebug("KCS::Connection to remote host timed out"); 1699 qDebug("KCS::Connection to remote host timed out");
1694 if ( mSocket ) { 1700 if ( mSocket ) {
1695 mSocket->close(); 1701 mSocket->close();
1696 //if ( mSocket->state() == QSocket::Idle ) 1702 //if ( mSocket->state() == QSocket::Idle )
1697 // deleteSocket(); 1703 // deleteSocket();
1698 delete mSocket; 1704 delete mSocket;
1699 mSocket = 0; 1705 mSocket = 0;
1700 } 1706 }
1701 if ( mConnectCount == 0 ) 1707 if ( mConnectCount == 0 )
1702 KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?")); 1708 KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?"));
1703 else if ( tlw ) 1709 else if ( tlw )
1704 tlw->setCaption( i18n("Connection to remote host cancelled!") ); 1710 tlw->setCaption( i18n("Connection to remote host cancelled!") );
1705 emit commandFinished( this, mRetVal ); 1711 emit commandFinished( this, mRetVal );
1706 return; 1712 return;
1707 } 1713 }
1708 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal ); 1714 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal );
1709 if ( mSocket) 1715 if ( mSocket)
1710 delete mSocket; 1716 delete mSocket;
1711 mSocket = 0; 1717 mSocket = 0;
1712 qDebug("commandFinished "); 1718 qDebug("commandFinished ");
1713 emit commandFinished( this, mRetVal ); 1719 emit commandFinished( this, mRetVal );
1714} 1720}