summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt22
-rw-r--r--kmicromail/libetpan/maildir/maildir.c25
-rw-r--r--kmicromail/libetpan/mh/mailmh.c12
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/kotodoview.cpp1
-rw-r--r--korganizer/kotodoviewitem.cpp2
-rw-r--r--libkcal/sharpformat.cpp5
-rw-r--r--version2
8 files changed, 59 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 4905631..eb7cf13 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,26 +1,48 @@
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 1.9.14 ************
4
5Fixed some problems with the dialog sizes when switching
6portrait/landscape mode on 640x480 PDA display.
7
8Fixed some other small bugs.
9
10Fixed an ugly bug in KOpieMail:
11KOpieMail was not able to write files (mails) to MSDOS file system,
12like on an usual preformatted SD card. That should work now.
13To save your mail data on the Sd card do the following:
14Create a dir on the SD card:
15mkdir /mnt/card/localmail
16Go to your home dir:
17cd
18Go to kopiemail data storage dir:
19cd kdepim/apps/kopiemail
20Create a symlink to the SD card:
21ls -s /mnt/card/localmail
22Now KOpieMail will store all mails on the SD card.
23
24
3********** VERSION 1.9.13 ************ 25********** VERSION 1.9.13 ************
4 26
5Fixed nasty PwM/Pi file reading bug, when 27Fixed nasty PwM/Pi file reading bug, when
6the used hash algo of file is different then the global 28the used hash algo of file is different then the global
7hash algo. 29hash algo.
8 30
9Added KA/Pi support for opie mailit mailapplication. 31Added KA/Pi support for opie mailit mailapplication.
10 32
11Fixed some bugs in OM/Pi. 33Fixed some bugs in OM/Pi.
12Now character conversion tables are available for the Zaurus 34Now character conversion tables are available for the Zaurus
13to make OM/Pi working properly. 35to make OM/Pi working properly.
14To get the character conversion in OM/Pi working, please download 36To get the character conversion in OM/Pi working, please download
15at the sourceforge project site the package 37at the sourceforge project site the package
16sr-character-conversion_SharpROM_arm.ipk.zip 38sr-character-conversion_SharpROM_arm.ipk.zip
17(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 39(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
18from the section "general files for KDE/Pim" 40from the section "general files for KDE/Pim"
19Instructions how to install this package are in a ReadMe in this file. 41Instructions how to install this package are in a ReadMe in this file.
20 42
21 43
22Fixed the orientation change problem in KA/Pi when switching 44Fixed the orientation change problem in KA/Pi when switching
23portrait/landscape mode. 45portrait/landscape mode.
24 46
25French translation available for KA/Pi and OM/Pi. 47French translation available for KA/Pi and OM/Pi.
26 48
diff --git a/kmicromail/libetpan/maildir/maildir.c b/kmicromail/libetpan/maildir/maildir.c
index 0e038b1..1ef0b7a 100644
--- a/kmicromail/libetpan/maildir/maildir.c
+++ b/kmicromail/libetpan/maildir/maildir.c
@@ -87,67 +87,72 @@ struct maildir * maildir_new(const char * path)
87 err: 87 err:
88 return NULL; 88 return NULL;
89} 89}
90 90
91static void maildir_flush(struct maildir * md, int msg_new); 91static void maildir_flush(struct maildir * md, int msg_new);
92 92
93void maildir_free(struct maildir * md) 93void maildir_free(struct maildir * md)
94{ 94{
95 maildir_flush(md, 0); 95 maildir_flush(md, 0);
96 maildir_flush(md, 1); 96 maildir_flush(md, 1);
97 chash_free(md->mdir_msg_hash); 97 chash_free(md->mdir_msg_hash);
98 carray_free(md->mdir_msg_list); 98 carray_free(md->mdir_msg_list);
99 free(md); 99 free(md);
100} 100}
101 101
102#define MAX_TRY_ALLOC 32 102#define MAX_TRY_ALLOC 32
103 103
104static char * maildir_get_new_message_filename(struct maildir * md, 104static char * maildir_get_new_message_filename(struct maildir * md,
105 char * tmpfile) 105 char * tmpfile)
106{ 106{
107 char filename[PATH_MAX]; 107 char filename[PATH_MAX];
108 char basename[PATH_MAX]; 108 char basename[PATH_MAX];
109 int k; 109 int k;
110 time_t now; 110 time_t now;
111 111 struct stat f_stat;
112 now = time(NULL); 112 now = time(NULL);
113 k = 0; 113 k = 0;
114
115 fprintf(stderr,"maildir_get_new_message_filename: %s \n", tmpfile);
114 while (k < MAX_TRY_ALLOC) { 116 while (k < MAX_TRY_ALLOC) {
115 snprintf(basename, sizeof(basename), "%lu.%u_%u.%s", 117 snprintf(basename, sizeof(basename), "%lu.%u_%u.%s",
116 (unsigned long) now, md->mdir_pid, md->mdir_counter, md->mdir_hostname); 118 (unsigned long) now, md->mdir_pid, md->mdir_counter, md->mdir_hostname);
117 snprintf(filename, sizeof(filename), "%s/tmp/%s", 119 snprintf(filename, sizeof(filename), "%s/tmp/%s",
118 md->mdir_path, basename); 120 md->mdir_path, basename);
119 121 fprintf(stderr,"filename %s \n", filename);
120 if (link(tmpfile, filename) == 0) { 122 // LR changed following lines
123 if ( stat( filename, &f_stat ) == -1 ) {
124 //if (link(tmpfile, filename) == 0) {
121 char * dup_filename; 125 char * dup_filename;
122 126
123 dup_filename = strdup(filename); 127 dup_filename = strdup(filename);
124 if (dup_filename == NULL) { 128 if (dup_filename == NULL) {
125 unlink(filename); 129 //unlink(filename);
126 return NULL; 130 return NULL;
127 } 131 }
128 132 fprintf(stderr,"filename %s %s \n", tmpfile,dup_filename);
129 unlink(tmpfile); 133 //unlink(tmpfile);
134 rename (tmpfile,dup_filename );
130 md->mdir_counter ++; 135 md->mdir_counter ++;
131 136
132 return dup_filename; 137 return dup_filename;
133 } 138 }
134 139
135 md->mdir_counter ++; 140 md->mdir_counter ++;
136 k ++; 141 k ++;
137 } 142 }
138 143
139 return NULL; 144 return NULL;
140} 145}
141 146
142 147
143static void msg_free(struct maildir_msg * msg) 148static void msg_free(struct maildir_msg * msg)
144{ 149{
145 free(msg->msg_uid); 150 free(msg->msg_uid);
146 free(msg->msg_filename); 151 free(msg->msg_filename);
147 free(msg); 152 free(msg);
148} 153}
149 154
150/* 155/*
151 msg_new() 156 msg_new()
152 157
153 filename is given without path 158 filename is given without path
@@ -251,48 +256,49 @@ static void maildir_flush(struct maildir * md, int msg_new)
251 256
252 key.data = msg->msg_uid; 257 key.data = msg->msg_uid;
253 key.len = strlen(msg->msg_uid); 258 key.len = strlen(msg->msg_uid);
254 chash_delete(md->mdir_msg_hash, &key, NULL); 259 chash_delete(md->mdir_msg_hash, &key, NULL);
255 260
256 carray_delete(md->mdir_msg_list, i); 261 carray_delete(md->mdir_msg_list, i);
257 msg_free(msg); 262 msg_free(msg);
258 } 263 }
259 else { 264 else {
260 i ++; 265 i ++;
261 } 266 }
262 } 267 }
263} 268}
264 269
265static int add_message(struct maildir * md, 270static int add_message(struct maildir * md,
266 char * filename, int is_new) 271 char * filename, int is_new)
267{ 272{
268 struct maildir_msg * msg; 273 struct maildir_msg * msg;
269 chashdatum key; 274 chashdatum key;
270 chashdatum value; 275 chashdatum value;
271 unsigned int i; 276 unsigned int i;
272 int res; 277 int res;
273 int r; 278 int r;
274 279
280 fprintf(stderr,"add_message filename: %s \n", filename);
275 msg = msg_new(filename, is_new); 281 msg = msg_new(filename, is_new);
276 if (msg == NULL) { 282 if (msg == NULL) {
277 res = MAILDIR_ERROR_MEMORY; 283 res = MAILDIR_ERROR_MEMORY;
278 goto err; 284 goto err;
279 } 285 }
280 286
281 r = carray_add(md->mdir_msg_list, msg, &i); 287 r = carray_add(md->mdir_msg_list, msg, &i);
282 if (r < 0) { 288 if (r < 0) {
283 res = MAILDIR_ERROR_MEMORY; 289 res = MAILDIR_ERROR_MEMORY;
284 goto free_msg; 290 goto free_msg;
285 } 291 }
286 292
287 key.data = msg->msg_uid; 293 key.data = msg->msg_uid;
288 key.len = strlen(msg->msg_uid); 294 key.len = strlen(msg->msg_uid);
289 value.data = msg; 295 value.data = msg;
290 value.len = 0; 296 value.len = 0;
291 297
292 r = chash_set(md->mdir_msg_hash, &key, &value, NULL); 298 r = chash_set(md->mdir_msg_hash, &key, &value, NULL);
293 if (r < 0) { 299 if (r < 0) {
294 res = MAILDIR_ERROR_MEMORY; 300 res = MAILDIR_ERROR_MEMORY;
295 goto delete; 301 goto delete;
296 } 302 }
297 303
298 return MAILDIR_NO_ERROR; 304 return MAILDIR_NO_ERROR;
@@ -425,48 +431,49 @@ static char * libetpan_basename(char * filename)
425 return filename; 431 return filename;
426 else 432 else
427 return p + 1; 433 return p + 1;
428} 434}
429#else 435#else
430#define libetpan_basename(a) basename(a) 436#define libetpan_basename(a) basename(a)
431#endif 437#endif
432 438
433int maildir_message_add_uid(struct maildir * md, 439int maildir_message_add_uid(struct maildir * md,
434 const char * message, size_t size, 440 const char * message, size_t size,
435 char * uid, size_t max_uid_len) 441 char * uid, size_t max_uid_len)
436{ 442{
437 char path_new[PATH_MAX]; 443 char path_new[PATH_MAX];
438 char tmpname[PATH_MAX]; 444 char tmpname[PATH_MAX];
439 int fd; 445 int fd;
440 int r; 446 int r;
441 char * mapping; 447 char * mapping;
442 char * delivery_tmp_name; 448 char * delivery_tmp_name;
443 char * delivery_tmp_basename; 449 char * delivery_tmp_basename;
444 char delivery_new_name[PATH_MAX]; 450 char delivery_new_name[PATH_MAX];
445 char * delivery_new_basename; 451 char * delivery_new_basename;
446 int res; 452 int res;
447 struct stat stat_info; 453 struct stat stat_info;
448 454
455 fprintf(stderr,"maildir_message_add_uid for uid: %s \n", uid);
449 r = maildir_update(md); 456 r = maildir_update(md);
450 if (r != MAILDIR_NO_ERROR) { 457 if (r != MAILDIR_NO_ERROR) {
451 res = r; 458 res = r;
452 goto err; 459 goto err;
453 } 460 }
454 461
455 /* write to tmp/ with a classic temporary file */ 462 /* write to tmp/ with a classic temporary file */
456 463
457 snprintf(tmpname, sizeof(tmpname), "%s/tmp/etpan-maildir-XXXXXX", 464 snprintf(tmpname, sizeof(tmpname), "%s/tmp/etpan-maildir-XXXXXX",
458 md->mdir_path); 465 md->mdir_path);
459 fd = mkstemp(tmpname); 466 fd = mkstemp(tmpname);
460 if (fd < 0) { 467 if (fd < 0) {
461 res = MAILDIR_ERROR_FILE; 468 res = MAILDIR_ERROR_FILE;
462 goto err; 469 goto err;
463 } 470 }
464 471
465 r = ftruncate(fd, size); 472 r = ftruncate(fd, size);
466 if (r < 0) { 473 if (r < 0) {
467 res = MAILDIR_ERROR_FILE; 474 res = MAILDIR_ERROR_FILE;
468 goto close; 475 goto close;
469 } 476 }
470 477
471 mapping = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 478 mapping = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
472 if (mapping == MAP_FAILED) { 479 if (mapping == MAP_FAILED) {
@@ -537,153 +544,157 @@ int maildir_message_add_uid(struct maildir * md,
537 free(delivery_tmp_name); 544 free(delivery_tmp_name);
538 goto err; 545 goto err;
539 close: 546 close:
540 close(fd); 547 close(fd);
541 unlink: 548 unlink:
542 unlink(tmpname); 549 unlink(tmpname);
543 err: 550 err:
544 return res; 551 return res;
545} 552}
546 553
547int maildir_message_add(struct maildir * md, 554int maildir_message_add(struct maildir * md,
548 const char * message, size_t size) 555 const char * message, size_t size)
549{ 556{
550 return maildir_message_add_uid(md, message, size, 557 return maildir_message_add_uid(md, message, size,
551 NULL, 0); 558 NULL, 0);
552} 559}
553 560
554int maildir_message_add_file_uid(struct maildir * md, int fd, 561int maildir_message_add_file_uid(struct maildir * md, int fd,
555 char * uid, size_t max_uid_len) 562 char * uid, size_t max_uid_len)
556{ 563{
557 char * message; 564 char * message;
558 struct stat buf; 565 struct stat buf;
559 int r; 566 int r;
560 567
568 fprintf(stderr,"maildir_message_add_file_uid: %s \n", uid);
561 if (fstat(fd, &buf) == -1) 569 if (fstat(fd, &buf) == -1)
562 return MAILDIR_ERROR_FILE; 570 return MAILDIR_ERROR_FILE;
563 571
564 message = mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 572 message = mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
565 if (message == MAP_FAILED) 573 if (message == MAP_FAILED)
566 return MAILDIR_ERROR_FILE; 574 return MAILDIR_ERROR_FILE;
567 575
568 r = maildir_message_add_uid(md, message, buf.st_size, uid, max_uid_len); 576 r = maildir_message_add_uid(md, message, buf.st_size, uid, max_uid_len);
569 577
570 munmap(message, buf.st_size); 578 munmap(message, buf.st_size);
571 579
572 return r; 580 return r;
573} 581}
574 582
575int maildir_message_add_file(struct maildir * md, int fd) 583int maildir_message_add_file(struct maildir * md, int fd)
576{ 584{
585 fprintf(stderr,"maildir_message_add_file \n");
577 return maildir_message_add_file_uid(md, fd, 586 return maildir_message_add_file_uid(md, fd,
578 NULL, 0); 587 NULL, 0);
579} 588}
580 589
581char * maildir_message_get(struct maildir * md, const char * uid) 590char * maildir_message_get(struct maildir * md, const char * uid)
582{ 591{
583 chashdatum key; 592 chashdatum key;
584 chashdatum value; 593 chashdatum value;
585 char filename[PATH_MAX]; 594 char filename[PATH_MAX];
586 char * dup_filename; 595 char * dup_filename;
587 struct maildir_msg * msg; 596 struct maildir_msg * msg;
588 char * dir; 597 char * dir;
589 int r; 598 int r;
590 599
600 fprintf(stderr,"maildir_message_get for uid: %s \n", uid);
591 key.data = (void *) uid; 601 key.data = (void *) uid;
592 key.len = strlen(uid); 602 key.len = strlen(uid);
593 r = chash_get(md->mdir_msg_hash, &key, &value); 603 r = chash_get(md->mdir_msg_hash, &key, &value);
594 if (r < 0) 604 if (r < 0)
595 return NULL; 605 return NULL;
596 606
597 msg = value.data; 607 msg = value.data;
598 if ((msg->msg_flags & MAILDIR_FLAG_NEW) != 0) 608 if ((msg->msg_flags & MAILDIR_FLAG_NEW) != 0)
599 dir = "new"; 609 dir = "new";
600 else 610 else
601 dir = "cur"; 611 dir = "cur";
602 612
603 snprintf(filename, sizeof(filename), "%s/%s/%s", 613 snprintf(filename, sizeof(filename), "%s/%s/%s",
604 md->mdir_path, dir, msg->msg_filename); 614 md->mdir_path, dir, msg->msg_filename);
605 615
606 dup_filename = strdup(filename); 616 dup_filename = strdup(filename);
607 if (dup_filename == NULL) 617 if (dup_filename == NULL)
608 return NULL; 618 return NULL;
609 619
610 return dup_filename; 620 return dup_filename;
611} 621}
612 622
613int maildir_message_remove(struct maildir * md, const char * uid) 623int maildir_message_remove(struct maildir * md, const char * uid)
614{ 624{
615 chashdatum key; 625 chashdatum key;
616 chashdatum value; 626 chashdatum value;
617 char filename[PATH_MAX]; 627 char filename[PATH_MAX];
618 struct maildir_msg * msg; 628 struct maildir_msg * msg;
619 char * dir; 629 char * dir;
620 int r; 630 int r;
621 int res; 631 int res;
622 632
633 fprintf(stderr,"maildir_message_remove for uid: %s \n", uid);
623 key.data = (void *) uid; 634 key.data = (void *) uid;
624 key.len = strlen(uid); 635 key.len = strlen(uid);
625 r = chash_get(md->mdir_msg_hash, &key, &value); 636 r = chash_get(md->mdir_msg_hash, &key, &value);
626 if (r < 0) { 637 if (r < 0) {
627 res = MAILDIR_ERROR_NOT_FOUND; 638 res = MAILDIR_ERROR_NOT_FOUND;
628 goto err; 639 goto err;
629 } 640 }
630 641
631 msg = value.data; 642 msg = value.data;
632 if ((msg->msg_flags & MAILDIR_FLAG_NEW) != 0) 643 if ((msg->msg_flags & MAILDIR_FLAG_NEW) != 0)
633 dir = "new"; 644 dir = "new";
634 else 645 else
635 dir = "cur"; 646 dir = "cur";
636 647
637 snprintf(filename, sizeof(filename), "%s/%s/%s", 648 snprintf(filename, sizeof(filename), "%s/%s/%s",
638 md->mdir_path, dir, msg->msg_filename); 649 md->mdir_path, dir, msg->msg_filename);
639 650
640 r = unlink(filename); 651 r = unlink(filename);
641 if (r < 0) { 652 if (r < 0) {
642 res = MAILDIR_ERROR_FILE; 653 res = MAILDIR_ERROR_FILE;
643 goto err; 654 goto err;
644 } 655 }
645 656
646 return MAILDIR_NO_ERROR; 657 return MAILDIR_NO_ERROR;
647 658
648 err: 659 err:
649 return res; 660 return res;
650} 661}
651 662
652int maildir_message_change_flags(struct maildir * md, 663int maildir_message_change_flags(struct maildir * md,
653 const char * uid, int new_flags) 664 const char * uid, int new_flags)
654{ 665{
655 chashdatum key; 666 chashdatum key;
656 chashdatum value; 667 chashdatum value;
657 char filename[PATH_MAX]; 668 char filename[PATH_MAX];
658 struct maildir_msg * msg; 669 struct maildir_msg * msg;
659 char * dir; 670 char * dir;
660 int r; 671 int r;
661 char new_filename[PATH_MAX]; 672 char new_filename[PATH_MAX];
662 char flag_str[5]; 673 char flag_str[5];
663 size_t i; 674 size_t i;
664 int res; 675 int res;
665 676 fprintf(stderr,"maildir_message_change_flags for uid: %s \n", uid);
666 key.data = (void *) uid; 677 key.data = (void *) uid;
667 key.len = strlen(uid); 678 key.len = strlen(uid);
668 r = chash_get(md->mdir_msg_hash, &key, &value); 679 r = chash_get(md->mdir_msg_hash, &key, &value);
669 if (r < 0) { 680 if (r < 0) {
670 res = MAILDIR_ERROR_NOT_FOUND; 681 res = MAILDIR_ERROR_NOT_FOUND;
671 goto err; 682 goto err;
672 } 683 }
673 684
674 msg = value.data; 685 msg = value.data;
675 if ((msg->msg_flags & MAILDIR_FLAG_NEW) != 0) 686 if ((msg->msg_flags & MAILDIR_FLAG_NEW) != 0)
676 dir = "new"; 687 dir = "new";
677 else 688 else
678 dir = "cur"; 689 dir = "cur";
679 690
680 snprintf(filename, sizeof(filename), "%s/%s/%s", 691 snprintf(filename, sizeof(filename), "%s/%s/%s",
681 md->mdir_path, dir, msg->msg_filename); 692 md->mdir_path, dir, msg->msg_filename);
682 693
683 if ((new_flags & MAILDIR_FLAG_NEW) != 0) 694 if ((new_flags & MAILDIR_FLAG_NEW) != 0)
684 dir = "new"; 695 dir = "new";
685 else 696 else
686 dir = "cur"; 697 dir = "cur";
687 698
688 i = 0; 699 i = 0;
689 if ((new_flags & MAILDIR_FLAG_SEEN) != 0) { 700 if ((new_flags & MAILDIR_FLAG_SEEN) != 0) {
diff --git a/kmicromail/libetpan/mh/mailmh.c b/kmicromail/libetpan/mh/mailmh.c
index 119f217..5e2b4cc 100644
--- a/kmicromail/libetpan/mh/mailmh.c
+++ b/kmicromail/libetpan/mh/mailmh.c
@@ -586,66 +586,70 @@ int mailmh_folder_rename_subfolder(struct mailmh_folder * src_folder,
586 folder = mailmh_folder_new(dst_folder, new_name); 586 folder = mailmh_folder_new(dst_folder, new_name);
587 if (folder == NULL) 587 if (folder == NULL)
588 return MAILMH_ERROR_MEMORY; 588 return MAILMH_ERROR_MEMORY;
589 589
590 r = carray_add(parent->fl_subfolders_tab, folder, NULL); 590 r = carray_add(parent->fl_subfolders_tab, folder, NULL);
591 if (r < 0) { 591 if (r < 0) {
592 mailmh_folder_free(folder); 592 mailmh_folder_free(folder);
593 return MAILMH_ERROR_MEMORY; 593 return MAILMH_ERROR_MEMORY;
594 } 594 }
595 595
596 return MAILMH_NO_ERROR; 596 return MAILMH_NO_ERROR;
597} 597}
598 598
599#define MAX_TRY_ALLOC 32 599#define MAX_TRY_ALLOC 32
600 600
601/* initial file MUST be in the same directory */ 601/* initial file MUST be in the same directory */
602 602
603static int mailmh_folder_alloc_msg(struct mailmh_folder * folder, 603static int mailmh_folder_alloc_msg(struct mailmh_folder * folder,
604 char * filename, uint32_t * result) 604 char * filename, uint32_t * result)
605{ 605{
606 uint32_t max; 606 uint32_t max;
607 uint32_t k; 607 uint32_t k;
608 char * new_filename; 608 char * new_filename;
609 size_t len; 609 size_t len;
610 struct stat f_stat;
610 611
611 len = strlen(folder->fl_filename) + 20; 612 len = strlen(folder->fl_filename) + 20;
612 new_filename = malloc(len); 613 new_filename = malloc(len);
613 if (new_filename == NULL) 614 if (new_filename == NULL)
614 return MAILMH_ERROR_MEMORY; 615 return MAILMH_ERROR_MEMORY;
615 616
616 max = folder->fl_max_index + 1; 617 max = folder->fl_max_index + 1;
617 618
619 //fprintf(stderr,"mailmh_folder_alloc_msg filename: %s \n", filename);
618 k = 0; 620 k = 0;
619 while (k < MAX_TRY_ALLOC) { 621 while (k < MAX_TRY_ALLOC) {
620 snprintf(new_filename, len, "%s%c%lu", folder->fl_filename, 622 snprintf(new_filename, len, "%s%c%lu", folder->fl_filename,
621 MAIL_DIR_SEPARATOR, (unsigned long) (max + k)); 623 MAIL_DIR_SEPARATOR, (unsigned long) (max + k));
622 624 //fprintf(stderr,"mailmh_folder_alloc_msg new_filename: %s \n", new_filename);
623 if (link(filename, new_filename) == 0) { 625 if ( stat( new_filename, &f_stat ) == -1 ) {
626 // if (link(filename, new_filename) == 0) {
624 int r; 627 int r;
625 628 //fprintf(stderr,"filename found \n");
629 //unlink(filename);
630 rename (filename,new_filename );
626 free(new_filename); 631 free(new_filename);
627 unlink(filename);
628 632
629 if (k > MAX_TRY_ALLOC / 2) { 633 if (k > MAX_TRY_ALLOC / 2) {
630 r = mailmh_folder_update(folder); 634 r = mailmh_folder_update(folder);
631 /* ignore errors */ 635 /* ignore errors */
632 } 636 }
633 637
634 * result = max + k; 638 * result = max + k;
635 639
636 folder->fl_max_index = max + k; 640 folder->fl_max_index = max + k;
637 641
638 return MAILMH_NO_ERROR; 642 return MAILMH_NO_ERROR;
639 } 643 }
640 else if (errno == EXDEV) { 644 else if (errno == EXDEV) {
641 free(filename); 645 free(filename);
642 return MAILMH_ERROR_FOLDER; 646 return MAILMH_ERROR_FOLDER;
643 } 647 }
644 k ++; 648 k ++;
645 } 649 }
646 650
647 free(new_filename); 651 free(new_filename);
648 652
649 return MAILMH_ERROR_FOLDER; 653 return MAILMH_ERROR_FOLDER;
650} 654}
651 655
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 2321087..3908dbb 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2426,56 +2426,60 @@ void CalendarView::moveIncidence(Incidence * inc )
2426 mDatePicker->setDate( da ); 2426 mDatePicker->setDate( da );
2427} 2427}
2428void CalendarView::showDatePicker( ) 2428void CalendarView::showDatePicker( )
2429{ 2429{
2430 //qDebug("CalendarView::showDatePicker( ) "); 2430 //qDebug("CalendarView::showDatePicker( ) ");
2431 if ( mDateFrame->isVisible() ) 2431 if ( mDateFrame->isVisible() )
2432 mDateFrame->hide(); 2432 mDateFrame->hide();
2433 else { 2433 else {
2434 int w =mDatePicker->sizeHint().width() ; 2434 int w =mDatePicker->sizeHint().width() ;
2435 int h = mDatePicker->sizeHint().height() ; 2435 int h = mDatePicker->sizeHint().height() ;
2436 int dw = QApplication::desktop()->width(); 2436 int dw = QApplication::desktop()->width();
2437 int dh = QApplication::desktop()->height(); 2437 int dh = QApplication::desktop()->height();
2438 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2438 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2439 mDateFrame->show(); 2439 mDateFrame->show();
2440 } 2440 }
2441 mDatePickerMode = 1; 2441 mDatePickerMode = 1;
2442 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2442 mDatePicker->setDate( mNavigator->selectedDates().first() );
2443} 2443}
2444 2444
2445void CalendarView::showEventEditor() 2445void CalendarView::showEventEditor()
2446{ 2446{
2447#ifdef DESKTOP_VERSION 2447#ifdef DESKTOP_VERSION
2448 mEventEditor->show(); 2448 mEventEditor->show();
2449#else 2449#else
2450 if ( mEventEditor->width() != QApplication::desktop()->width() )
2451 mEventEditor->hide();
2450 mEventEditor->showMaximized(); 2452 mEventEditor->showMaximized();
2451#endif 2453#endif
2452} 2454}
2453void CalendarView::showTodoEditor() 2455void CalendarView::showTodoEditor()
2454{ 2456{
2455#ifdef DESKTOP_VERSION 2457#ifdef DESKTOP_VERSION
2456 mTodoEditor->show(); 2458 mTodoEditor->show();
2457#else 2459#else
2460 if ( mTodoEditor->width() != QApplication::desktop()->width() )
2461 mTodoEditor->hide();
2458 mTodoEditor->showMaximized(); 2462 mTodoEditor->showMaximized();
2459#endif 2463#endif
2460} 2464}
2461 2465
2462void CalendarView::cloneIncidence() 2466void CalendarView::cloneIncidence()
2463{ 2467{
2464 Incidence *incidence = currentSelection(); 2468 Incidence *incidence = currentSelection();
2465 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2469 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2466 if ( incidence ) { 2470 if ( incidence ) {
2467 cloneIncidence(incidence); 2471 cloneIncidence(incidence);
2468 } 2472 }
2469} 2473}
2470void CalendarView::moveIncidence() 2474void CalendarView::moveIncidence()
2471{ 2475{
2472 Incidence *incidence = currentSelection(); 2476 Incidence *incidence = currentSelection();
2473 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2477 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2474 if ( incidence ) { 2478 if ( incidence ) {
2475 moveIncidence(incidence); 2479 moveIncidence(incidence);
2476 } 2480 }
2477} 2481}
2478void CalendarView::beamIncidence() 2482void CalendarView::beamIncidence()
2479{ 2483{
2480 Incidence *incidence = currentSelection(); 2484 Incidence *incidence = currentSelection();
2481 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2485 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index a12acd1..9cafc60 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -353,48 +353,49 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
353 mTodoListView->setColumnAlignment(1,AlignHCenter); 353 mTodoListView->setColumnAlignment(1,AlignHCenter);
354 mTodoListView->addColumn(i18n("Complete")); 354 mTodoListView->addColumn(i18n("Complete"));
355 mTodoListView->setColumnAlignment(2,AlignHCenter); 355 mTodoListView->setColumnAlignment(2,AlignHCenter);
356 mTodoListView->addColumn(i18n("Due Date")); 356 mTodoListView->addColumn(i18n("Due Date"));
357 mTodoListView->setColumnAlignment(3,AlignLeft); 357 mTodoListView->setColumnAlignment(3,AlignLeft);
358 mTodoListView->addColumn(i18n("Due Time")); 358 mTodoListView->addColumn(i18n("Due Time"));
359 mTodoListView->setColumnAlignment(4,AlignHCenter); 359 mTodoListView->setColumnAlignment(4,AlignHCenter);
360 mTodoListView->addColumn(i18n("Cancelled")); 360 mTodoListView->addColumn(i18n("Cancelled"));
361 mTodoListView->addColumn(i18n("Categories")); 361 mTodoListView->addColumn(i18n("Categories"));
362#if 0 362#if 0
363 mTodoListView->addColumn(i18n("Sort Id")); 363 mTodoListView->addColumn(i18n("Sort Id"));
364 mTodoListView->setColumnAlignment(4,AlignHCenter); 364 mTodoListView->setColumnAlignment(4,AlignHCenter);
365#endif 365#endif
366 366
367 mTodoListView->setMinimumHeight( 60 ); 367 mTodoListView->setMinimumHeight( 60 );
368 mTodoListView->setItemsRenameable( true ); 368 mTodoListView->setItemsRenameable( true );
369 mTodoListView->setRenameable( 0 ); 369 mTodoListView->setRenameable( 0 );
370 mTodoListView->setColumnWidth( 0, 120 ); 370 mTodoListView->setColumnWidth( 0, 120 );
371 mTodoListView->setColumnWidthMode(0, QListView::Manual); 371 mTodoListView->setColumnWidthMode(0, QListView::Manual);
372 mTodoListView->setColumnWidthMode(1, QListView::Manual); 372 mTodoListView->setColumnWidthMode(1, QListView::Manual);
373 mTodoListView->setColumnWidthMode(2, QListView::Manual); 373 mTodoListView->setColumnWidthMode(2, QListView::Manual);
374 mTodoListView->setColumnWidthMode(3, QListView::Manual); 374 mTodoListView->setColumnWidthMode(3, QListView::Manual);
375 mTodoListView->setColumnWidthMode(4, QListView::Manual); 375 mTodoListView->setColumnWidthMode(4, QListView::Manual);
376 mTodoListView->setColumnWidthMode(5, QListView::Manual); 376 mTodoListView->setColumnWidthMode(5, QListView::Manual);
377 mTodoListView->setColumnWidthMode(6, QListView::Manual);
377 mTodoListView->setColumnAlignment( 2, AlignCenter ); 378 mTodoListView->setColumnAlignment( 2, AlignCenter );
378#if 0 379#if 0
379 mTodoListView->setColumnWidthMode(6, QListView::Manual); 380 mTodoListView->setColumnWidthMode(6, QListView::Manual);
380#endif 381#endif
381 382
382 mPriorityPopupMenu = new QPopupMenu(this); 383 mPriorityPopupMenu = new QPopupMenu(this);
383 for (int i = 1; i <= 5; i++) { 384 for (int i = 1; i <= 5; i++) {
384 QString label = QString ("%1").arg (i); 385 QString label = QString ("%1").arg (i);
385 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 386 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
386 } 387 }
387 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 388 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
388 389
389 mPercentageCompletedPopupMenu = new QPopupMenu(this); 390 mPercentageCompletedPopupMenu = new QPopupMenu(this);
390 for (int i = 0; i <= 100; i+=20) { 391 for (int i = 0; i <= 100; i+=20) {
391 QString label = QString ("%1 %").arg (i); 392 QString label = QString ("%1 %").arg (i);
392 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 393 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
393 } 394 }
394 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 395 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
395 396
396 397
397 398
398 mItemPopupMenu = new QPopupMenu(this); 399 mItemPopupMenu = new QPopupMenu(this);
399 mItemPopupMenu->insertItem(i18n("Show..."), this, 400 mItemPopupMenu->insertItem(i18n("Show..."), this,
400 SLOT (showTodo())); 401 SLOT (showTodo()));
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 85647b1..ae0b334 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -21,49 +21,49 @@
21#include <kdebug.h> 21#include <kdebug.h>
22#include <qapp.h> 22#include <qapp.h>
23 23
24#include <kiconloader.h> 24#include <kiconloader.h>
25#include "kotodoviewitem.h" 25#include "kotodoviewitem.h"
26#include "kotodoview.h" 26#include "kotodoview.h"
27#include "koprefs.h" 27#include "koprefs.h"
28 28
29KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) 29KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo)
30 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 30 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
31{ 31{
32 construct(); 32 construct();
33} 33}
34 34
35KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) 35KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo )
36 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 36 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
37{ 37{
38 construct(); 38 construct();
39} 39}
40 40
41QString KOTodoViewItem::key(int column,bool) const 41QString KOTodoViewItem::key(int column,bool) const
42{ 42{
43 QMap<int,QString>::ConstIterator it = mKeyMap.find(column); 43 QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
44 if (it == mKeyMap.end()) { 44 if (it == mKeyMap.end()) {
45 return text(column); 45 return text(column).lower();
46 } else { 46 } else {
47 return *it; 47 return *it;
48 } 48 }
49} 49}
50 50
51void KOTodoViewItem:: setup() 51void KOTodoViewItem:: setup()
52{ 52{
53 53
54 int h = 20; 54 int h = 20;
55 if ( listView () ) { 55 if ( listView () ) {
56 QFontMetrics fm ( listView ()->font () ); 56 QFontMetrics fm ( listView ()->font () );
57 h = fm.height(); 57 h = fm.height();
58 } 58 }
59 setHeight( h ); 59 setHeight( h );
60 60
61} 61}
62void KOTodoViewItem::setSortKey(int column,const QString &key) 62void KOTodoViewItem::setSortKey(int column,const QString &key)
63{ 63{
64 mKeyMap.insert(column,key); 64 mKeyMap.insert(column,key);
65} 65}
66 66
67#if QT_VERSION >= 300 67#if QT_VERSION >= 300
68void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, 68void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
69 int y,int h) 69 int y,int h)
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index 24b8349..c2ee2c9 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -233,50 +233,53 @@ class SharpParser : public QObject
233 todo->setDtDue( QDateTime(fromString( hasDateStr, false ).date(), QTime(0,0,0 )) ); 233 todo->setDtDue( QDateTime(fromString( hasDateStr, false ).date(), QTime(0,0,0 )) );
234 todo->setFloats( true ); 234 todo->setFloats( true );
235 } 235 }
236 else { 236 else {
237 todo->setDtDue( fromString( hasDateStr ) ); 237 todo->setDtDue( fromString( hasDateStr ) );
238 todo->setFloats( false ); 238 todo->setFloats( false );
239 } 239 }
240 240
241 todo->setHasDueDate( true ); 241 todo->setHasDueDate( true );
242 } 242 }
243 hasDateStr = attList[2];//start 243 hasDateStr = attList[2];//start
244 if ( !hasDateStr.isEmpty() ) { 244 if ( !hasDateStr.isEmpty() ) {
245 245
246 todo->setDtStart( fromString( hasDateStr ) ); 246 todo->setDtStart( fromString( hasDateStr ) );
247 todo->setHasStartDate( true); 247 todo->setHasStartDate( true);
248 } else 248 } else
249 todo->setHasStartDate( false ); 249 todo->setHasStartDate( false );
250 hasDateStr = attList[4];//completed 250 hasDateStr = attList[4];//completed
251 if ( !hasDateStr.isEmpty() ) { 251 if ( !hasDateStr.isEmpty() ) {
252 todo->setCompleted(fromString( hasDateStr ) ); 252 todo->setCompleted(fromString( hasDateStr ) );
253 } 253 }
254 QString completedStr = attList[5]; 254 QString completedStr = attList[5];
255 if ( completedStr == "0" ) 255 if ( completedStr == "0" )
256 todo->setCompleted( true ); 256 todo->setCompleted( true );
257 else 257 else {
258 // do not change percent complete
259 if ( todo->isCompleted() )
258 todo->setCompleted( false ); 260 todo->setCompleted( false );
261 }
259 mCalendar->addTodo( todo ); 262 mCalendar->addTodo( todo );
260 263
261 } else if ( qName == "Category" ) { 264 } else if ( qName == "Category" ) {
262 /* 265 /*
263 QString id = attributes.value( "id" ); 266 QString id = attributes.value( "id" );
264 QString name = attributes.value( "name" ); 267 QString name = attributes.value( "name" );
265 setCategory( id, name ); 268 setCategory( id, name );
266 */ 269 */
267 } 270 }
268 //qDebug("end "); 271 //qDebug("end ");
269 return true; 272 return true;
270 } 273 }
271 274
272 275
273 QDateTime fromString ( QString s, bool useTz = true ) { 276 QDateTime fromString ( QString s, bool useTz = true ) {
274 QDateTime dt; 277 QDateTime dt;
275 int y,m,t,h,min,sec; 278 int y,m,t,h,min,sec;
276 y = s.mid(0,4).toInt(); 279 y = s.mid(0,4).toInt();
277 m = s.mid(4,2).toInt(); 280 m = s.mid(4,2).toInt();
278 t = s.mid(6,2).toInt(); 281 t = s.mid(6,2).toInt();
279 h = s.mid(9,2).toInt(); 282 h = s.mid(9,2).toInt();
280 min = s.mid(11,2).toInt(); 283 min = s.mid(11,2).toInt();
281 sec = s.mid(13,2).toInt(); 284 sec = s.mid(13,2).toInt();
282 dt = QDateTime(QDate(y,m,t), QTime(h,min,sec)); 285 dt = QDateTime(QDate(y,m,t), QTime(h,min,sec));
diff --git a/version b/version
index c4fe6e2..0343cbb 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "1.9.13"; version = "1.9.14";