author | zautrix <zautrix> | 2005-06-15 18:23:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-15 18:23:08 (UTC) |
commit | ccfe3f97afd65c75ee6c7c931cb3694919a4e29b (patch) (unidiff) | |
tree | 117d3467ef1d9678f31dea1b506390707f88d94a /libkcal | |
parent | cba0ac17d3d505805be6aa4b4fea6f63473a1e00 (diff) | |
download | kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.zip kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.tar.gz kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.tar.bz2 |
fixess
-rw-r--r-- | libkcal/calendar.h | 1 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 10 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 1 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 2 |
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 | |||
@@ -67,24 +67,25 @@ public: | |||
67 | virtual ~Calendar(); | 67 | virtual ~Calendar(); |
68 | Incidence * undoIncidence() { return mUndoIncidence; }; | 68 | Incidence * undoIncidence() { return mUndoIncidence; }; |
69 | bool undoDeleteIncidence(); | 69 | bool undoDeleteIncidence(); |
70 | void deleteIncidence(Incidence *in); | 70 | void deleteIncidence(Incidence *in); |
71 | void resetTempSyncStat(); | 71 | void resetTempSyncStat(); |
72 | void resetPilotStat(int id); | 72 | void resetPilotStat(int id); |
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; |
85 | virtual void removeSyncInfo( QString syncProfile) = 0; | 86 | virtual void removeSyncInfo( QString syncProfile) = 0; |
86 | virtual bool isSaving() { return false; } | 87 | virtual bool isSaving() { return false; } |
87 | 88 | ||
88 | /** | 89 | /** |
89 | Return the owner of the calendar's full name. | 90 | Return the owner of the calendar's full name. |
90 | */ | 91 | */ |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 336c3e8..8c4dde1 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -69,24 +69,34 @@ CalendarLocal::~CalendarLocal() | |||
69 | close(); | 69 | close(); |
70 | } | 70 | } |
71 | bool CalendarLocal::addCalendarFile( QString name, int id ) | 71 | bool CalendarLocal::addCalendarFile( QString name, int id ) |
72 | { | 72 | { |
73 | CalendarLocal calendar( timeZoneId() ); | 73 | CalendarLocal calendar( timeZoneId() ); |
74 | calendar.setDefaultCalendar( id ); | 74 | calendar.setDefaultCalendar( 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 | } |
81 | void 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 | } | ||
81 | void CalendarLocal::addCalendar( Calendar* cal ) | 91 | void 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(); |
87 | while ( ev ) { | 97 | while ( ev ) { |
88 | ev->unRegisterObserver( cal ); | 98 | ev->unRegisterObserver( cal ); |
89 | ev->registerObserver( this ); | 99 | ev->registerObserver( this ); |
90 | mEventList.append( ev ); | 100 | mEventList.append( ev ); |
91 | ev = EventList.next(); | 101 | ev = EventList.next(); |
92 | } | 102 | } |
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index 5bbe55f..0286b48 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h | |||
@@ -36,24 +36,25 @@ class CalendarLocal : public Calendar | |||
36 | public: | 36 | public: |
37 | /** | 37 | /** |
38 | Constructs a new calendar, with variables initialized to sane values. | 38 | Constructs a new calendar, with variables initialized to sane values. |
39 | */ | 39 | */ |
40 | CalendarLocal(); | 40 | CalendarLocal(); |
41 | /** | 41 | /** |
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 | */ |
54 | bool load( const QString &fileName ); | 55 | bool load( const QString &fileName ); |
55 | /** | 56 | /** |
56 | Writes out the calendar to disk in the specified \a format. | 57 | Writes out the calendar to disk in the specified \a format. |
57 | CalendarLocal takes ownership of the CalFormat object. | 58 | CalendarLocal takes ownership of the CalFormat object. |
58 | @return true, if successfull, false on error. | 59 | @return true, if successfull, false on error. |
59 | @param fileName the name of the file | 60 | @param fileName the name of the file |
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 2ddbb01..96039df 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -132,24 +132,26 @@ bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 ) | |||
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | QDateTime IncidenceBase::getEvenTime( QDateTime dt ) | 135 | QDateTime IncidenceBase::getEvenTime( QDateTime dt ) |
136 | { | 136 | { |
137 | QTime t = dt.time(); | 137 | QTime t = dt.time(); |
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 | ||
142 | void IncidenceBase::setCalID( int id ) | 142 | void IncidenceBase::setCalID( int id ) |
143 | { | 143 | { |
144 | if ( mCalID > 0 ) | ||
145 | updated(); | ||
144 | mCalID = id; | 146 | mCalID = id; |
145 | } | 147 | } |
146 | int IncidenceBase::calID() const | 148 | int IncidenceBase::calID() const |
147 | { | 149 | { |
148 | return mCalID; | 150 | return mCalID; |
149 | } | 151 | } |
150 | void IncidenceBase::setCalEnabled( bool b ) | 152 | void IncidenceBase::setCalEnabled( bool b ) |
151 | { | 153 | { |
152 | mCalEnabled = b; | 154 | mCalEnabled = b; |
153 | } | 155 | } |
154 | bool IncidenceBase::calEnabled() const | 156 | bool IncidenceBase::calEnabled() const |
155 | { | 157 | { |