summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp18
-rw-r--r--libkcal/calendar.cpp2
-rw-r--r--libkcal/calformat.cpp20
-rw-r--r--libkcal/icalformatimpl.cpp12
-rw-r--r--libkcal/incidence.cpp7
-rw-r--r--libkcal/todo.cpp38
-rw-r--r--libkcal/vcalformat.cpp16
-rw-r--r--microkde/kglobalsettings.cpp3
8 files changed, 56 insertions, 60 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 8512a07..c530037 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2992,46 +2992,34 @@ void CalendarView::appointment_delete()
2992 2992
2993 if (!anEvent) { 2993 if (!anEvent) {
2994 KNotifyClient::beep(); 2994 KNotifyClient::beep();
2995 return; 2995 return;
2996 } 2996 }
2997 2997
2998 deleteEvent(anEvent); 2998 deleteEvent(anEvent);
2999} 2999}
3000 3000
3001void CalendarView::todo_resub( Todo * parent, Todo * sub ) 3001void CalendarView::todo_resub( Todo * parent, Todo * sub )
3002{ 3002{
3003 if (!sub) return; 3003 if (!sub) return;
3004 if (!parent) return; 3004 if ( sub->relatedTo() == parent )
3005 if ( sub->relatedTo() ) 3005 return;
3006 sub->relatedTo()->removeRelation(sub);
3007 sub->setRelatedTo(parent); 3006 sub->setRelatedTo(parent);
3008 sub->setRelatedToUid(parent->uid());
3009 parent->addRelation(sub);
3010 sub->updated(); 3007 sub->updated();
3011 parent->updated();
3012 setModified(true); 3008 setModified(true);
3013 updateView(); 3009 updateView();
3014} 3010}
3015void CalendarView::todo_unsub(Todo *anTodo ) 3011void CalendarView::todo_unsub(Todo *anTodo )
3016{ 3012{
3017 // Todo *anTodo = selectedTodo(); 3013 todo_resub( 0, anTodo );
3018 if (!anTodo) return;
3019 if (!anTodo->relatedTo()) return;
3020 anTodo->relatedTo()->removeRelation(anTodo);
3021 anTodo->setRelatedTo(0);
3022 anTodo->updated();
3023 anTodo->setRelatedToUid("");
3024 setModified(true);
3025 updateView();
3026} 3014}
3027 3015
3028void CalendarView::deleteTodo(Todo *todo) 3016void CalendarView::deleteTodo(Todo *todo)
3029{ 3017{
3030 if (!todo) { 3018 if (!todo) {
3031 KNotifyClient::beep(); 3019 KNotifyClient::beep();
3032 return; 3020 return;
3033 } 3021 }
3034 if (KOPrefs::instance()->mConfirm) { 3022 if (KOPrefs::instance()->mConfirm) {
3035 QString text = todo->summary().left(20); 3023 QString text = todo->summary().left(20);
3036 if (!todo->relations().isEmpty()) { 3024 if (!todo->relations().isEmpty()) {
3037 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); 3025 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index dcfee5d..406cd48 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -29,25 +29,25 @@
29#include "exceptions.h" 29#include "exceptions.h"
30#include "calfilter.h" 30#include "calfilter.h"
31 31
32#include "calendar.h" 32#include "calendar.h"
33#include "syncdefines.h" 33#include "syncdefines.h"
34 34
35using namespace KCal; 35using namespace KCal;
36 36
37Calendar::Calendar() 37Calendar::Calendar()
38{ 38{
39 39
40 init(); 40 init();
41 setTimeZoneId( i18n (" 00:00 Europe/London(UTC)") ); 41 setTimeZoneId( " 00:00 Europe/London(UTC)" );
42} 42}
43 43
44Calendar::Calendar( const QString &timeZoneId ) 44Calendar::Calendar( const QString &timeZoneId )
45{ 45{
46 46
47 init(); 47 init();
48 setTimeZoneId(timeZoneId); 48 setTimeZoneId(timeZoneId);
49} 49}
50 50
51void Calendar::init() 51void Calendar::init()
52{ 52{
53 mObserver = 0; 53 mObserver = 0;
diff --git a/libkcal/calformat.cpp b/libkcal/calformat.cpp
index 8a3d069..359f65f 100644
--- a/libkcal/calformat.cpp
+++ b/libkcal/calformat.cpp
@@ -17,37 +17,37 @@
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <klocale.h> 21#include <klocale.h>
22#include <kdebug.h> 22#include <kdebug.h>
23#include <kapplication.h> 23#include <kapplication.h>
24 24
25#include "calformat.h" 25#include "calformat.h"
26 26
27using namespace KCal; 27using namespace KCal;
28 28
29QString CalFormat::mApplication = QString::fromLatin1("libkcal"); 29QString CalFormat::mApplication = QString::fromLatin1("libkcal-pi");
30QString CalFormat::mProductId = QString::fromLatin1("-//K Desktop Environment//NONSGML libkcal 3.1//EN"); 30QString CalFormat::mProductId = QString::fromLatin1("-//KDE-Pim//Platform-independent 2.1.0");
31 31
32// An array containing the PRODID strings indexed against the calendar file format version used. 32// An array containing the PRODID strings indexed against the calendar file format version used.
33// Every time the calendar file format is changed, add an entry/entries to this list. 33// Every time the calendar file format is changed, add an entry/entries to this list.
34struct CalVersion { 34struct CalVersion {
35 int version; 35 int version;
36 QString prodId; 36 QString prodId;
37}; 37};
38static CalVersion prodIds[] = { 38static CalVersion prodIds[] = {
39 { 220, QString::fromLatin1("-//K Desktop Environment//NONSGML KOrganizer 2.2//EN") }, 39 { 220, QString::fromLatin1("-//KDE-Pim//Pi 2.2//EN") },
40 { 300, QString::fromLatin1("-//K Desktop Environment//NONSGML KOrganizer 3.0//EN") }, 40 { 300, QString::fromLatin1("-//KDE-Pim//Pi 3.0//EN") },
41 { 310, QString::fromLatin1("-//K Desktop Environment//NONSGML KOrganizer 3.1//EN") }, 41 { 310, QString::fromLatin1("-//KDE-Pim//Pi 3.1//EN") },
42 { 0 , QString() } 42 { 0 , QString() }
43}; 43};
44 44
45 45
46CalFormat::CalFormat() 46CalFormat::CalFormat()
47{ 47{
48 mException = 0; 48 mException = 0;
49} 49}
50 50
51CalFormat::~CalFormat() 51CalFormat::~CalFormat()
52{ 52{
53 delete mException; 53 delete mException;
@@ -69,30 +69,26 @@ ErrorFormat *CalFormat::exception()
69{ 69{
70 return mException; 70 return mException;
71} 71}
72 72
73void CalFormat::setApplication(const QString& application, const QString& productID) 73void CalFormat::setApplication(const QString& application, const QString& productID)
74{ 74{
75 mApplication = application; 75 mApplication = application;
76 mProductId = productID; 76 mProductId = productID;
77} 77}
78 78
79QString CalFormat::createUniqueId() 79QString CalFormat::createUniqueId()
80{ 80{
81 int hashTime = QTime::currentTime().hour() + 81 return QString("%1-%2-%3")
82 QTime::currentTime().minute() + QTime::currentTime().second() + 82 .arg("kopi")
83 QTime::currentTime().msec();
84 QString uidStr = QString("%1-%2.%3")
85 .arg(mApplication)
86 .arg(KApplication::random()) 83 .arg(KApplication::random())
87 .arg(hashTime); 84 .arg(QTime::currentTime().msec()+1);
88 return uidStr;
89} 85}
90 86
91int CalFormat::calendarVersion(const char* prodId) 87int CalFormat::calendarVersion(const char* prodId)
92{ 88{
93 for (const CalVersion* cv = prodIds; cv->version; ++cv) { 89 for (const CalVersion* cv = prodIds; cv->version; ++cv) {
94 if (!strcmp(prodId, cv->prodId.local8Bit())) 90 if (!strcmp(prodId, cv->prodId.local8Bit()))
95 return cv->version; 91 return cv->version;
96 } 92 }
97 return 0; 93 return 0;
98} 94}
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index eae41aa..fe7413f 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -357,27 +357,27 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence)
357 // vcc.y has been hacked to translate the ';' to a ',' when the vcal is 357 // vcc.y has been hacked to translate the ';' to a ',' when the vcal is
358 // read in. 358 // read in.
359 tmpStr += ";"; 359 tmpStr += ";";
360 } 360 }
361 if (!tmpStr.isEmpty()) { 361 if (!tmpStr.isEmpty()) {
362 tmpStr.truncate(tmpStr.length()-1); 362 tmpStr.truncate(tmpStr.length()-1);
363 icalcomponent_add_property(parent,icalproperty_new_categories( 363 icalcomponent_add_property(parent,icalproperty_new_categories(
364 writeText(incidence->getCategories().join(";")))); 364 writeText(incidence->getCategories().join(";"))));
365 } 365 }
366*/ 366*/
367 367
368 // related event 368 // related event
369 if (incidence->relatedTo()) { 369 if (!incidence->relatedToUid().isEmpty()) {
370 icalcomponent_add_property(parent,icalproperty_new_relatedto( 370 icalcomponent_add_property(parent,icalproperty_new_relatedto(
371 incidence->relatedTo()->uid().utf8())); 371 incidence->relatedToUid().utf8()));
372 } 372 }
373 373
374 // recurrence rule stuff 374 // recurrence rule stuff
375 Recurrence *recur = incidence->recurrence(); 375 Recurrence *recur = incidence->recurrence();
376 if (recur->doesRecur()) { 376 if (recur->doesRecur()) {
377 377
378 icalcomponent_add_property(parent,writeRecurrenceRule(recur)); 378 icalcomponent_add_property(parent,writeRecurrenceRule(recur));
379 } 379 }
380 380
381 // recurrence excpetion dates 381 // recurrence excpetion dates
382 DateList dateList = incidence->exDates(); 382 DateList dateList = incidence->exDates();
383 DateList::ConstIterator exIt; 383 DateList::ConstIterator exIt;
@@ -2027,29 +2027,33 @@ bool ICalFormatImpl::populate( Calendar *cal, icalcomponent *calendar)
2027 ; 2027 ;
2028 } else { 2028 } else {
2029 ; 2029 ;
2030 } 2030 }
2031 SKIP: 2031 SKIP:
2032 ; 2032 ;
2033 } // while 2033 } // while
2034#endif 2034#endif
2035 2035
2036 // Post-Process list of events with relations, put Event objects in relation 2036 // Post-Process list of events with relations, put Event objects in relation
2037 Event *ev; 2037 Event *ev;
2038 for ( ev=mEventsRelate.first(); ev != 0; ev=mEventsRelate.next() ) { 2038 for ( ev=mEventsRelate.first(); ev != 0; ev=mEventsRelate.next() ) {
2039 ev->setRelatedTo(cal->event(ev->relatedToUid())); 2039 Incidence * inc = cal->event(ev->relatedToUid());
2040 if ( inc )
2041 ev->setRelatedTo( inc );
2040 } 2042 }
2041 Todo *todo; 2043 Todo *todo;
2042 for ( todo=mTodosRelate.first(); todo != 0; todo=mTodosRelate.next() ) { 2044 for ( todo=mTodosRelate.first(); todo != 0; todo=mTodosRelate.next() ) {
2043 todo->setRelatedTo(cal->todo(todo->relatedToUid())); 2045 Incidence * inc = cal->todo(todo->relatedToUid());
2046 if ( inc )
2047 todo->setRelatedTo( inc );
2044 } 2048 }
2045 2049
2046 return true; 2050 return true;
2047} 2051}
2048 2052
2049QString ICalFormatImpl::extractErrorProperty(icalcomponent *c) 2053QString ICalFormatImpl::extractErrorProperty(icalcomponent *c)
2050{ 2054{
2051// kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: " 2055// kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: "
2052// << icalcomponent_as_ical_string(c) << endl; 2056// << icalcomponent_as_ical_string(c) << endl;
2053 2057
2054 QString errorMessage; 2058 QString errorMessage;
2055 2059
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index a312ba5..6bca12c 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -381,25 +381,30 @@ QString Incidence::relatedToUid() const
381} 381}
382 382
383void Incidence::setRelatedTo(Incidence *relatedTo) 383void Incidence::setRelatedTo(Incidence *relatedTo)
384{ 384{
385 //qDebug("Incidence::setRelatedTo %d ", relatedTo); 385 //qDebug("Incidence::setRelatedTo %d ", relatedTo);
386 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); 386 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() );
387 if (mReadOnly || mRelatedTo == relatedTo) return; 387 if (mReadOnly || mRelatedTo == relatedTo) return;
388 if(mRelatedTo) { 388 if(mRelatedTo) {
389 // updated(); 389 // updated();
390 mRelatedTo->removeRelation(this); 390 mRelatedTo->removeRelation(this);
391 } 391 }
392 mRelatedTo = relatedTo; 392 mRelatedTo = relatedTo;
393 if (mRelatedTo) mRelatedTo->addRelation(this); 393 if (mRelatedTo) {
394 mRelatedTo->addRelation(this);
395 mRelatedToUid = mRelatedTo->uid();
396 } else {
397 mRelatedToUid = "";
398 }
394} 399}
395 400
396Incidence *Incidence::relatedTo() const 401Incidence *Incidence::relatedTo() const
397{ 402{
398 return mRelatedTo; 403 return mRelatedTo;
399} 404}
400 405
401QPtrList<Incidence> Incidence::relations() const 406QPtrList<Incidence> Incidence::relations() const
402{ 407{
403 return mRelations; 408 return mRelations;
404} 409}
405 410
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 8794f7a..7906046 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -15,24 +15,26 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kglobal.h> 21#include <kglobal.h>
22#include <kglobalsettings.h> 22#include <kglobalsettings.h>
23#include <klocale.h> 23#include <klocale.h>
24#include <kdebug.h> 24#include <kdebug.h>
25#include <qregexp.h> 25#include <qregexp.h>
26 26
27#include "calendarlocal.h"
28#include "icalformat.h"
27#include "todo.h" 29#include "todo.h"
28 30
29using namespace KCal; 31using namespace KCal;
30 32
31Todo::Todo(): Incidence() 33Todo::Todo(): Incidence()
32{ 34{
33// mStatus = TENTATIVE; 35// mStatus = TENTATIVE;
34 36
35 mHasDueDate = false; 37 mHasDueDate = false;
36 setHasStartDate( false ); 38 setHasStartDate( false );
37 mCompleted = getEvenTime(QDateTime::currentDateTime()); 39 mCompleted = getEvenTime(QDateTime::currentDateTime());
38 mHasCompletedDate = false; 40 mHasCompletedDate = false;
@@ -46,24 +48,25 @@ Todo::Todo(const Todo &t) : Incidence(t)
46 mDtDue = t.mDtDue; 48 mDtDue = t.mDtDue;
47 mHasDueDate = t.mHasDueDate; 49 mHasDueDate = t.mHasDueDate;
48 mCompleted = t.mCompleted; 50 mCompleted = t.mCompleted;
49 mHasCompletedDate = t.mHasCompletedDate; 51 mHasCompletedDate = t.mHasCompletedDate;
50 mPercentComplete = t.mPercentComplete; 52 mPercentComplete = t.mPercentComplete;
51 mRunning = false; 53 mRunning = false;
52 mRunSaveTimer = 0; 54 mRunSaveTimer = 0;
53} 55}
54 56
55Todo::~Todo() 57Todo::~Todo()
56{ 58{
57 setRunning( false ); 59 setRunning( false );
60 qDebug("Todo::~Todo() ");
58} 61}
59 62
60void Todo::setRunning( bool run ) 63void Todo::setRunning( bool run )
61{ 64{
62 if ( run == mRunning ) 65 if ( run == mRunning )
63 return; 66 return;
64 if ( !mRunSaveTimer ) { 67 if ( !mRunSaveTimer ) {
65 mRunSaveTimer = new QTimer ( this ); 68 mRunSaveTimer = new QTimer ( this );
66 connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); 69 connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) );
67 } 70 }
68 mRunning = run; 71 mRunning = run;
69 if ( mRunning ) { 72 if ( mRunning ) {
@@ -72,46 +75,41 @@ void Todo::setRunning( bool run )
72 } else { 75 } else {
73 mRunSaveTimer->stop(); 76 mRunSaveTimer->stop();
74 saveRunningInfoToFile(); 77 saveRunningInfoToFile();
75 } 78 }
76} 79}
77 80
78void Todo::saveRunningInfoToFile() 81void Todo::saveRunningInfoToFile()
79{ 82{
80 qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); 83 qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1());
81 84
82 QString dir = KGlobalSettings::timeTrackerDir(); 85 QString dir = KGlobalSettings::timeTrackerDir();
83 qDebug("%s ", dir.latin1()); 86 qDebug("%s ", dir.latin1());
84 QString file = "%1-%2-%3-%4-%5-%6-%7.tt"; 87 QString file = "%1%2%3-%4%5%6-%7%8%9-";
85 88 int runtime = mRunStart.secsTo( QDateTime::currentDateTime() );
86 file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ).arg( mRunStart.time().msec(), 3 ); 89 runtime = (runtime / 60) +1;
90 int h = runtime / 60;
91 int m = runtime % 60;
92 int d = h / 24;
93 h = h % 24;
94 file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ).arg( d,3 ).arg( h,2 ).arg( m,2 );
87 file.replace ( QRegExp (" "), "0" ); 95 file.replace ( QRegExp (" "), "0" );
88 file = dir +"/" +file; 96 file = dir +"/" +file + uid()+".ics";
89 qDebug("%s ", file.latin1()); 97 qDebug("File %s ",file.latin1() );
90 QStringList dataList; 98 CalendarLocal cal;
91 99 cal.setTimeZoneId( " 00:00 Europe/London(UTC)" );
92 //Summary 100 cal.addIncidence( clone() );
93 //Category 101 ICalFormat format;
94 //CategoryColor 102 format.save( &cal, file );
95 //StartRuntime
96 //Runtime
97 //Due
98 //Start
99 //Prio
100 //Erledigt
101 //Uid
102 //Parents uids
103 103
104
105
106} 104}
107 105
108int Todo::runTime() 106int Todo::runTime()
109{ 107{
110 if ( !mRunning ) 108 if ( !mRunning )
111 return 0; 109 return 0;
112 return mRunStart.secsTo( QDateTime::currentDateTime() ); 110 return mRunStart.secsTo( QDateTime::currentDateTime() );
113} 111}
114bool Todo::hasRunningSub() 112bool Todo::hasRunningSub()
115{ 113{
116 if ( mRunning ) 114 if ( mRunning )
117 return true; 115 return true;
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 62a31ae..8efc1ea 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -317,27 +317,27 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
317 "NEEDS_ACTION"); 317 "NEEDS_ACTION");
318 // completion date 318 // completion date
319 if (anEvent->hasCompletedDate()) { 319 if (anEvent->hasCompletedDate()) {
320 tmpStr = qDateTimeToISO(anEvent->completed()); 320 tmpStr = qDateTimeToISO(anEvent->completed());
321 addPropValue(vtodo, VCCompletedProp, tmpStr.local8Bit()); 321 addPropValue(vtodo, VCCompletedProp, tmpStr.local8Bit());
322 } 322 }
323 323
324 // priority 324 // priority
325 tmpStr.sprintf("%i",anEvent->priority()); 325 tmpStr.sprintf("%i",anEvent->priority());
326 addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit()); 326 addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit());
327 327
328 // related event 328 // related event
329 if (anEvent->relatedTo()) { 329 if (anEvent->relatedToUid()) {
330 addPropValue(vtodo, VCRelatedToProp, 330 addPropValue(vtodo, VCRelatedToProp,
331 anEvent->relatedTo()->uid().local8Bit()); 331 anEvent->relatedToUid().local8Bit());
332 } 332 }
333 333
334 // categories 334 // categories
335 QStringList tmpStrList = anEvent->categories(); 335 QStringList tmpStrList = anEvent->categories();
336 tmpStr = ""; 336 tmpStr = "";
337 QString catStr; 337 QString catStr;
338 for ( QStringList::Iterator it = tmpStrList.begin(); 338 for ( QStringList::Iterator it = tmpStrList.begin();
339 it != tmpStrList.end(); 339 it != tmpStrList.end();
340 ++it ) { 340 ++it ) {
341 catStr = *it; 341 catStr = *it;
342 if (catStr[0] == ' ') 342 if (catStr[0] == ' ')
343 tmpStr += catStr.mid(1); 343 tmpStr += catStr.mid(1);
@@ -663,27 +663,27 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent)
663 } 663 }
664 } 664 }
665 665
666 // priority 666 // priority
667 tmpStr.sprintf("%i",anEvent->priority()); 667 tmpStr.sprintf("%i",anEvent->priority());
668 addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit()); 668 addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit());
669 669
670 // transparency 670 // transparency
671 tmpStr.sprintf("%i",anEvent->transparency()); 671 tmpStr.sprintf("%i",anEvent->transparency());
672 addPropValue(vevent, VCTranspProp, tmpStr.local8Bit()); 672 addPropValue(vevent, VCTranspProp, tmpStr.local8Bit());
673 673
674 // related event 674 // related event
675 if (anEvent->relatedTo()) { 675 if (anEvent->relatedToUid()) {
676 addPropValue(vevent, VCRelatedToProp, 676 addPropValue(vevent, VCRelatedToProp,
677 anEvent->relatedTo()->uid().local8Bit()); 677 anEvent->relatedToUid().local8Bit());
678 } 678 }
679 679
680 if (anEvent->pilotId()) { 680 if (anEvent->pilotId()) {
681 // pilot sync stuff 681 // pilot sync stuff
682 tmpStr.sprintf("%i",anEvent->pilotId()); 682 tmpStr.sprintf("%i",anEvent->pilotId());
683 addPropValue(vevent, XPilotIdProp, tmpStr.local8Bit()); 683 addPropValue(vevent, XPilotIdProp, tmpStr.local8Bit());
684 tmpStr.sprintf("%i",anEvent->syncStatus()); 684 tmpStr.sprintf("%i",anEvent->syncStatus());
685 addPropValue(vevent, XPilotStatusProp, tmpStr.local8Bit()); 685 addPropValue(vevent, XPilotStatusProp, tmpStr.local8Bit());
686 } 686 }
687 687
688 return vevent; 688 return vevent;
689} 689}
@@ -1595,29 +1595,33 @@ void VCalFormat::populate(VObject *vcal)
1595 // we have either already processed them or are ignoring them. 1595 // we have either already processed them or are ignoring them.
1596 ; 1596 ;
1597 } else { 1597 } else {
1598 kdDebug(5800) << "Ignoring unknown vObject \"" << vObjectName(curVO) << "\"" << endl; 1598 kdDebug(5800) << "Ignoring unknown vObject \"" << vObjectName(curVO) << "\"" << endl;
1599 } 1599 }
1600 SKIP: 1600 SKIP:
1601 ; 1601 ;
1602 } // while 1602 } // while
1603 1603
1604 // Post-Process list of events with relations, put Event objects in relation 1604 // Post-Process list of events with relations, put Event objects in relation
1605 Event *ev; 1605 Event *ev;
1606 for ( ev=mEventsRelate.first(); ev != 0; ev=mEventsRelate.next() ) { 1606 for ( ev=mEventsRelate.first(); ev != 0; ev=mEventsRelate.next() ) {
1607 ev->setRelatedTo(mCalendar->event(ev->relatedToUid())); 1607 Incidence * inc = mCalendar->event(ev->relatedToUid());
1608 if ( inc )
1609 ev->setRelatedTo( inc );
1608 } 1610 }
1609 Todo *todo; 1611 Todo *todo;
1610 for ( todo=mTodosRelate.first(); todo != 0; todo=mTodosRelate.next() ) { 1612 for ( todo=mTodosRelate.first(); todo != 0; todo=mTodosRelate.next() ) {
1611 todo->setRelatedTo(mCalendar->todo(todo->relatedToUid())); 1613 Incidence * inc = mCalendar->todo(todo->relatedToUid());
1614 if ( inc )
1615 todo->setRelatedTo( inc );
1612 } 1616 }
1613} 1617}
1614 1618
1615const char *VCalFormat::dayFromNum(int day) 1619const char *VCalFormat::dayFromNum(int day)
1616{ 1620{
1617 const char *days[7] = { "MO ", "TU ", "WE ", "TH ", "FR ", "SA ", "SU " }; 1621 const char *days[7] = { "MO ", "TU ", "WE ", "TH ", "FR ", "SA ", "SU " };
1618 1622
1619 return days[day]; 1623 return days[day];
1620} 1624}
1621 1625
1622int VCalFormat::numFromDay(const QString &day) 1626int VCalFormat::numFromDay(const QString &day)
1623{ 1627{
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index e54b0d9..b65ce66 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -33,25 +33,26 @@ QFont KGlobalSettings::generalMaxFont()
33 size = 18; 33 size = 18;
34#endif 34#endif
35 QFont f = QApplication::font(); 35 QFont f = QApplication::font();
36 if ( f.pointSize() > size ) 36 if ( f.pointSize() > size )
37 f.setPointSize( size ); 37 f.setPointSize( size );
38 return f; 38 return f;
39} 39}
40 40
41QString KGlobalSettings::timeTrackerDir() 41QString KGlobalSettings::timeTrackerDir()
42{ 42{
43 static QString dir; 43 static QString dir;
44 if ( dir.isEmpty() ) { 44 if ( dir.isEmpty() ) {
45 dir = locateLocal( "data", "timetracker" ); 45 dir = locateLocal( "data", "timetrackerdir/d.ttl" );
46 dir = dir.left ( dir.length() - 5);
46 } 47 }
47 return dir; 48 return dir;
48} 49}
49 50
50QFont KGlobalSettings::toolBarFont() 51QFont KGlobalSettings::toolBarFont()
51{ 52{
52 return QApplication::font(); 53 return QApplication::font();
53} 54}
54 55
55QColor KGlobalSettings::toolBarHighlightColor() 56QColor KGlobalSettings::toolBarHighlightColor()
56{ 57{
57 return QColor( "black" ); 58 return QColor( "black" );