-rw-r--r-- | korganizer/calendarview.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index c0f3be7..fd026fa 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -684,6 +684,20 @@ void CalendarView::scrollBarValue(int val ) void CalendarView::checkAlarms() { + + QString message; + QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + KopiCalendarFile * cal = calendars.first(); + while ( cal ) { + if ( cal->mErrorOnLoad ) { + message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; + } + cal = calendars.next(); + } + if ( !message.isEmpty() ) { + message = KGlobal::formatMessage( i18n("The loading of one or more calendar failed:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); + KMessageBox::error(this,message); + } KConfig *config = KOGlobals::config(); config->setGroup( "AppRun" ); QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); @@ -1923,7 +1937,8 @@ bool CalendarView::restoreCalendarSettings() void CalendarView::addCalendarId( int id ) { KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); - addCalendar( cal ); + if ( cal ) + addCalendar( cal ); } bool CalendarView::addCalendar( KopiCalendarFile * cal ) { @@ -1932,8 +1947,7 @@ bool CalendarView::addCalendar( KopiCalendarFile * cal ) cal->mLoadDt = QDateTime::currentDateTime(); return true; } - qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() ); - KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName)); + qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); cal->mErrorOnLoad = true; return false; } |