-rw-r--r-- | korganizer/kofilterview.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 7ce3f1f..6a6fff9 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -365,7 +365,7 @@ void KOCalEditView::defaultInfo() | |||
365 | void KOCalEditView::addCal() | 365 | void KOCalEditView::addCal() |
366 | { | 366 | { |
367 | bool tryagain = true; | 367 | bool tryagain = true; |
368 | QString name, file; | 368 | QString name, file = KGlobalSettings::calendarDir()+"newCal.ics"; |
369 | while ( tryagain ) { | 369 | while ( tryagain ) { |
370 | KONewCalPrefs prefs ( this ); | 370 | KONewCalPrefs prefs ( this ); |
371 | prefs.nameE->setText( name ); | 371 | prefs.nameE->setText( name ); |
@@ -386,11 +386,15 @@ void KOCalEditView::addCal() | |||
386 | if ( kkf->mFileName == file ) { | 386 | if ( kkf->mFileName == file ) { |
387 | KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); | 387 | KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); |
388 | tryagain = true; | 388 | tryagain = true; |
389 | file = ""; | 389 | file = KGlobalSettings::calendarDir()+"newCal.ics"; |
390 | break; | 390 | break; |
391 | } | 391 | } |
392 | kkf = KOPrefs::instance()->mCalendars.next(); | 392 | kkf = KOPrefs::instance()->mCalendars.next(); |
393 | } | 393 | } |
394 | QFileInfo fi ( file ); | ||
395 | if ( fi.isDir() ) { | ||
396 | tryagain = true; | ||
397 | } | ||
394 | } | 398 | } |
395 | addCalendar ( name, file ); | 399 | addCalendar ( name, file ); |
396 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); | 400 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); |