summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Unidiff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index d0dbb47..acd9265 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -475,97 +475,97 @@ void KOListView::beamSelected()
475 ++icount; 475 ++icount;
476 } 476 }
477 477
478 item = item->nextSibling(); 478 item = item->nextSibling();
479 } 479 }
480 if ( icount ) { 480 if ( icount ) {
481 emit beamIncidenceList( delSel ); 481 emit beamIncidenceList( delSel );
482 return; 482 return;
483 QString fn ; 483 QString fn ;
484 fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs"; 484 fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs";
485 QString mes; 485 QString mes;
486 bool createbup = true; 486 bool createbup = true;
487 if ( createbup ) { 487 if ( createbup ) {
488 QString description = "\n"; 488 QString description = "\n";
489 CalendarLocal* cal = new CalendarLocal(); 489 CalendarLocal* cal = new CalendarLocal();
490 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 490 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
491 Incidence *incidence = delSel.first(); 491 Incidence *incidence = delSel.first();
492 while ( incidence ) { 492 while ( incidence ) {
493 Incidence *in = incidence->clone(); 493 Incidence *in = incidence->clone();
494 description += in->summary() + "\n"; 494 description += in->summary() + "\n";
495 cal->addIncidence( in ); 495 cal->addIncidence( in );
496 incidence = delSel.next(); 496 incidence = delSel.next();
497 } 497 }
498 FileStorage storage( cal, fn, new VCalFormat ); 498 FileStorage storage( cal, fn, new VCalFormat );
499 storage.save(); 499 storage.save();
500 delete cal; 500 delete cal;
501 mes = i18n("KO/Pi: Ready for beaming"); 501 mes = i18n("KO/Pi: Ready for beaming");
502 topLevelWidget()->setCaption(mes); 502 topLevelWidget()->setCaption(mes);
503 503
504#ifndef DESKTOP_VERSION 504#ifndef DESKTOP_VERSION
505 Ir *ir = new Ir( this ); 505 Ir *ir = new Ir( this );
506 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 506 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
507 ir->send( fn, description, "text/x-vCalendar" ); 507 ir->send( fn, description, "text/x-vCalendar" );
508#endif 508#endif
509 } 509 }
510 } 510 }
511} 511}
512void KOListView::beamDone( Ir *ir ) 512void KOListView::beamDone( Ir *ir )
513{ 513{
514#ifndef DESKTOP_VERSION 514#ifndef DESKTOP_VERSION
515 delete ir; 515 delete ir;
516#endif 516#endif
517 topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done")); 517 topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done"));
518} 518}
519 519
520void KOListView::saveDescriptionToFile() 520void KOListView::saveDescriptionToFile()
521{ 521{
522 522
523 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 523 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
524 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), 524 i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."),
525 i18n("Continue"), i18n("Cancel"), 0, 525 i18n("Continue"), i18n("Cancel"), 0,
526 0, 1 ); 526 0, 1 );
527 if ( result != 0 ) { 527 if ( result != 0 ) {
528 return; 528 return;
529 } 529 }
530 int icount = 0; 530 int icount = 0;
531 QPtrList<Incidence> delSel ; 531 QPtrList<Incidence> delSel ;
532 QListViewItem *item = mListView->firstChild (); 532 QListViewItem *item = mListView->firstChild ();
533 while ( item ) { 533 while ( item ) {
534 if ( item->isSelected() ) { 534 if ( item->isSelected() ) {
535 delSel.append(((KOListViewItem *)item)->data()); 535 delSel.append(((KOListViewItem *)item)->data());
536 ++icount; 536 ++icount;
537 } 537 }
538 538
539 item = item->nextSibling(); 539 item = item->nextSibling();
540 } 540 }
541 if ( icount ) { 541 if ( icount ) {
542 QString fn = KOPrefs::instance()->mLastSaveFile; 542 QString fn = KOPrefs::instance()->mLastSaveFile;
543 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 543 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
544 544
545 if ( fn == "" ) 545 if ( fn == "" )
546 return; 546 return;
547 QFileInfo info; 547 QFileInfo info;
548 info.setFile( fn ); 548 info.setFile( fn );
549 QString mes; 549 QString mes;
550 bool createbup = true; 550 bool createbup = true;
551 if ( info. exists() ) { 551 if ( info. exists() ) {
552 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 552 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
553 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 553 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
554 i18n("Overwrite!"), i18n("Cancel"), 0, 554 i18n("Overwrite!"), i18n("Cancel"), 0,
555 0, 1 ); 555 0, 1 );
556 if ( result != 0 ) { 556 if ( result != 0 ) {
557 createbup = false; 557 createbup = false;
558 } 558 }
559 } 559 }
560 if ( createbup ) { 560 if ( createbup ) {
561 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + 561 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") +
562 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); 562 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false);
563 Incidence *incidence = delSel.first(); 563 Incidence *incidence = delSel.first();
564 icount = 0; 564 icount = 0;
565 while ( incidence ) { 565 while ( incidence ) {
566 if ( incidence->type() == "Journal" ) { 566 if ( incidence->type() == "Journal" ) {
567 text += "\n************************************\n"; 567 text += "\n************************************\n";
568 text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); 568 text += i18n("Journal from: ") +incidence->dtStartDateStr( false );
569 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 569 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
570 text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); 570 text +="\n" + i18n("Description: ") + "\n"+ incidence->description();
571 ++icount; 571 ++icount;