-rw-r--r-- | korganizer/calendarview.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index ca071b2..26323b1 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2518,65 +2518,64 @@ bool CalendarView::checkFileVersion(QString fn) mSyncManager->mSyncAlgoPrefs = 3; mSyncManager->mWriteBackFile = false; mSyncManager->mWriteBackExistingOnly = false; mSyncManager->mShowSyncSummary = false; syncCalendar( fn, 3 ); Event * e = getLastSyncEvent(); if ( e ) mCalendar->deleteEvent( e ); return true; } bool CalendarView::saveCalendars() { QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); QString saveError; if ( !saveCalendar( MainWindow::defaultFileName() ) ) saveError = cal->mName +"\n"; cal = calendars.next(); while ( cal ) { if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { mCalendar->setDefaultCalendar( cal->mCalNumber ); mCalendar->setDefaultCalendarEnabledOnly(); if ( saveCalendar( cal->mFileName ) ) cal->mLoadDt = QDateTime::currentDateTime(); else saveError += cal->mName + "\n"; } cal = calendars.next(); } restoreCalendarSettings(); - if ( !saveError.isEmpty() ) { saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError; KMessageBox::error(this, saveError, i18n("Error saving data")); return false; } return true; } bool CalendarView::saveCalendar( QString filename ) { // Store back all unsaved data into calendar object // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); if ( mViewManager->currentView() ) mViewManager->currentView()->flushView(); QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); mStorage->setSaveFormat( new ICalFormat() ); mStorage->setFileName( filename ); bool success; success = mStorage->save(); if ( !success ) { return false; } if ( filename == MainWindow::defaultFileName() ) { setLoadedFileVersion( lfv ); watchSavedFile(); } return true; } void CalendarView::closeCalendar() |