summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendar.h1
-rw-r--r--libkcal/calendarlocal.cpp10
-rw-r--r--libkcal/calendarlocal.h1
-rw-r--r--libkcal/incidencebase.cpp2
4 files changed, 14 insertions, 0 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 2243e28..3b7b183 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -73,12 +73,13 @@ public:
73 /** 73 /**
74 Clears out the current calendar, freeing all used memory etc. 74 Clears out the current calendar, freeing all used memory etc.
75 */ 75 */
76 virtual void close() = 0; 76 virtual void close() = 0;
77 virtual void addCalendar( Calendar* ) = 0; 77 virtual void addCalendar( Calendar* ) = 0;
78 virtual bool addCalendarFile( QString name, int id ) = 0; 78 virtual bool addCalendarFile( QString name, int id ) = 0;
79 virtual void setSyncEventsReadOnly() = 0;
79 80
80 /** 81 /**
81 Sync changes in memory to persistant storage. 82 Sync changes in memory to persistant storage.
82 */ 83 */
83 virtual void save() = 0; 84 virtual void save() = 0;
84 virtual QPtrList<Event> getExternLastSyncEvents() = 0; 85 virtual QPtrList<Event> getExternLastSyncEvents() = 0;
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 336c3e8..8c4dde1 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -75,12 +75,22 @@ bool CalendarLocal::addCalendarFile( QString name, int id )
75 if ( calendar.load( name ) ) { 75 if ( calendar.load( name ) ) {
76 addCalendar( &calendar ); 76 addCalendar( &calendar );
77 return true; 77 return true;
78 } 78 }
79 return false; 79 return false;
80} 80}
81void CalendarLocal::setSyncEventsReadOnly()
82{
83 Event * ev;
84 ev = mEventList.first();
85 while ( ev ) {
86 if ( ev->uid().left(15) == QString("last-syncEvent-") )
87 ev->setReadOnly( true );
88 ev = mEventList.next();
89 }
90}
81void CalendarLocal::addCalendar( Calendar* cal ) 91void CalendarLocal::addCalendar( Calendar* cal )
82{ 92{
83 cal->setDontDeleteIncidencesOnClose(); 93 cal->setDontDeleteIncidencesOnClose();
84 { 94 {
85 QPtrList<Event> EventList = cal->rawEvents(); 95 QPtrList<Event> EventList = cal->rawEvents();
86 Event * ev = EventList.first(); 96 Event * ev = EventList.first();
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 5bbe55f..0286b48 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -42,12 +42,13 @@ class CalendarLocal : public Calendar
42 Constructs a new calendar, with variables initialized to sane values. 42 Constructs a new calendar, with variables initialized to sane values.
43 */ 43 */
44 CalendarLocal( const QString &timeZoneId ); 44 CalendarLocal( const QString &timeZoneId );
45 ~CalendarLocal(); 45 ~CalendarLocal();
46 void addCalendar( Calendar* ); 46 void addCalendar( Calendar* );
47 bool addCalendarFile( QString name, int id ); 47 bool addCalendarFile( QString name, int id );
48 void setSyncEventsReadOnly();
48 /** 49 /**
49 Loads a calendar on disk in vCalendar or iCalendar format into the current 50 Loads a calendar on disk in vCalendar or iCalendar format into the current
50 calendar. Any information already present is lost. 51 calendar. Any information already present is lost.
51 @return true, if successfull, false on error. 52 @return true, if successfull, false on error.
52 @param fileName the name of the calendar on disk. 53 @param fileName the name of the calendar on disk.
53 */ 54 */
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 2ddbb01..96039df 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -138,12 +138,14 @@ QDateTime IncidenceBase::getEvenTime( QDateTime dt )
138 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 138 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
139 return dt; 139 return dt;
140} 140}
141 141
142void IncidenceBase::setCalID( int id ) 142void IncidenceBase::setCalID( int id )
143{ 143{
144 if ( mCalID > 0 )
145 updated();
144 mCalID = id; 146 mCalID = id;
145} 147}
146int IncidenceBase::calID() const 148int IncidenceBase::calID() const
147{ 149{
148 return mCalID; 150 return mCalID;
149} 151}