summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1338224..377a66f 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1856,8 +1856,4 @@ bool CalendarView::loadCalendars()
}
restoreCalendarSettings();
- mCalendar->reInitAlarmSettings();
- setSyncEventsReadOnly();
- updateUnmanagedViews();
- updateView();
return true;
}
@@ -1874,4 +1870,8 @@ bool CalendarView::restoreCalendarSettings()
cal = calendars.next();
}
+ setSyncEventsReadOnly();
+ mCalendar->reInitAlarmSettings();
+ updateUnmanagedViews();
+ updateView();
return true;
}
@@ -1996,10 +1996,14 @@ bool CalendarView::checkAllFileVersions()
mCalendar->setDefaultCalendar( 1 );
mCalendar->setDefaultCalendarEnabledOnly();
- if ( !checkFileVersion(MainWindow::defaultFileName()))
+ if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
+ if ( !checkFileVersion(MainWindow::defaultFileName())) {
+ restoreCalendarSettings();
return false;
+ }
+ }
cal = calendars.next();
QDateTime storeTemp = loadedFileVersion;
while ( cal ) {
- if ( !cal->mErrorOnLoad ) {
+ if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
mCalendar->setDefaultCalendar( cal->mCalNumber );
mCalendar->setDefaultCalendarEnabledOnly();
@@ -2007,5 +2011,5 @@ bool CalendarView::checkAllFileVersions()
if ( !checkFileVersion(cal->mFileName )) {
loadedFileVersion = storeTemp;
- updateView();
+ restoreCalendarSettings();
return false;
}
@@ -2014,5 +2018,4 @@ bool CalendarView::checkAllFileVersions()
}
loadedFileVersion = storeTemp;
- updateView();
return true;
}
@@ -2023,6 +2026,6 @@ bool CalendarView::checkFileVersion(QString fn)
return true;
QDateTime dt = finf.lastModified ();
- //qDebug("loaded file version %s",loadedFileVersion.toString().latin1());
- //qDebug("file on disk version %s",dt.toString().latin1());
+ qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1());
+ qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1());
if ( dt <= loadedFileVersion )
return true;