[korganizer] /: Remove vCalendar export

Volker Krause null at kde.org
Thu Sep 14 09:39:01 UTC 2017


Git commit f77490d367402ae76f5084b7ef093aa56502f2c2 by Volker Krause.
Committed on 14/09/2017 at 09:37.
Pushed by vkrause into branch 'master'.

Remove vCalendar export

Leaving aside the fact that vCalendar is the 20+ year old obsolete
predecessor of iCal, the main reason for this is that a QTimeZone
based KCalCore wont be able to serialize vCalendar "timezones" anymore.
Import of legacy files is not affected.

M  +5    -22   doc/index.docbook
M  +0    -26   src/actionmanager.cpp
M  +0    -50   src/calendarview.cpp
M  +0    -3    src/calendarview.h
M  +1    -2    src/data/korganizer_part.rc
M  +1    -2    src/data/korganizerui.rc

https://commits.kde.org/korganizer/f77490d367402ae76f5084b7ef093aa56502f2c2

diff --git a/doc/index.docbook b/doc/index.docbook
index 2244c8fb..2481c399 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -529,9 +529,8 @@ store.kde.org KOrganizer Calendars-->
 <sect2 id="managing-export">
 <title>Exporting Calendars</title>
 
-<para>You can export your data as an iCalendar or
-vCalendar file, which are supported by most scheduling applications.
-Either way, &korganizer; will export all calendar
+<para>You can export your data as an iCalendar file, which is supported by
+most scheduling applications. &korganizer; will export all calendar
 items from the enabled (checked) resources which are
 <link linkend="filters-view">not filtered out</link> (let's call these items
 <quote>active</quote> items). In other words, if you cannot see a calendar
@@ -547,10 +546,8 @@ sidebar.</para>
 <para>To export all your <quote>active</quote> events, to-dos and journal entries
 (independent of to what resource they belong) as a new iCalendar
 file, choose the <menuchoice><guimenu>File</guimenu><guisubmenu>Export</guisubmenu>
-<guimenuitem>Export as iCalendar...</guimenuitem></menuchoice> menu item. To export the same
-data as a new vCalendar file choose the <menuchoice><guimenu>File</guimenu>
-<guisubmenu>Export</guisubmenu> <guimenuitem>Export as vCalendar...</guimenuitem>
-</menuchoice> menu item. The <guilabel>Save As</guilabel> dialog will pop up.
+<guimenuitem>Export as iCalendar...</guimenuitem></menuchoice> menu item.
+The <guilabel>Save As</guilabel> dialog will pop up.
 Enter the file name and location for the new file to complete the export
 action.</para>
 
@@ -1219,7 +1216,7 @@ information depends on the client and/or groupware server implementation.</para>
 <warning><para>Currently, &korganizer; <emphasis>will</emphasis> display
 items owned by other people and marked as confidential. Other
 clients may treat them differently, but be careful when publishing private or
-confidential events: vCalendar and iCalendar are text files, and can be read
+confidential events: iCalendar is a text file format, and can be read
 with any text editor (if someone has read access to them). So if you want to
 keep items really confidential, make sure you use a resource that
 only you can access.</para></warning></listitem>
@@ -2897,20 +2894,6 @@ file.</para>
 </listitem>
 </varlistentry>
 
-<varlistentry id="menu-file-export-vcalendar">
-<term><menuchoice>
-<guimenu>File</guimenu>
-<guisubmenu>Export</guisubmenu>
-<guimenuitem>Export as vCalendar</guimenuitem>
-</menuchoice></term>
-<listitem><para>This action will export all your active events, to-dos and
-journal entries (independent of to which resource they belong) as a new vCalendar
-file.</para>
-<para>For more information about this action, please refer to
-<xref linkend="managing-export" />.</para>
-</listitem>
-</varlistentry>
-
 <!--not in 4.6.0
 varlistentry id="menu-file-export-ghns">
 <term><menuchoice>
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index 7ff830b0..acd27f53 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -286,10 +286,6 @@ void ActionManager::initActions()
     mACollection->addAction(QStringLiteral("export_icalendar"), action);
     connect(action, &QAction::triggered, mCalendarView, &CalendarView::exportICalendar);
 
-    action = new QAction(i18n("Export as &vCalendar..."), this);
-    mACollection->addAction(QStringLiteral("export_vcalendar"), action);
-    connect(action, &QAction::triggered, mCalendarView, &CalendarView::exportVCalendar);
-
     //Laurent: 2009-03-24 comment it until upload will implement
     //action = new QAction( i18n( "Upload &Hot New Stuff..." ), this );
     //mACollection->addAction( "uploadnewstuff", action );
@@ -923,28 +919,6 @@ bool ActionManager::saveURL()
         ext = mURL.fileName().right(4);
     }
 
-    if (ext == QLatin1String(".vcs")) {
-        int result = KMessageBox::warningContinueCancel(
-                         dialogParent(),
-                         i18n("Your calendar will be saved in iCalendar format. Use "
-                              "'Export vCalendar' to save in vCalendar format."),
-                         i18n("Format Conversion"), KGuiItem(i18n("Proceed")),
-                         KStandardGuiItem::cancel(),
-                         QStringLiteral("dontaskFormatConversion"), KMessageBox::Notify);
-        if (result != KMessageBox::Continue) {
-            return false;
-        }
-
-        QString filename = mURL.fileName();
-        filename.replace(filename.length() - 4, 4, QStringLiteral(".ics"));
-        mURL = mURL.adjusted(QUrl::RemoveFilename);
-        mURL.setPath(mURL.path() + filename);
-        if (mURL.isLocalFile()) {
-            mFile = mURL.toLocalFile();
-        }
-        setTitle();
-    }
-
     if (!mCalendarView->saveCalendar(mFile)) {
         qCDebug(KORGANIZER_LOG) << "calendar view save failed.";
         return false;
diff --git a/src/calendarview.cpp b/src/calendarview.cpp
index 5deed6a9..9b1189f4 100644
--- a/src/calendarview.cpp
+++ b/src/calendarview.cpp
@@ -84,7 +84,6 @@
 #include <KCalCore/CalFilter>
 #include <KCalCore/FileStorage>
 #include <KCalCore/ICalFormat>
-#include <KCalCore/VCalFormat>
 
 #include <KCalUtils/ICalDrag>
 #include <KCalUtils/Stringify>
@@ -1823,55 +1822,6 @@ void CalendarView::exportICalendar()
     }
 }
 
-void CalendarView::exportVCalendar()
-{
-    if (!mCalendar->journals().isEmpty()) {
-        int result = KMessageBox::warningContinueCancel(
-                         this,
-                         i18n("The journal entries cannot be exported to a vCalendar file."),
-                         i18n("Data Loss Warning"),
-                         KGuiItem(i18n("Proceed")),
-                         KStandardGuiItem::cancel(),
-                         QStringLiteral("dontaskVCalExport"),
-                         KMessageBox::Notify);
-        if (result != KMessageBox::Continue) {
-            return;
-        }
-    }
-
-    QString filename = QFileDialog::getSaveFileName(this, QString(), QStringLiteral("vcalout.vcs"),
-                                                    QStringLiteral("%1 (*.vcs)").arg(i18n("vCalendars files")), nullptr, QFileDialog::DontConfirmOverwrite);
-    if (!filename.isEmpty()) {
-        // Force correct extension
-        if (filename.right(4) != QLatin1String(".vcs")) {
-            filename += QLatin1String(".vcs");
-        }
-        if (QFileInfo::exists(filename)) {
-            if (KMessageBox::No == KMessageBox::warningYesNo(
-                        this,
-                        i18n("Do you want to overwrite %1?", filename))) {
-                return;
-            }
-        }
-        KCalCore::VCalFormat *format = new KCalCore::VCalFormat;
-
-        KCalCore::FileStorage storage(mCalendar, filename, format);
-        if (!storage.save()) {
-            QString errmess;
-            if (format->exception()) {
-                errmess = KCalUtils::Stringify::errorMessage(*format->exception());
-            } else {
-                errmess = i18nc("save failure cause unknown", "Reason unknown");
-            }
-            KMessageBox::error(
-                this,
-                i18nc("@info",
-                      "Cannot write vCalendar file %1. %2",
-                      filename, errmess));
-        }
-    }
-}
-
 void CalendarView::eventUpdated(const Akonadi::Item &)
 {
     // Don't call updateView here. The code, which has caused the update of the
diff --git a/src/calendarview.h b/src/calendarview.h
index 17e161cd..6a32eb20 100644
--- a/src/calendarview.h
+++ b/src/calendarview.h
@@ -488,9 +488,6 @@ public Q_SLOTS:
     /** Export as iCalendar file */
     void exportICalendar();
 
-    /** Export as vCalendar file */
-    void exportVCalendar();
-
     /** pop up a dialog to show an existing appointment. */
     void appointment_show();
     /**
diff --git a/src/data/korganizer_part.rc b/src/data/korganizer_part.rc
index 23dda7d3..cd06c791 100644
--- a/src/data/korganizer_part.rc
+++ b/src/data/korganizer_part.rc
@@ -1,5 +1,5 @@
 <!DOCTYPE gui>
-<gui name="korganizer" version="429" translationDomain="korganizer">
+<gui name="korganizer" version="430" translationDomain="korganizer">
   <MenuBar>
     <Menu name="file"><text>&File</text>
       <Merge/>
@@ -17,7 +17,6 @@
       </Menu>
       <Menu name="export"><text>&Export</text>
         <Action name="export_icalendar"/>
-        <Action name="export_vcalendar"/>
         <Merge/>
         <Separator/>
         <Action name="uploadnewstuff"/>
diff --git a/src/data/korganizerui.rc b/src/data/korganizerui.rc
index a800169c..75bbebdc 100644
--- a/src/data/korganizerui.rc
+++ b/src/data/korganizerui.rc
@@ -1,5 +1,5 @@
 <!DOCTYPE gui>
-<gui name="korganizer" version="431"  translationDomain="korganizer">
+<gui name="korganizer" version="432"  translationDomain="korganizer">
   <MenuBar>
     <Menu name="file"><text>&File</text>
       <Menu name="import"><text>&Import</text>
@@ -11,7 +11,6 @@
       </Menu>
       <Menu name="export"><text>&Export</text>
         <Action name="export_icalendar"/>
-        <Action name="export_vcalendar"/>
         <Merge/>
         <Separator/>
         <Action name="uploadnewstuff"/>


More information about the kde-doc-english mailing list