[pim/akonadi-calendar] src: Remove word puzzles in undo history descriptions

Volker Krause <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit e0b1967120228ed93bfa446080f211aeb38aaa8d by Volker Krause.
Committed on 01/08/2026 at 09:15.
Pushed by vkrause into branch 'master'.

Remove word puzzles in undo history descriptions

This works in English but not necessarily in all other languages.

M  +42   -4    src/history_p.cpp

https://invent.kde.org/pim/akonadi-calendar/-/commit/e0b1967120228ed93bfa446080f211aeb38aaa8d

diff --git a/src/history_p.cpp b/src/history_p.cpp
index bfefd85c..bc39b6af 100644
--- a/src/history_p.cpp
+++ b/src/history_p.cpp
@@ -6,7 +6,6 @@
 
 #include "history_p.h"
 #include "akonadicalendar_debug.h"
-#include <KCalUtils/Stringify>
 #include <KLocalizedString>
 
 Entry::Entry(const Akonadi::Item &item, const QString &description, History *qq)
@@ -77,7 +76,20 @@ CreationEntry::CreationEntry(const Akonadi::Item &item, const QString &descripti
     Q_ASSERT(mItems.count() == 1);
     const auto incidence = mItems.constFirst().payload<KCalendarCore::Incidence::Ptr>();
     if (mDescription.isEmpty()) {
-        mDescription = i18nc("%1 is event, todo or journal", "%1 creation", KCalUtils::Stringify::incidenceType(incidence->type()));
+        switch (incidence->type()) {
+        case KCalendarCore::Incidence::TypeEvent:
+            mDescription = i18n("event creation");
+            break;
+        case KCalendarCore::Incidence::TypeTodo:
+            mDescription = i18n("to-do creation");
+            break;
+        case KCalendarCore::Incidence::TypeJournal:
+            mDescription = i18n("journal creation");
+            break;
+        case KCalendarCore::Incidence::TypeFreeBusy:
+        case KCalendarCore::Incidence::TypeUnknown:
+            break;
+        }
     }
     connect(mChanger, &IncidenceChanger::createFinished, this, &CreationEntry::onCreateFinished);
     connect(mChanger, &IncidenceChanger::deleteFinished, this, &CreationEntry::onDeleteFinished);
@@ -145,7 +157,20 @@ DeletionEntry::DeletionEntry(const Akonadi::Item::List &items, const QString &de
 {
     const auto incidence = items.constFirst().payload<KCalendarCore::Incidence::Ptr>();
     if (mDescription.isEmpty()) {
-        mDescription = i18nc("%1 is event, todo or journal", "%1 deletion", KCalUtils::Stringify::incidenceType(incidence->type()));
+        switch (incidence->type()) {
+        case KCalendarCore::Incidence::TypeEvent:
+            mDescription = i18n("event deletion");
+            break;
+        case KCalendarCore::Incidence::TypeTodo:
+            mDescription = i18n("to-do deletion");
+            break;
+        case KCalendarCore::Incidence::TypeJournal:
+            mDescription = i18n("journal deletion");
+            break;
+        case KCalendarCore::Incidence::TypeFreeBusy:
+        case KCalendarCore::Incidence::TypeUnknown:
+            break;
+        }
     }
     connect(mChanger, &IncidenceChanger::createFinished, this, &DeletionEntry::onCreateFinished);
     connect(mChanger, &IncidenceChanger::deleteFinished, this, &DeletionEntry::onDeleteFinished);
@@ -227,7 +252,20 @@ ModificationEntry::ModificationEntry(const Akonadi::Item &item, const Incidence:
 {
     const auto incidence = mItems.constFirst().payload<KCalendarCore::Incidence::Ptr>();
     if (mDescription.isEmpty()) {
-        mDescription = i18nc("%1 is event, todo or journal", "%1 modification", KCalUtils::Stringify::incidenceType(incidence->type()));
+        switch (incidence->type()) {
+        case KCalendarCore::Incidence::TypeEvent:
+            mDescription = i18n("event modification");
+            break;
+        case KCalendarCore::Incidence::TypeTodo:
+            mDescription = i18n("to-do modification");
+            break;
+        case KCalendarCore::Incidence::TypeJournal:
+            mDescription = i18n("journal modification");
+            break;
+        case KCalendarCore::Incidence::TypeFreeBusy:
+        case KCalendarCore::Incidence::TypeUnknown:
+            break;
+        }
     }
 
     connect(mChanger, &IncidenceChanger::modifyFinished, this, &ModificationEntry::onModifyFinished);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.