summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
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
@@ -67,24 +67,25 @@ public:
virtual ~Calendar();
Incidence * undoIncidence() { return mUndoIncidence; };
bool undoDeleteIncidence();
void deleteIncidence(Incidence *in);
void resetTempSyncStat();
void resetPilotStat(int id);
/**
Clears out the current calendar, freeing all used memory etc.
*/
virtual void close() = 0;
virtual void addCalendar( Calendar* ) = 0;
virtual bool addCalendarFile( QString name, int id ) = 0;
+ virtual void setSyncEventsReadOnly() = 0;
/**
Sync changes in memory to persistant storage.
*/
virtual void save() = 0;
virtual QPtrList<Event> getExternLastSyncEvents() = 0;
virtual void removeSyncInfo( QString syncProfile) = 0;
virtual bool isSaving() { return false; }
/**
Return the owner of the calendar's full name.
*/
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()
close();
}
bool CalendarLocal::addCalendarFile( QString name, int id )
{
CalendarLocal calendar( timeZoneId() );
calendar.setDefaultCalendar( id );
if ( calendar.load( name ) ) {
addCalendar( &calendar );
return true;
}
return false;
}
+void CalendarLocal::setSyncEventsReadOnly()
+{
+ Event * ev;
+ ev = mEventList.first();
+ while ( ev ) {
+ if ( ev->uid().left(15) == QString("last-syncEvent-") )
+ ev->setReadOnly( true );
+ ev = mEventList.next();
+ }
+}
void CalendarLocal::addCalendar( Calendar* cal )
{
cal->setDontDeleteIncidencesOnClose();
{
QPtrList<Event> EventList = cal->rawEvents();
Event * ev = EventList.first();
while ( ev ) {
ev->unRegisterObserver( cal );
ev->registerObserver( this );
mEventList.append( ev );
ev = EventList.next();
}
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
public:
/**
Constructs a new calendar, with variables initialized to sane values.
*/
CalendarLocal();
/**
Constructs a new calendar, with variables initialized to sane values.
*/
CalendarLocal( const QString &timeZoneId );
~CalendarLocal();
void addCalendar( Calendar* );
bool addCalendarFile( QString name, int id );
+ void setSyncEventsReadOnly();
/**
Loads a calendar on disk in vCalendar or iCalendar format into the current
calendar. Any information already present is lost.
@return true, if successfull, false on error.
@param fileName the name of the calendar on disk.
*/
bool load( const QString &fileName );
/**
Writes out the calendar to disk in the specified \a format.
CalendarLocal takes ownership of the CalFormat object.
@return true, if successfull, false on error.
@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 )
}
QDateTime IncidenceBase::getEvenTime( QDateTime dt )
{
QTime t = dt.time();
dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
return dt;
}
void IncidenceBase::setCalID( int id )
{
+ if ( mCalID > 0 )
+ updated();
mCalID = id;
}
int IncidenceBase::calID() const
{
return mCalID;
}
void IncidenceBase::setCalEnabled( bool b )
{
mCalEnabled = b;
}
bool IncidenceBase::calEnabled() const
{