summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-26 20:04:29 (UTC)
committer zautrix <zautrix>2004-10-26 20:04:29 (UTC)
commit8b111ae30fc51a4a580b8d485bef8ad28b0dde84 (patch) (unidiff)
treefb4cf20f5675e5ff2221ed6eea51785bdd65616c
parent62e91b888de607fa5a9f9c0fba807287e57d5d5c (diff)
downloadkdepimpi-8b111ae30fc51a4a580b8d485bef8ad28b0dde84.zip
kdepimpi-8b111ae30fc51a4a580b8d485bef8ad28b0dde84.tar.gz
kdepimpi-8b111ae30fc51a4a580b8d485bef8ad28b0dde84.tar.bz2
fix in kapi translation call, clone fix and kde first sync fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp3
-rw-r--r--korganizer/calendarview.cpp15
-rw-r--r--libkcal/incidence.cpp2
3 files changed, 14 insertions, 6 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 547d208..771bec9 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,100 +1,99 @@
1#ifndef DESKTOP_VERSION 1#ifndef DESKTOP_VERSION
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qcopchannel_qws.h> 3#include <qcopchannel_qws.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#else 5#else
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qwindowsstyle.h> 7#include <qwindowsstyle.h>
8#include <qplatinumstyle.h> 8#include <qplatinumstyle.h>
9#include <qmainwindow.h> 9#include <qmainwindow.h>
10#endif 10#endif
11 11
12#include <qtextcodec.h> 12#include <qtextcodec.h>
13#include <kstandarddirs.h> 13#include <kstandarddirs.h>
14#include <qregexp.h> 14#include <qregexp.h>
15#include <kglobal.h> 15#include <kglobal.h>
16#include <stdio.h> 16#include <stdio.h>
17#include <qdir.h> 17#include <qdir.h>
18#include "kabprefs.h" 18#include "kabprefs.h"
19#include "kaddressbookmain.h" 19#include "kaddressbookmain.h"
20#include "externalapphandler.h" 20#include "externalapphandler.h"
21#include <libkdepim/kpimglobalprefs.h> 21#include <libkdepim/kpimglobalprefs.h>
22void dumpMissing(); 22void dumpMissing();
23int main( int argc, char **argv ) 23int main( int argc, char **argv )
24{ 24{
25#ifndef DESKTOP_VERSION 25#ifndef DESKTOP_VERSION
26 QPEApplication a( argc, argv ); 26 QPEApplication a( argc, argv );
27 a.setKeepRunning (); 27 a.setKeepRunning ();
28#else 28#else
29 QApplication a( argc, argv ); 29 QApplication a( argc, argv );
30 QApplication::setStyle( new QPlatinumStyle ()); 30 QApplication::setStyle( new QPlatinumStyle ());
31 QString hdir = QDir::homeDirPath(); 31 QString hdir = QDir::homeDirPath();
32 // there is a bug when creating dirs for WIN 98 32 // there is a bug when creating dirs for WIN 98
33 // it is difficult to fix, because we have no WIN 98 runnung 33 // it is difficult to fix, because we have no WIN 98 runnung
34 // such that we try it to create the dirs at startup here 34 // such that we try it to create the dirs at startup here
35 if ( hdir == "C:\\" ) { // win 98 or ME 35 if ( hdir == "C:\\" ) { // win 98 or ME
36 QDir app_dir; 36 QDir app_dir;
37 if ( !app_dir.exists("C:\\kdepim") ) 37 if ( !app_dir.exists("C:\\kdepim") )
38 app_dir.mkdir ("C:\\kdepim"); 38 app_dir.mkdir ("C:\\kdepim");
39 if ( !app_dir.exists("C:\\kdepim\\apps") ) 39 if ( !app_dir.exists("C:\\kdepim\\apps") )
40 app_dir.mkdir ("C:\\kdepim\\apps"); 40 app_dir.mkdir ("C:\\kdepim\\apps");
41 if ( !app_dir.exists("C:\\kdepim\\config") ) 41 if ( !app_dir.exists("C:\\kdepim\\config") )
42 app_dir.mkdir ("C:\\kdepim\\config"); 42 app_dir.mkdir ("C:\\kdepim\\config");
43 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) 43 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") )
44 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); 44 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook");
45 } 45 }
46#endif 46#endif
47 47
48 bool exitHelp = false; 48 bool exitHelp = false;
49 if ( argc > 1 ) { 49 if ( argc > 1 ) {
50 QString command = argv[1]; 50 QString command = argv[1];
51 if ( command == "-help" ){ 51 if ( command == "-help" ){
52 printf("KA/E command line commands:\n"); 52 printf("KA/E command line commands:\n");
53 printf(" no command: Start KA/E in usual way\n"); 53 printf(" no command: Start KA/E in usual way\n");
54 printf(" -help: This output\n"); 54 printf(" -help: This output\n");
55 printf(" KA/E is exiting now. Bye!\n"); 55 printf(" KA/E is exiting now. Bye!\n");
56 exitHelp = true; 56 exitHelp = true;
57 } 57 }
58 } 58 }
59 if ( ! exitHelp ) { 59 if ( ! exitHelp ) {
60 60
61 KGlobal::setAppName( "kaddressbook" ); 61 KGlobal::setAppName( "kaddressbook" );
62#ifndef DESKTOP_VERSION 62#ifndef DESKTOP_VERSION
63 if ( QApplication::desktop()->width() > 320 ) 63 if ( QApplication::desktop()->width() > 320 )
64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
65 else 65 else
66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
67#else 67#else
68 QString fileName ; 68 QString fileName ;
69 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 69 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
70 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 70 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
71 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 71 QApplication::addLibraryPath ( qApp->applicationDirPath () );
72 72
73#endif 73#endif
74 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 74 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
75 // init language 75 // init language
76 KABPrefs::instance(); 76 KPimGlobalPrefs::instance()->setGlobalConfig();
77 KAddressBookMain m ; 77 KAddressBookMain m ;
78//US MainWindow m; 78//US MainWindow m;
79 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 79 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
80 80
81 81
82 KPimGlobalPrefs::instance()->setGlobalConfig();
83 82
84#ifndef DESKTOP_VERSION 83#ifndef DESKTOP_VERSION
85 a.showMainWidget( &m ); 84 a.showMainWidget( &m );
86 85
87#else 86#else
88 a.setMainWidget( &m ); 87 a.setMainWidget( &m );
89 m.resize (640, 480 ); 88 m.resize (640, 480 );
90 m.show(); 89 m.show();
91#endif 90#endif
92 a.exec(); 91 a.exec();
93 92
94 dumpMissing(); 93 dumpMissing();
95 94
96 KPimGlobalPrefs::instance()->writeConfig(); 95 KPimGlobalPrefs::instance()->writeConfig();
97 } 96 }
98 qDebug("KA: Bye! "); 97 qDebug("KA: Bye! ");
99} 98}
100 99
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 284ddbf..2ccccfa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -867,350 +867,359 @@ Event* CalendarView::getLastSyncEvent()
867 } 867 }
868 868
869 return lse; 869 return lse;
870 870
871} 871}
872 872
873// we check, if the to delete event has a id for a profile 873// we check, if the to delete event has a id for a profile
874// if yes, we set this id in the profile to delete 874// if yes, we set this id in the profile to delete
875void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 875void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
876{ 876{
877 if ( lastSync.count() == 0 ) { 877 if ( lastSync.count() == 0 ) {
878 //qDebug(" lastSync.count() == 0"); 878 //qDebug(" lastSync.count() == 0");
879 return; 879 return;
880 } 880 }
881 if ( toDelete->type() == "Journal" ) 881 if ( toDelete->type() == "Journal" )
882 return; 882 return;
883 883
884 Event* eve = lastSync.first(); 884 Event* eve = lastSync.first();
885 885
886 while ( eve ) { 886 while ( eve ) {
887 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 887 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
888 if ( !id.isEmpty() ) { 888 if ( !id.isEmpty() ) {
889 QString des = eve->description(); 889 QString des = eve->description();
890 QString pref = "e"; 890 QString pref = "e";
891 if ( toDelete->type() == "Todo" ) 891 if ( toDelete->type() == "Todo" )
892 pref = "t"; 892 pref = "t";
893 des += pref+ id + ","; 893 des += pref+ id + ",";
894 eve->setReadOnly( false ); 894 eve->setReadOnly( false );
895 eve->setDescription( des ); 895 eve->setDescription( des );
896 //qDebug("setdes %s ", des.latin1()); 896 //qDebug("setdes %s ", des.latin1());
897 eve->setReadOnly( true ); 897 eve->setReadOnly( true );
898 } 898 }
899 eve = lastSync.next(); 899 eve = lastSync.next();
900 } 900 }
901 901
902} 902}
903void CalendarView::checkExternalId( Incidence * inc ) 903void CalendarView::checkExternalId( Incidence * inc )
904{ 904{
905 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; 905 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
906 checkExternSyncEvent( lastSync, inc ); 906 checkExternSyncEvent( lastSync, inc );
907 907
908} 908}
909bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 909bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
910{ 910{
911 bool syncOK = true; 911 bool syncOK = true;
912 int addedEvent = 0; 912 int addedEvent = 0;
913 int addedEventR = 0; 913 int addedEventR = 0;
914 int deletedEventR = 0; 914 int deletedEventR = 0;
915 int deletedEventL = 0; 915 int deletedEventL = 0;
916 int changedLocal = 0; 916 int changedLocal = 0;
917 int changedRemote = 0; 917 int changedRemote = 0;
918 //QPtrList<Event> el = local->rawEvents(); 918 //QPtrList<Event> el = local->rawEvents();
919 Event* eventR; 919 Event* eventR;
920 QString uid; 920 QString uid;
921 int take; 921 int take;
922 Event* eventL; 922 Event* eventL;
923 Event* eventRSync; 923 Event* eventRSync;
924 Event* eventLSync; 924 Event* eventLSync;
925 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 925 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
926 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 926 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
927 bool fullDateRange = false; 927 bool fullDateRange = false;
928 local->resetTempSyncStat(); 928 local->resetTempSyncStat();
929 if ( mSyncKDE ) 929 if ( mSyncKDE )
930 remote->resetPilotStat(1); 930 remote->resetPilotStat(1);
931 mLastCalendarSync = QDateTime::currentDateTime(); 931 mLastCalendarSync = QDateTime::currentDateTime();
932 QDateTime modifiedCalendar = mLastCalendarSync;; 932 QDateTime modifiedCalendar = mLastCalendarSync;;
933 eventLSync = getLastSyncEvent(); 933 eventLSync = getLastSyncEvent();
934 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 934 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
935 if ( eventR ) { 935 if ( eventR ) {
936 eventRSync = (Event*) eventR->clone(); 936 eventRSync = (Event*) eventR->clone();
937 remote->deleteEvent(eventR ); 937 remote->deleteEvent(eventR );
938 938
939 } else { 939 } else {
940 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncKDE) { 940 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncKDE) {
941 eventRSync = (Event*)eventLSync->clone(); 941 eventRSync = (Event*)eventLSync->clone();
942 } else { 942 } else {
943 fullDateRange = true; 943 fullDateRange = true;
944 eventRSync = new Event(); 944 eventRSync = new Event();
945 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 945 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
946 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 946 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
947 eventRSync->setDtStart( mLastCalendarSync ); 947 eventRSync->setDtStart( mLastCalendarSync );
948 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 948 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
949 eventRSync->setCategories( i18n("SyncEvent") ); 949 eventRSync->setCategories( i18n("SyncEvent") );
950 } 950 }
951 } 951 }
952 if ( eventLSync->dtStart() == mLastCalendarSync ) 952 if ( eventLSync->dtStart() == mLastCalendarSync )
953 fullDateRange = true; 953 fullDateRange = true;
954 954
955 if ( ! fullDateRange ) { 955 if ( ! fullDateRange ) {
956 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 956 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
957 957
958 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 958 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
959 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 959 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
960 fullDateRange = true; 960 fullDateRange = true;
961 } 961 }
962 } 962 }
963 if ( fullDateRange && !mSyncKDE ) 963 if ( mSyncKDE ) {
964 fullDateRange = ( eventLSync->dtStart() == mLastCalendarSync );
965 }
966 if ( fullDateRange )
964 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 967 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
965 else 968 else
966 mLastCalendarSync = eventLSync->dtStart(); 969 mLastCalendarSync = eventLSync->dtStart();
967 // for resyncing if own file has changed 970 // for resyncing if own file has changed
968 if ( mCurrentSyncDevice == "deleteaftersync" ) { 971 if ( mCurrentSyncDevice == "deleteaftersync" ) {
969 mLastCalendarSync = loadedFileVersion; 972 mLastCalendarSync = loadedFileVersion;
970 //qDebug("setting mLastCalendarSync "); 973 //qDebug("setting mLastCalendarSync ");
971 } 974 }
972 //qDebug("*************************** "); 975 //qDebug("*************************** ");
973 qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 976 qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
974 QPtrList<Incidence> er = remote->rawIncidences(); 977 QPtrList<Incidence> er = remote->rawIncidences();
975 Incidence* inR = er.first(); 978 Incidence* inR = er.first();
976 Incidence* inL; 979 Incidence* inL;
977 QProgressBar bar( er.count(),0 ); 980 QProgressBar bar( er.count(),0 );
978 bar.setCaption (i18n("Syncing - close to abort!") ); 981 bar.setCaption (i18n("Syncing - close to abort!") );
979 982
980 int w = 300; 983 int w = 300;
981 if ( QApplication::desktop()->width() < 320 ) 984 if ( QApplication::desktop()->width() < 320 )
982 w = 220; 985 w = 220;
983 int h = bar.sizeHint().height() ; 986 int h = bar.sizeHint().height() ;
984 int dw = QApplication::desktop()->width(); 987 int dw = QApplication::desktop()->width();
985 int dh = QApplication::desktop()->height(); 988 int dh = QApplication::desktop()->height();
986 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 989 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
987 bar.show(); 990 bar.show();
988 int modulo = (er.count()/10)+1; 991 int modulo = (er.count()/10)+1;
989 int incCounter = 0; 992 int incCounter = 0;
990 while ( inR ) { 993 while ( inR ) {
991 if ( ! bar.isVisible() ) 994 if ( ! bar.isVisible() )
992 return false; 995 return false;
993 if ( incCounter % modulo == 0 ) 996 if ( incCounter % modulo == 0 )
994 bar.setProgress( incCounter ); 997 bar.setProgress( incCounter );
995 ++incCounter; 998 ++incCounter;
996 uid = inR->uid(); 999 uid = inR->uid();
997 bool skipIncidence = false; 1000 bool skipIncidence = false;
998 if ( uid.left(15) == QString("last-syncEvent-") ) 1001 if ( uid.left(15) == QString("last-syncEvent-") )
999 skipIncidence = true; 1002 skipIncidence = true;
1000 QString idS; 1003 QString idS;
1001 qApp->processEvents(); 1004 qApp->processEvents();
1002 if ( !skipIncidence ) { 1005 if ( !skipIncidence ) {
1003 inL = local->incidence( uid ); 1006 inL = local->incidence( uid );
1004 if ( inL ) { // maybe conflict - same uid in both calendars 1007 if ( inL ) { // maybe conflict - same uid in both calendars
1005 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1008 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1006 //qDebug("take %d %s ", take, inL->summary().latin1()); 1009 //qDebug("take %d %s ", take, inL->summary().latin1());
1007 if ( take == 3 ) 1010 if ( take == 3 )
1008 return false; 1011 return false;
1009 if ( take == 1 ) {// take local 1012 if ( take == 1 ) {// take local
1010 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1013 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1011 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1014 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1012 else 1015 else
1013 idS = inR->IDStr(); 1016 idS = inR->IDStr();
1014 remote->deleteIncidence( inR ); 1017 remote->deleteIncidence( inR );
1015 inR = inL->clone(); 1018 inR = inL->clone();
1016 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1019 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1017 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1020 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1018 inR->setIDStr( idS ); 1021 inR->setIDStr( idS );
1019 remote->addIncidence( inR ); 1022 remote->addIncidence( inR );
1020 if ( mSyncKDE ) 1023 if ( mSyncKDE )
1021 inR->setPilotId( 2 ); 1024 inR->setPilotId( 2 );
1022 ++changedRemote; 1025 ++changedRemote;
1023 } else { 1026 } else {
1024 idS = inL->IDStr(); 1027 idS = inL->IDStr();
1025 int pid = inL->pilotId(); 1028 int pid = inL->pilotId();
1026 local->deleteIncidence( inL ); 1029 local->deleteIncidence( inL );
1027 inL = inR->clone(); 1030 inL = inR->clone();
1028 if ( mSyncKDE ) 1031 if ( mSyncKDE )
1029 inL->setPilotId( pid ); 1032 inL->setPilotId( pid );
1030 inL->setIDStr( idS ); 1033 inL->setIDStr( idS );
1031 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1034 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1032 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1035 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1033 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1036 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1034 } 1037 }
1035 local->addIncidence( inL ); 1038 local->addIncidence( inL );
1036 ++changedLocal; 1039 ++changedLocal;
1037 } 1040 }
1038 } 1041 }
1039 } else { // no conflict 1042 } else { // no conflict
1040 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1043 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1041 QString des = eventLSync->description(); 1044 QString des = eventLSync->description();
1042 QString pref = "e"; 1045 QString pref = "e";
1043 if ( inR->type() == "Todo" ) 1046 if ( inR->type() == "Todo" )
1044 pref = "t"; 1047 pref = "t";
1045 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1048 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1046 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1049 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1047 //remote->deleteIncidence( inR ); 1050 //remote->deleteIncidence( inR );
1048 ++deletedEventR; 1051 ++deletedEventR;
1049 } else { 1052 } else {
1050 inR->setLastModified( modifiedCalendar ); 1053 inR->setLastModified( modifiedCalendar );
1051 inL = inR->clone(); 1054 inL = inR->clone();
1055 inL->setIDStr( ":" );
1052 local->addIncidence( inL ); 1056 local->addIncidence( inL );
1053 ++addedEvent; 1057 ++addedEvent;
1054 } 1058 }
1055 } else { 1059 } else {
1056 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1060 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1057 inR->setLastModified( modifiedCalendar ); 1061 inR->setLastModified( modifiedCalendar );
1058 local->addIncidence( inR->clone() ); 1062 inL = inR->clone();
1063 inL->setIDStr( ":" );
1064 local->addIncidence( inL );
1059 ++addedEvent; 1065 ++addedEvent;
1060 } else { 1066 } else {
1061 checkExternSyncEvent(eventRSyncSharp, inR); 1067 checkExternSyncEvent(eventRSyncSharp, inR);
1062 remote->deleteIncidence( inR ); 1068 remote->deleteIncidence( inR );
1063 ++deletedEventR; 1069 ++deletedEventR;
1064 } 1070 }
1065 } 1071 }
1066 } 1072 }
1067 } 1073 }
1068 inR = er.next(); 1074 inR = er.next();
1069 } 1075 }
1070 QPtrList<Incidence> el = local->rawIncidences(); 1076 QPtrList<Incidence> el = local->rawIncidences();
1071 inL = el.first(); 1077 inL = el.first();
1072 modulo = (el.count()/10)+1; 1078 modulo = (el.count()/10)+1;
1073 bar.setCaption (i18n("Add / remove events") ); 1079 bar.setCaption (i18n("Add / remove events") );
1074 bar.setTotalSteps ( el.count() ) ; 1080 bar.setTotalSteps ( el.count() ) ;
1075 bar.show(); 1081 bar.show();
1076 incCounter = 0; 1082 incCounter = 0;
1077 1083
1078 while ( inL ) { 1084 while ( inL ) {
1079 1085
1080 qApp->processEvents(); 1086 qApp->processEvents();
1081 if ( ! bar.isVisible() ) 1087 if ( ! bar.isVisible() )
1082 return false; 1088 return false;
1083 if ( incCounter % modulo == 0 ) 1089 if ( incCounter % modulo == 0 )
1084 bar.setProgress( incCounter ); 1090 bar.setProgress( incCounter );
1085 ++incCounter; 1091 ++incCounter;
1086 uid = inL->uid(); 1092 uid = inL->uid();
1087 bool skipIncidence = false; 1093 bool skipIncidence = false;
1088 if ( uid.left(15) == QString("last-syncEvent-") ) 1094 if ( uid.left(15) == QString("last-syncEvent-") )
1089 skipIncidence = true; 1095 skipIncidence = true;
1090 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) 1096 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" )
1091 skipIncidence = true; 1097 skipIncidence = true;
1092 if ( !skipIncidence ) { 1098 if ( !skipIncidence ) {
1093 inR = remote->incidence( uid ); 1099 inR = remote->incidence( uid );
1094 if ( ! inR ) { 1100 if ( ! inR ) {
1095 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1101 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1096 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1102 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1097 checkExternSyncEvent(eventLSyncSharp, inL); 1103 checkExternSyncEvent(eventLSyncSharp, inL);
1098 local->deleteIncidence( inL ); 1104 local->deleteIncidence( inL );
1099 ++deletedEventL; 1105 ++deletedEventL;
1100 } else { 1106 } else {
1101 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1107 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1102 inL->removeID(mCurrentSyncDevice ); 1108 inL->removeID(mCurrentSyncDevice );
1103 ++addedEventR; 1109 ++addedEventR;
1104 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1110 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1105 inL->setLastModified( modifiedCalendar ); 1111 inL->setLastModified( modifiedCalendar );
1106 inR = inL->clone(); 1112 inR = inL->clone();
1113 inR->setIDStr( ":" );
1107 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1114 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1108 remote->addIncidence( inR ); 1115 remote->addIncidence( inR );
1109 } 1116 }
1110 } 1117 }
1111 } else { 1118 } else {
1112 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1119 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1113 checkExternSyncEvent(eventLSyncSharp, inL); 1120 checkExternSyncEvent(eventLSyncSharp, inL);
1114 local->deleteIncidence( inL ); 1121 local->deleteIncidence( inL );
1115 ++deletedEventL; 1122 ++deletedEventL;
1116 } else { 1123 } else {
1117 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1124 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1118 ++addedEventR; 1125 ++addedEventR;
1119 inL->setLastModified( modifiedCalendar ); 1126 inL->setLastModified( modifiedCalendar );
1120 remote->addIncidence( inL->clone() ); 1127 inR = inL->clone();
1128 inR->setIDStr( ":" );
1129 remote->addIncidence( inR );
1121 } 1130 }
1122 } 1131 }
1123 } 1132 }
1124 } 1133 }
1125 } 1134 }
1126 inL = el.next(); 1135 inL = el.next();
1127 } 1136 }
1128 int delFut = 0; 1137 int delFut = 0;
1129 int remRem = 0; 1138 int remRem = 0;
1130 if ( mSyncManager->mWriteBackInFuture ) { 1139 if ( mSyncManager->mWriteBackInFuture ) {
1131 er = remote->rawIncidences(); 1140 er = remote->rawIncidences();
1132 remRem = er.count(); 1141 remRem = er.count();
1133 inR = er.first(); 1142 inR = er.first();
1134 QDateTime dt; 1143 QDateTime dt;
1135 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1144 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1136 QDateTime end = cur.addDays( (mSyncManager->mWriteBackInFuture +1 ) *7 ); 1145 QDateTime end = cur.addDays( (mSyncManager->mWriteBackInFuture +1 ) *7 );
1137 while ( inR ) { 1146 while ( inR ) {
1138 if ( inR->type() == "Todo" ) { 1147 if ( inR->type() == "Todo" ) {
1139 Todo * t = (Todo*)inR; 1148 Todo * t = (Todo*)inR;
1140 if ( t->hasDueDate() ) 1149 if ( t->hasDueDate() )
1141 dt = t->dtDue(); 1150 dt = t->dtDue();
1142 else 1151 else
1143 dt = cur.addSecs( 62 ); 1152 dt = cur.addSecs( 62 );
1144 } 1153 }
1145 else if (inR->type() == "Event" ) { 1154 else if (inR->type() == "Event" ) {
1146 bool ok; 1155 bool ok;
1147 dt = inR->getNextOccurence( cur, &ok ); 1156 dt = inR->getNextOccurence( cur, &ok );
1148 if ( !ok ) 1157 if ( !ok )
1149 dt = cur.addSecs( -62 ); 1158 dt = cur.addSecs( -62 );
1150 } 1159 }
1151 else 1160 else
1152 dt = inR->dtStart(); 1161 dt = inR->dtStart();
1153 if ( dt < cur || dt > end ) { 1162 if ( dt < cur || dt > end ) {
1154 remote->deleteIncidence( inR ); 1163 remote->deleteIncidence( inR );
1155 ++delFut; 1164 ++delFut;
1156 } 1165 }
1157 inR = er.next(); 1166 inR = er.next();
1158 } 1167 }
1159 } 1168 }
1160 bar.hide(); 1169 bar.hide();
1161 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1170 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1162 eventLSync->setReadOnly( false ); 1171 eventLSync->setReadOnly( false );
1163 eventLSync->setDtStart( mLastCalendarSync ); 1172 eventLSync->setDtStart( mLastCalendarSync );
1164 eventRSync->setDtStart( mLastCalendarSync ); 1173 eventRSync->setDtStart( mLastCalendarSync );
1165 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1174 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1166 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1175 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1167 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1176 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1168 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1177 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1169 eventLSync->setReadOnly( true ); 1178 eventLSync->setReadOnly( true );
1170 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncKDE) // kde is abnormal... 1179 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncKDE) // kde is abnormal...
1171 remote->addEvent( eventRSync ); 1180 remote->addEvent( eventRSync );
1172 else 1181 else
1173 delete eventRSync; 1182 delete eventRSync;
1174 QString mes; 1183 QString mes;
1175 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR ); 1184 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR );
1176 QString delmess; 1185 QString delmess;
1177 if ( delFut ) { 1186 if ( delFut ) {
1178 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut); 1187 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut);
1179 mes += delmess; 1188 mes += delmess;
1180 } 1189 }
1181 if ( mSyncManager->mShowSyncSummary ) { 1190 if ( mSyncManager->mShowSyncSummary ) {
1182 KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); 1191 KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") );
1183 } 1192 }
1184 qDebug( mes ); 1193 qDebug( mes );
1185 mCalendar->checkAlarmForIncidence( 0, true ); 1194 mCalendar->checkAlarmForIncidence( 0, true );
1186 return syncOK; 1195 return syncOK;
1187} 1196}
1188 1197
1189void CalendarView::setSyncDevice( QString s ) 1198void CalendarView::setSyncDevice( QString s )
1190{ 1199{
1191 mCurrentSyncDevice= s; 1200 mCurrentSyncDevice= s;
1192} 1201}
1193void CalendarView::setSyncName( QString s ) 1202void CalendarView::setSyncName( QString s )
1194{ 1203{
1195 mCurrentSyncName= s; 1204 mCurrentSyncName= s;
1196} 1205}
1197bool CalendarView::syncCalendar(QString filename, int mode) 1206bool CalendarView::syncCalendar(QString filename, int mode)
1198{ 1207{
1199 //qDebug("syncCalendar %s ", filename.latin1()); 1208 //qDebug("syncCalendar %s ", filename.latin1());
1200 mGlobalSyncMode = SYNC_MODE_NORMAL; 1209 mGlobalSyncMode = SYNC_MODE_NORMAL;
1201 CalendarLocal* calendar = new CalendarLocal(); 1210 CalendarLocal* calendar = new CalendarLocal();
1202 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1211 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1203 FileStorage* storage = new FileStorage( calendar ); 1212 FileStorage* storage = new FileStorage( calendar );
1204 bool syncOK = false; 1213 bool syncOK = false;
1205 storage->setFileName( filename ); 1214 storage->setFileName( filename );
1206 // qDebug("loading ... "); 1215 // qDebug("loading ... ");
1207 if ( storage->load() ) { 1216 if ( storage->load() ) {
1208 getEventViewerDialog()->setSyncMode( true ); 1217 getEventViewerDialog()->setSyncMode( true );
1209 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1218 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1210 getEventViewerDialog()->setSyncMode( false ); 1219 getEventViewerDialog()->setSyncMode( false );
1211 if ( syncOK ) { 1220 if ( syncOK ) {
1212 if ( mSyncManager->mWriteBackFile ) 1221 if ( mSyncManager->mWriteBackFile )
1213 { 1222 {
1214 storage->setSaveFormat( new ICalFormat() ); 1223 storage->setSaveFormat( new ICalFormat() );
1215 storage->save(); 1224 storage->save();
1216 } 1225 }
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 55ac6d4..5a9ef0e 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -88,193 +88,193 @@ Incidence::~Incidence()
88 88
89} 89}
90 90
91bool Incidence::cancelled() const 91bool Incidence::cancelled() const
92{ 92{
93 return mCancelled; 93 return mCancelled;
94} 94}
95void Incidence::setCancelled( bool b ) 95void Incidence::setCancelled( bool b )
96{ 96{
97 mCancelled = b; 97 mCancelled = b;
98 updated(); 98 updated();
99} 99}
100bool Incidence::hasStartDate() const 100bool Incidence::hasStartDate() const
101{ 101{
102 return mHasStartDate; 102 return mHasStartDate;
103} 103}
104 104
105void Incidence::setHasStartDate(bool f) 105void Incidence::setHasStartDate(bool f)
106{ 106{
107 if (mReadOnly) return; 107 if (mReadOnly) return;
108 mHasStartDate = f; 108 mHasStartDate = f;
109 updated(); 109 updated();
110} 110}
111 111
112// A string comparison that considers that null and empty are the same 112// A string comparison that considers that null and empty are the same
113static bool stringCompare( const QString& s1, const QString& s2 ) 113static bool stringCompare( const QString& s1, const QString& s2 )
114{ 114{
115 if ( s1.isEmpty() && s2.isEmpty() ) 115 if ( s1.isEmpty() && s2.isEmpty() )
116 return true; 116 return true;
117 return s1 == s2; 117 return s1 == s2;
118} 118}
119 119
120bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) 120bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
121{ 121{
122 122
123 if( i1.alarms().count() != i2.alarms().count() ) { 123 if( i1.alarms().count() != i2.alarms().count() ) {
124 return false; // no need to check further 124 return false; // no need to check further
125 } 125 }
126 if ( i1.alarms().count() > 0 ) { 126 if ( i1.alarms().count() > 0 ) {
127 if ( !( *(i1.alarms().first()) == *(i2.alarms().first())) ) 127 if ( !( *(i1.alarms().first()) == *(i2.alarms().first())) )
128 { 128 {
129 qDebug("alarm not equal "); 129 qDebug("alarm not equal ");
130 return false; 130 return false;
131 } 131 }
132 } 132 }
133#if 0 133#if 0
134 QPtrListIterator<Alarm> a1( i1.alarms() ); 134 QPtrListIterator<Alarm> a1( i1.alarms() );
135 QPtrListIterator<Alarm> a2( i2.alarms() ); 135 QPtrListIterator<Alarm> a2( i2.alarms() );
136 for( ; a1.current() && a2.current(); ++a1, ++a2 ) { 136 for( ; a1.current() && a2.current(); ++a1, ++a2 ) {
137 if( *a1.current() == *a2.current() ) { 137 if( *a1.current() == *a2.current() ) {
138 continue; 138 continue;
139 } 139 }
140 else { 140 else {
141 return false; 141 return false;
142 } 142 }
143 } 143 }
144#endif 144#endif
145 145
146 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) ) 146 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) )
147 return false; 147 return false;
148 if ( i1.hasStartDate() == i2.hasStartDate() ) { 148 if ( i1.hasStartDate() == i2.hasStartDate() ) {
149 if ( i1.hasStartDate() ) { 149 if ( i1.hasStartDate() ) {
150 if ( i1.dtStart() != i2.dtStart() ) 150 if ( i1.dtStart() != i2.dtStart() )
151 return false; 151 return false;
152 } 152 }
153 } else { 153 } else {
154 return false; 154 return false;
155 } 155 }
156 if (!( *i1.recurrence() == *i2.recurrence()) ) { 156 if (!( *i1.recurrence() == *i2.recurrence()) ) {
157 qDebug("recurrence is NOT equal "); 157 qDebug("recurrence is NOT equal ");
158 return false; 158 return false;
159 } 159 }
160 return 160 return
161 // i1.created() == i2.created() && 161 // i1.created() == i2.created() &&
162 stringCompare( i1.description(), i2.description() ) && 162 stringCompare( i1.description(), i2.description() ) &&
163 stringCompare( i1.summary(), i2.summary() ) && 163 stringCompare( i1.summary(), i2.summary() ) &&
164 i1.categories() == i2.categories() && 164 i1.categories() == i2.categories() &&
165 // no need to compare mRelatedTo 165 // no need to compare mRelatedTo
166 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && 166 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) &&
167 // i1.relations() == i2.relations() && 167 // i1.relations() == i2.relations() &&
168 i1.exDates() == i2.exDates() && 168 i1.exDates() == i2.exDates() &&
169 i1.attachments() == i2.attachments() && 169 i1.attachments() == i2.attachments() &&
170 i1.resources() == i2.resources() && 170 i1.resources() == i2.resources() &&
171 i1.secrecy() == i2.secrecy() && 171 i1.secrecy() == i2.secrecy() &&
172 i1.priority() == i2.priority() && 172 i1.priority() == i2.priority() &&
173 stringCompare( i1.location(), i2.location() ); 173 stringCompare( i1.location(), i2.location() );
174} 174}
175 175
176 176
177void Incidence::recreate() 177void Incidence::recreate()
178{ 178{
179 setCreated(QDateTime::currentDateTime()); 179 setCreated(QDateTime::currentDateTime());
180 180
181 setUid(CalFormat::createUniqueId()); 181 setUid(CalFormat::createUniqueId());
182 182
183 setRevision(0); 183 setRevision(0);
184 184 setIDStr( ":" );
185 setLastModified(QDateTime::currentDateTime()); 185 setLastModified(QDateTime::currentDateTime());
186} 186}
187 187
188void Incidence::setReadOnly( bool readOnly ) 188void Incidence::setReadOnly( bool readOnly )
189{ 189{
190 IncidenceBase::setReadOnly( readOnly ); 190 IncidenceBase::setReadOnly( readOnly );
191 recurrence()->setRecurReadOnly( readOnly); 191 recurrence()->setRecurReadOnly( readOnly);
192} 192}
193 193
194void Incidence::setCreated(QDateTime created) 194void Incidence::setCreated(QDateTime created)
195{ 195{
196 if (mReadOnly) return; 196 if (mReadOnly) return;
197 mCreated = getEvenTime(created); 197 mCreated = getEvenTime(created);
198} 198}
199 199
200QDateTime Incidence::created() const 200QDateTime Incidence::created() const
201{ 201{
202 return mCreated; 202 return mCreated;
203} 203}
204 204
205void Incidence::setRevision(int rev) 205void Incidence::setRevision(int rev)
206{ 206{
207 if (mReadOnly) return; 207 if (mReadOnly) return;
208 mRevision = rev; 208 mRevision = rev;
209 209
210 updated(); 210 updated();
211} 211}
212 212
213int Incidence::revision() const 213int Incidence::revision() const
214{ 214{
215 return mRevision; 215 return mRevision;
216} 216}
217 217
218void Incidence::setDtStart(const QDateTime &dtStart) 218void Incidence::setDtStart(const QDateTime &dtStart)
219{ 219{
220 220
221 QDateTime dt = getEvenTime(dtStart); 221 QDateTime dt = getEvenTime(dtStart);
222 recurrence()->setRecurStart( dt); 222 recurrence()->setRecurStart( dt);
223 IncidenceBase::setDtStart( dt ); 223 IncidenceBase::setDtStart( dt );
224} 224}
225 225
226void Incidence::setDescription(const QString &description) 226void Incidence::setDescription(const QString &description)
227{ 227{
228 if (mReadOnly) return; 228 if (mReadOnly) return;
229 mDescription = description; 229 mDescription = description;
230 updated(); 230 updated();
231} 231}
232 232
233QString Incidence::description() const 233QString Incidence::description() const
234{ 234{
235 return mDescription; 235 return mDescription;
236} 236}
237 237
238 238
239void Incidence::setSummary(const QString &summary) 239void Incidence::setSummary(const QString &summary)
240{ 240{
241 if (mReadOnly) return; 241 if (mReadOnly) return;
242 mSummary = summary; 242 mSummary = summary;
243 updated(); 243 updated();
244} 244}
245 245
246QString Incidence::summary() const 246QString Incidence::summary() const
247{ 247{
248 return mSummary; 248 return mSummary;
249} 249}
250 250
251void Incidence::setCategories(const QStringList &categories) 251void Incidence::setCategories(const QStringList &categories)
252{ 252{
253 if (mReadOnly) return; 253 if (mReadOnly) return;
254 mCategories = categories; 254 mCategories = categories;
255 updated(); 255 updated();
256} 256}
257 257
258// TODO: remove setCategories(QString) function 258// TODO: remove setCategories(QString) function
259void Incidence::setCategories(const QString &catStr) 259void Incidence::setCategories(const QString &catStr)
260{ 260{
261 if (mReadOnly) return; 261 if (mReadOnly) return;
262 mCategories.clear(); 262 mCategories.clear();
263 263
264 if (catStr.isEmpty()) return; 264 if (catStr.isEmpty()) return;
265 265
266 mCategories = QStringList::split(",",catStr); 266 mCategories = QStringList::split(",",catStr);
267 267
268 QStringList::Iterator it; 268 QStringList::Iterator it;
269 for(it = mCategories.begin();it != mCategories.end(); ++it) { 269 for(it = mCategories.begin();it != mCategories.end(); ++it) {
270 *it = (*it).stripWhiteSpace(); 270 *it = (*it).stripWhiteSpace();
271 } 271 }
272 272
273 updated(); 273 updated();
274} 274}
275 275
276QStringList Incidence::categories() const 276QStringList Incidence::categories() const
277{ 277{
278 return mCategories; 278 return mCategories;
279} 279}
280 280