-rw-r--r-- | korganizer/kolistview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index f235705..3519985 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -621,16 +621,27 @@ void KOListView::writeToFile( bool iCal ) | |||
621 | 621 | ||
622 | int icount = 0; | 622 | int icount = 0; |
623 | QPtrList<Incidence> delSel ; | 623 | QPtrList<Incidence> delSel ; |
624 | QListViewItem *item = mListView->firstChild (); | 624 | QListViewItem *item = mListView->firstChild (); |
625 | bool journal = iCal; // warn only for vCal | ||
625 | while ( item ) { | 626 | while ( item ) { |
626 | if ( item->isSelected() ) { | 627 | if ( item->isSelected() ) { |
628 | if ( !journal ) | ||
629 | if ( ((KOListViewItem *)item)->data()->type() == "Journal") | ||
630 | journal = true; | ||
627 | delSel.append(((KOListViewItem *)item)->data()); | 631 | delSel.append(((KOListViewItem *)item)->data()); |
628 | ++icount; | 632 | ++icount; |
629 | } | 633 | } |
630 | 634 | ||
631 | item = item->nextSibling(); | 635 | item = item->nextSibling(); |
632 | } | 636 | } |
637 | if ( !iCal && journal ) { | ||
638 | int result = KMessageBox::warningContinueCancel(this, | ||
639 | i18n("The journal entries can not be\nexported to a vCalendar file."), | ||
640 | i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), | ||
641 | true); | ||
642 | if (result != KMessageBox::Continue) return; | ||
643 | } | ||
633 | if ( icount ) { | 644 | if ( icount ) { |
634 | QString fn = KOPrefs::instance()->mLastSaveFile; | 645 | QString fn = KOPrefs::instance()->mLastSaveFile; |
635 | QString extension; | 646 | QString extension; |
636 | if ( iCal ) { | 647 | if ( iCal ) { |
@@ -670,8 +681,9 @@ void KOListView::writeToFile( bool iCal ) | |||
670 | if ( iCal ) { | 681 | if ( iCal ) { |
671 | ICalFormat format; | 682 | ICalFormat format; |
672 | format.save( &cal, fn ); | 683 | format.save( &cal, fn ); |
673 | } else { | 684 | } else { |
685 | |||
674 | VCalFormat format; | 686 | VCalFormat format; |
675 | format.save( &cal, fn ); | 687 | format.save( &cal, fn ); |
676 | } | 688 | } |
677 | mes = i18n("KO/Pi:Saved %1").arg(fn ); | 689 | mes = i18n("KO/Pi:Saved %1").arg(fn ); |