-rw-r--r-- | korganizer/calendarview.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index eaea040..fecc7e2 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1221,14 +1221,14 @@ bool CalendarView::syncCalendar(QString filename, int mode) | |||
1221 | bool syncOK = false; | 1221 | bool syncOK = false; |
1222 | storage->setFileName( filename ); | 1222 | storage->setFileName( filename ); |
1223 | // qDebug("loading ... "); | 1223 | // qDebug("loading ... "); |
1224 | if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { | 1224 | if ( storage->load() ) { |
1225 | getEventViewerDialog()->setSyncMode( true ); | 1225 | getEventViewerDialog()->setSyncMode( true ); |
1226 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); | 1226 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); |
1227 | getEventViewerDialog()->setSyncMode( false ); | 1227 | getEventViewerDialog()->setSyncMode( false ); |
1228 | if ( syncOK ) { | 1228 | if ( syncOK ) { |
1229 | if ( KOPrefs::instance()->mWriteBackFile ) | 1229 | if ( KOPrefs::instance()->mWriteBackFile ) |
1230 | { | 1230 | { |
1231 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 1231 | storage->setSaveFormat( new ICalFormat() ); |
1232 | storage->save(); | 1232 | storage->save(); |
1233 | } | 1233 | } |
1234 | } | 1234 | } |
@@ -1499,7 +1499,7 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1499 | 1499 | ||
1500 | mStorage->setFileName( filename ); | 1500 | mStorage->setFileName( filename ); |
1501 | 1501 | ||
1502 | if ( mStorage->load(KOPrefs::instance()->mUseQuicksave) ) { | 1502 | if ( mStorage->load() ) { |
1503 | if ( merge ) ;//setModified( true ); | 1503 | if ( merge ) ;//setModified( true ); |
1504 | else { | 1504 | else { |
1505 | //setModified( true ); | 1505 | //setModified( true ); |
@@ -1514,9 +1514,11 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1514 | setSyncEventsReadOnly(); | 1514 | setSyncEventsReadOnly(); |
1515 | updateUnmanagedViews(); | 1515 | updateUnmanagedViews(); |
1516 | updateView(); | 1516 | updateView(); |
1517 | if ( filename != MainWindow::defaultFileName() ) | ||
1518 | saveCalendar( MainWindow::defaultFileName() ); | ||
1519 | loadedFileVersion = QDateTime::currentDateTime(); | 1517 | loadedFileVersion = QDateTime::currentDateTime(); |
1518 | if ( filename != MainWindow::defaultFileName() ) { | ||
1519 | saveCalendar( MainWindow::defaultFileName() ); | ||
1520 | watchSavedFile(); | ||
1521 | } | ||
1520 | return true; | 1522 | return true; |
1521 | } else { | 1523 | } else { |
1522 | // while failing to load, the calendar object could | 1524 | // while failing to load, the calendar object could |
@@ -1600,7 +1602,7 @@ bool CalendarView::saveCalendar( QString filename ) | |||
1600 | 1602 | ||
1601 | //mStorage->setFileName( filename ); | 1603 | //mStorage->setFileName( filename ); |
1602 | 1604 | ||
1603 | mStorage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 1605 | mStorage->setSaveFormat( new ICalFormat() ); |
1604 | mStorage->setFileName( filename ); | 1606 | mStorage->setFileName( filename ); |
1605 | bool success; | 1607 | bool success; |
1606 | success = mStorage->save(); | 1608 | success = mStorage->save(); |
@@ -2301,7 +2303,7 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | |||
2301 | storage.save(); | 2303 | storage.save(); |
2302 | } else { | 2304 | } else { |
2303 | fn += ".ics"; | 2305 | fn += ".ics"; |
2304 | FileStorage storage( cal, fn, new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 2306 | FileStorage storage( cal, fn, new ICalFormat( ) ); |
2305 | storage.save(); | 2307 | storage.save(); |
2306 | } | 2308 | } |
2307 | delete cal; | 2309 | delete cal; |
@@ -2856,7 +2858,7 @@ void CalendarView::action_mail() | |||
2856 | ev = new Event(*event); | 2858 | ev = new Event(*event); |
2857 | cal_tmp.addEvent(ev); | 2859 | cal_tmp.addEvent(ev); |
2858 | } | 2860 | } |
2859 | ICalFormat mForm( KOPrefs::instance()->mUseQuicksave); | 2861 | ICalFormat mForm(); |
2860 | QString attachment = mForm.toString( &cal_tmp ); | 2862 | QString attachment = mForm.toString( &cal_tmp ); |
2861 | if (ev) delete(ev); | 2863 | if (ev) delete(ev); |
2862 | 2864 | ||
@@ -3141,7 +3143,7 @@ void CalendarView::exportICalendar() | |||
3141 | // Force correct extension | 3143 | // Force correct extension |
3142 | if (filename.right(4) != ".ics") filename += ".ics"; | 3144 | if (filename.right(4) != ".ics") filename += ".ics"; |
3143 | 3145 | ||
3144 | FileStorage storage( mCalendar, filename, new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 3146 | FileStorage storage( mCalendar, filename, new ICalFormat() ); |
3145 | storage.save(); | 3147 | storage.save(); |
3146 | } | 3148 | } |
3147 | 3149 | ||