summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp12
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
@@ -617,24 +617,35 @@ void KOListView::saveToFile()
writeToFile( true );
}
void KOListView::writeToFile( bool iCal )
{
int icount = 0;
QPtrList<Incidence> delSel ;
QListViewItem *item = mListView->firstChild ();
+ bool journal = iCal; // warn only for vCal
while ( item ) {
if ( item->isSelected() ) {
+ if ( !journal )
+ if ( ((KOListViewItem *)item)->data()->type() == "Journal")
+ journal = true;
delSel.append(((KOListViewItem *)item)->data());
++icount;
}
item = item->nextSibling();
}
+ if ( !iCal && journal ) {
+ int result = KMessageBox::warningContinueCancel(this,
+ i18n("The journal entries can not be\nexported to a vCalendar file."),
+ i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
+ true);
+ if (result != KMessageBox::Continue) return;
+ }
if ( icount ) {
QString fn = KOPrefs::instance()->mLastSaveFile;
QString extension;
if ( iCal ) {
if ( fn.right( 4 ).lower() == ".vcs" ) {
fn = fn.left( fn.length() -3) + "ics";
}
} else {
@@ -666,16 +677,17 @@ void KOListView::writeToFile( bool iCal )
while ( incidence ) {
cal.addIncidence( incidence->clone() );
incidence = delSel.next();
}
if ( iCal ) {
ICalFormat format;
format.save( &cal, fn );
} else {
+
VCalFormat format;
format.save( &cal, fn );
}
mes = i18n("KO/Pi:Saved %1").arg(fn );
KOPrefs::instance()->mLastSaveFile = fn;
topLevelWidget()->setCaption(mes);
}
}