-rw-r--r-- | libkcal/calendar.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 52daaaa..88351eb 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -39,33 +39,33 @@ Calendar::Calendar() init(); setTimeZoneId( i18n (" 00:00 Europe/London(UTC)") ); } Calendar::Calendar( const QString &timeZoneId ) { init(); setTimeZoneId(timeZoneId); } void Calendar::init() { mObserver = 0; mNewObserver = false; - + mUndoIncidence = 0; mModified = false; // Setup default filter, which does nothing mDefaultFilter = new CalFilter; mFilter = mDefaultFilter; mFilter->setEnabled(false); // initialize random numbers. This is a hack, and not // even that good of one at that. // srandom(time(0)); // user information... setOwner(i18n("Unknown Name")); setEmail(i18n("unknown@nowhere")); #if 0 @@ -96,39 +96,48 @@ void Calendar::init() // to rewrite these settings to the config file. if ((now->tm_isdst && !dstSetting) || (!now->tm_isdst && dstSetting)) { KOPrefs::instance()->mTimeZone = tzStr; KOPrefs::instance()->mDaylightSavings = now->tm_isdst; } setTimeZone(tzStr); #endif // KOPrefs::instance()->writeConfig(); } Calendar::~Calendar() { delete mDefaultFilter; + if ( mUndoIncidence ) + delete mUndoIncidence; } const QString &Calendar::getOwner() const { return mOwner; } +bool Calendar::undoDeleteIncidence() +{ + if (!mUndoIncidence) + return false; + addIncidence(mUndoIncidence); + mUndoIncidence = 0; +} void Calendar::setOwner(const QString &os) { int i; mOwner = os; i = mOwner.find(','); if (i != -1) mOwner = mOwner.left(i); setModified( true ); } void Calendar::setTimeZone(const QString & tz) { bool neg = FALSE; int hours, minutes; QString tmpStr(tz); |