-rw-r--r-- | korganizer/kolistview.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 0c1ac7a..8f17e6e 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -646,64 +646,69 @@ void KOListView::saveDescriptionToFile() | |||
646 | 646 | ||
647 | if ( fn == "" ) | 647 | if ( fn == "" ) |
648 | return; | 648 | return; |
649 | QFileInfo info; | 649 | QFileInfo info; |
650 | info.setFile( fn ); | 650 | info.setFile( fn ); |
651 | QString mes; | 651 | QString mes; |
652 | bool createbup = true; | 652 | bool createbup = true; |
653 | if ( info. exists() ) { | 653 | if ( info. exists() ) { |
654 | mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 654 | mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
655 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 655 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
656 | i18n("Overwrite!"), i18n("Cancel"), 0, | 656 | i18n("Overwrite!"), i18n("Cancel"), 0, |
657 | 0, 1 ); | 657 | 0, 1 ); |
658 | if ( result != 0 ) { | 658 | if ( result != 0 ) { |
659 | createbup = false; | 659 | createbup = false; |
660 | } | 660 | } |
661 | } | 661 | } |
662 | if ( createbup ) { | 662 | if ( createbup ) { |
663 | QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + | 663 | QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + |
664 | KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); | 664 | KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); |
665 | Incidence *incidence = delSel.first(); | 665 | Incidence *incidence = delSel.first(); |
666 | icount = 0; | 666 | icount = 0; |
667 | while ( incidence ) { | 667 | while ( incidence ) { |
668 | if ( incidence->typeID() == journalID ) { | 668 | if ( incidence->typeID() == journalID ) { |
669 | text += "\n************************************\n"; | 669 | text += "\n************************************\n"; |
670 | text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); | 670 | if ( !incidence->summary().isEmpty() ) |
671 | text += i18n("Journal: %1 from ").arg( incidence->summary() ) +incidence->dtStartDateStr( false ); | ||
672 | else | ||
673 | text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); | ||
674 | if ( !incidence->location().isEmpty() ) | ||
675 | text +="\n(" + i18n("Location: ") + incidence->location()+ ")"; | ||
671 | text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); | 676 | text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); |
672 | text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); | 677 | text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); |
673 | ++icount; | 678 | ++icount; |
674 | 679 | ||
675 | } else { | 680 | } else { |
676 | if ( !incidence->description().isEmpty() ) { | 681 | if ( !incidence->description().isEmpty() ) { |
677 | text += "\n************************************\n"; | 682 | text += "\n************************************\n"; |
678 | if ( incidence->typeID() == todoID ) | 683 | if ( incidence->typeID() == todoID ) |
679 | text += i18n("To-Do: "); | 684 | text += i18n("To-Do: "); |
680 | text += incidence->summary(); | 685 | text += incidence->summary(); |
686 | if ( !incidence->location().isEmpty() ) | ||
687 | text +="\n(" + i18n("Location: ") + incidence->location()+ ")"; | ||
681 | if ( incidence->hasStartDate() ) | 688 | if ( incidence->hasStartDate() ) |
682 | text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); | 689 | text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); |
683 | text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); | 690 | text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); |
684 | if ( !incidence->location().isEmpty() ) | ||
685 | text += "\n" +i18n("Location: ") + incidence->location(); | ||
686 | text += "\n" + i18n("Description: ") + "\n" + incidence->description(); | 691 | text += "\n" + i18n("Description: ") + "\n" + incidence->description(); |
687 | ++icount; | 692 | ++icount; |
688 | 693 | ||
689 | } | 694 | } |
690 | } | 695 | } |
691 | incidence = delSel.next(); | 696 | incidence = delSel.next(); |
692 | } | 697 | } |
693 | QFile file( fn ); | 698 | QFile file( fn ); |
694 | if (!file.open( IO_WriteOnly ) ) { | 699 | if (!file.open( IO_WriteOnly ) ) { |
695 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); | 700 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); |
696 | return; | 701 | return; |
697 | } | 702 | } |
698 | QTextStream ts( &file ); | 703 | QTextStream ts( &file ); |
699 | ts << text; | 704 | ts << text; |
700 | file.close(); | 705 | file.close(); |
701 | //qDebug("%s ", text.latin1()); | 706 | //qDebug("%s ", text.latin1()); |
702 | mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); | 707 | mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); |
703 | KOPrefs::instance()->mLastSaveFile = fn; | 708 | KOPrefs::instance()->mLastSaveFile = fn; |
704 | topLevelWidget()->setCaption(mes); | 709 | topLevelWidget()->setCaption(mes); |
705 | } | 710 | } |
706 | } | 711 | } |
707 | } | 712 | } |
708 | void KOListView::saveToFileVCS() | 713 | void KOListView::saveToFileVCS() |
709 | { | 714 | { |