[pim/kcalutils] src: Remove RecurrenceAction
Allen Winter <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 7e8249d536a5a03d66e263343de1d6d7389f2f07 by Allen Winter, on behalf of Volker Krause.
Committed on 03/08/2026 at 10:40.
Pushed by winterz into branch 'master'.
Remove RecurrenceAction
Moved downstream to eventviews, its only user.
M +0 -3 src/CMakeLists.txt
D +0 -117 src/recurrenceactions.cpp
D +0 -132 src/recurrenceactions.h
https://invent.kde.org/pim/kcalutils/-/commit/7e8249d536a5a03d66e263343de1d6d7389f2f07
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index eaab76224..a75d9ab6f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,7 +13,6 @@ target_sources(
PRIVATE
icaldrag.cpp
incidenceformatter.cpp
- recurrenceactions.cpp
stringify.cpp
vcaldrag.cpp
dndfactory.cpp
@@ -28,7 +27,6 @@ target_sources(
grantleeki18nlocalizer_p.h
incidenceformatter.h
dndfactory.h
- recurrenceactions.h
)
ecm_qt_declare_logging_category(KPim6CalendarUtils HEADER kcalutils_debug.h IDENTIFIER KCALUTILS_LOG CATEGORY_NAME org.kde.pim.kcalutils
OLD_CATEGORY_NAMES log_kcalutils
@@ -95,7 +93,6 @@ ecm_generate_headers(KCalUtils_CamelCase_HEADERS
DndFactory
ICalDrag
IncidenceFormatter
- RecurrenceActions
Stringify
VCalDrag
PREFIX KCalUtils
diff --git a/src/recurrenceactions.cpp b/src/recurrenceactions.cpp
deleted file mode 100644
index c92fd2602..000000000
--- a/src/recurrenceactions.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- This file is part of the kcal library.
-
- SPDX-FileCopyrightText: Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
- SPDX-FileContributor: Kevin Krammer <[email protected]>
-
- SPDX-FileCopyrightText: 2015 Sérgio Martins <[email protected]>
-
- SPDX-License-Identifier: LGPL-2.0-or-later
-*/
-
-#include "recurrenceactions.h"
-
-#include <KGuiItem>
-#include <KLocalizedString>
-#include <KMessageBox>
-
-#include <QDialog>
-#include <QDialogButtonBox>
-#include <QPointer>
-#include <QPushButton>
-
-using namespace KCalUtils;
-using namespace KCalUtils::RecurrenceActions;
-using namespace KCalendarCore;
-
-int RecurrenceActions::availableOccurrences(const Incidence::Ptr &incidence, const QDateTime &selectedOccurrence)
-{
- int result = NoOccurrence;
-
- if (incidence->recurrence()->recursOn(selectedOccurrence.date(), selectedOccurrence.timeZone())) {
- result |= SelectedOccurrence;
- }
-
- if (incidence->recurrence()->getPreviousDateTime(selectedOccurrence).isValid()) {
- result |= PastOccurrences;
- }
-
- if (incidence->recurrence()->getNextDateTime(selectedOccurrence).isValid()) {
- result |= FutureOccurrences;
- }
-
- return result;
-}
-
-int RecurrenceActions::questionSelectedAllCancel(const QString &message,
- const QString &caption,
- const KGuiItem &actionSelected,
- const KGuiItem &actionAll,
- QWidget *parent)
-{
- QPointer<QDialog> const dialog = new QDialog(parent);
- dialog->setWindowTitle(caption);
- auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::No | QDialogButtonBox::Yes, parent);
- dialog->setObjectName(QLatin1StringView("RecurrenceActions::questionSelectedAllCancel"));
-
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Yes), actionSelected);
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), actionAll);
-
- QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
- okButton->setDefault(true);
- okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
-
- bool checkboxResult = false;
- int const result =
- KMessageBox::createKMessageBox(dialog, buttonBox, QMessageBox::Question, message, QStringList(), QString(), &checkboxResult, KMessageBox::Notify);
-
- switch (result) {
- case QDialogButtonBox::Yes:
- return SelectedOccurrence;
- case QDialogButtonBox::Ok:
- return AllOccurrences;
- default:
- return NoOccurrence;
- }
-}
-
-int RecurrenceActions::questionSelectedFutureAllCancel(const QString &message,
- const QString &caption,
- const KGuiItem &actionSelected,
- const KGuiItem &actionFuture,
- const KGuiItem &actionAll,
- QWidget *parent)
-{
- QPointer<QDialog> const dialog = new QDialog(parent);
- dialog->setWindowTitle(caption);
-
- auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::No | QDialogButtonBox::Yes, parent);
- dialog->setObjectName(QLatin1StringView("RecurrenceActions::questionSelectedFutureAllCancel"));
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Yes), actionSelected);
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::No), actionFuture);
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), actionAll);
- QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
- okButton->setDefault(true);
- okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
-
- bool checkboxResult = false;
- QDialogButtonBox::StandardButton const result =
- KMessageBox::createKMessageBox(dialog, buttonBox, QMessageBox::Question, message, QStringList(), QString(), &checkboxResult, KMessageBox::Notify);
-
- switch (result) {
- case QDialogButtonBox::Yes:
- return SelectedOccurrence;
- case QDialogButtonBox::No:
- return FutureOccurrences;
- case QDialogButtonBox::Ok:
- return AllOccurrences;
- default:
- return NoOccurrence;
- }
-
- return NoOccurrence;
-}
-
-#include "moc_recurrenceactions.cpp"
diff --git a/src/recurrenceactions.h b/src/recurrenceactions.h
deleted file mode 100644
index 180244d9f..000000000
--- a/src/recurrenceactions.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- This file is part of the kcal library.
-
- SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
- SPDX-FileContributor: Kevin Krammer <[email protected]>
-
- SPDX-License-Identifier: LGPL-2.0-or-later
-*/
-
-#pragma once
-
-#include "kcalutils_export.h"
-
-#include <KCalendarCore/Incidence>
-
-class QDateTime;
-class KGuiItem;
-class QWidget;
-
-namespace KCalUtils
-{
-/*!
- \inmodule KCalUtils
- \inheaderfile KCalUtils/RecurrenceActions
-
- \brief Utility functions for dealing with recurrences
-
- Incidences with recurrencies need to be treated differently than single independent ones.
- For example the user might be given the choice to not only modify a selected occurrence
- of an incidence but also all that follow that one, etc.
-
- \author Kevin Krammer, [email protected]
- \since 4.6
-*/
-namespace RecurrenceActions
-{
-/*!
- \brief Flags for indicating on which occurrences to work on
-
- Flags can be OR'ed together to get a combined scope.
-*/
-enum Scope {
- /*!
- Scope does not apply to any occurrence
- */
- NoOccurrence = 0,
-
- /*!
- Scope does include the given/selected occurrence
- */
- SelectedOccurrence = 1,
-
- /*!
- Scope does include occurrences before the given/selected occurrence
- */
- PastOccurrences = 2,
-
- /*!
- Scope does include occurrences after the given/selected occurrence
- */
- FutureOccurrences = 4,
-
- /*!
- Scope does include all occurrences (past, present and future)
- */
- AllOccurrences = PastOccurrences | SelectedOccurrence | FutureOccurrences
-};
-
-/*!
- \brief Checks what scope an action could be applied on for a given incidence
-
- Checks whether the incidence is occurring on the given date and whether there
- are occurrences in the past and future.
-
- \a incidence the incidence of which to check recurrences.
- \a selectedOccurrence the date (including timespec) to use as the base occurrence,
- i.e., from which to check for past and future occurrences.
-
- Returns the #Scope to which actions on the given @incidence can be applied to
-*/
-[[nodiscard]] KCALUTILS_EXPORT int availableOccurrences(const KCalendarCore::Incidence::Ptr &incidence, const QDateTime &selectedOccurrence);
-
-/*!
- \brief Presents a message box with two action choices and cancel to the user
-
- Shows a message box style question dialog with two action scope buttons and cancel.
- This is for quick decisions like whether to only modify a single occurrence or all occurrences.
-
- \a message the message which explains the change and available options.
- \a caption the dialog's caption.
- \a actionSelected the GUI item to use for the button representing the
- #SelectedOccurrence scope.
- \a actionAll the GUI item to use for the button representing the #AllOccurrences scope.
- \a parent QWidget parent for the dialog.
-
- \a #NoOccurrence on cancel, #SelectedOccurrence or #AllOccurrences on the respective action.
-*/
-[[nodiscard]] KCALUTILS_EXPORT int
-questionSelectedAllCancel(const QString &message, const QString &caption, const KGuiItem &actionSelected, const KGuiItem &actionAll, QWidget *parent);
-
-/*!
- \brief Presents a message box with three action choices and cancel to the user
-
- Shows a message box style question dialog with three action scope buttons and cancel.
- This is for quick decisions like whether to only modify a single occurrence, to include
- future or all occurrences.
-
- Note The calling application code can of course decide to word the future action text
- in a way that it includes the selected occurrence, e.g. "Also Future Items".
- The returned value will still just be #FutureOccurrences so the calling code
- has to include #SelectedOccurrence itself if it passes the value further on
-
- \a message the message which explains the change and available options.
- \a caption the dialog's caption.
- \a actionSelected the GUI item to use for the button representing the
- #SelectedOccurrence scope.
- \a actionSelected the GUI item to use for the button representing the
- #FutureOccurrences scope.
- \a actionAll the GUI item to use for the button representing the #AllOccurrences scope.
- \a parent QWidget parent for the dialog.
-
- \a #NoOccurrence on cancel, #SelectedOccurrence, #FutureOccurrences or #AllOccurrences
- on the respective action.
-*/
-[[nodiscard]] KCALUTILS_EXPORT int questionSelectedFutureAllCancel(const QString &message,
- const QString &caption,
- const KGuiItem &actionSelected,
- const KGuiItem &actionFuture,
- const KGuiItem &actionAll,
- QWidget *parent);
-}
-}