[pim/kcalutils] src: Unexport IncidenceFormatter methods that are only used internally
Volker Krause <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 5fe1c60fcf201cddc4b0318c6cd3f4c4ddf53965 by Volker Krause.
Committed on 30/07/2026 at 16:32.
Pushed by vkrause into branch 'master'.
Unexport IncidenceFormatter methods that are only used internally
M +33 -7 src/incidenceformatter.cpp
M +0 -26 src/incidenceformatter.h
https://invent.kde.org/pim/kcalutils/-/commit/5fe1c60fcf201cddc4b0318c6cd3f4c4ddf53965
diff --git a/src/incidenceformatter.cpp b/src/incidenceformatter.cpp
index fad75ba90..48ce2d1a1 100644
--- a/src/incidenceformatter.cpp
+++ b/src/incidenceformatter.cpp
@@ -56,6 +56,32 @@ using namespace IncidenceFormatter;
* General helpers
*******************/
+/*!
+ Returns a reminder string list computed for the specified Incidence.
+ Each item of the returning QStringList corresponds to a string
+ representation of a reminder belonging to this incidence.
+ \param incidence a pointer to the Incidence
+ \param shortfmt if true, a short version of each reminder is printed; else a longer version
+ \return a list of formatted reminder strings
+*/
+static QStringList reminderStringList(const KCalendarCore::Incidence::Ptr &incidence, bool shortfmt = true);
+
+/*!
+ Format the start and end dates/times of an incidence.
+ \param start the start date/time
+ \param end the end date/time
+ \param isAllDay if true, the incidence is all-day; otherwise time information is included
+ \return the formatted start and end string
+*/
+static QString formatStartEnd(const QDateTime &start, const QDateTime &end, bool isAllDay);
+
+/*!
+ Returns a duration string computed for the specified Incidence.
+ \param incidence a pointer to the Incidence
+ \return the duration string
+*/
+static QString durationString(const KCalendarCore::Incidence::Ptr &incidence);
+
static QVariantHash inviteButton(const QString &id, const QString &text, const QString &iconName, InvitationFormatterHelper *helper);
//@cond PRIVATE
@@ -991,7 +1017,7 @@ static QString invitationLocation(const Incidence::Ptr &incidence, bool noHtmlMo
++count;
QVariantHash ev;
ev[QStringLiteral("summary")] = invitationSummary(*it, noHtmlMode);
- ev[QStringLiteral("dateTime")] = IncidenceFormatter::formatStartEnd((*it)->dtStart(), (*it)->dtEnd(), (*it)->allDay());
+ ev[QStringLiteral("dateTime")] = formatStartEnd((*it)->dtStart(), (*it)->dtEnd(), (*it)->allDay());
events.push_back(ev);
}
if (count == 50) {
@@ -1016,7 +1042,7 @@ static QString invitationLocation(const Incidence::Ptr &incidence, bool noHtmlMo
incidence[QStringLiteral("recurrence")] = recurrenceString(event);
incidence[QStringLiteral("isMultiDay")] = event->isMultiDay(QTimeZone::systemTimeZone());
incidence[QStringLiteral("isAllDay")] = event->allDay();
- incidence[QStringLiteral("dateTime")] = IncidenceFormatter::formatStartEnd(event->dtStart(), event->dtEnd(), event->allDay());
+ incidence[QStringLiteral("dateTime")] = formatStartEnd(event->dtStart(), event->dtEnd(), event->allDay());
incidence[QStringLiteral("duration")] = durationString(event);
incidence[QStringLiteral("description")] = invitationDescriptionIncidence(event, noHtmlMode);
@@ -1027,7 +1053,7 @@ static QString invitationLocation(const Incidence::Ptr &incidence, bool noHtmlMo
return incidence;
}
-QString IncidenceFormatter::formatStartEnd(const QDateTime &start, const QDateTime &end, bool isAllDay)
+QString formatStartEnd(const QDateTime &start, const QDateTime &end, bool isAllDay)
{
QString tmpStr;
// <startDate[time> [- <[endDate][Time]>]
@@ -1075,8 +1101,8 @@ QString IncidenceFormatter::formatStartEnd(const QDateTime &start, const QDateTi
incidence[QStringLiteral("location")] = htmlCompare(invitationLocation(event, noHtmlMode), invitationLocation(oldevent, noHtmlMode));
incidence[QStringLiteral("recurs")] = event->recurs() || oldevent->recurs();
incidence[QStringLiteral("recurrence")] = htmlCompare(recurrenceString(event), recurrenceString(oldevent));
- incidence[QStringLiteral("dateTime")] = htmlCompare(IncidenceFormatter::formatStartEnd(event->dtStart(), event->dtEnd(), event->allDay()),
- IncidenceFormatter::formatStartEnd(oldevent->dtStart(), oldevent->dtEnd(), oldevent->allDay()));
+ incidence[QStringLiteral("dateTime")] = htmlCompare(formatStartEnd(event->dtStart(), event->dtEnd(), event->allDay()),
+ formatStartEnd(oldevent->dtStart(), oldevent->dtEnd(), oldevent->allDay()));
incidence[QStringLiteral("duration")] = htmlCompare(durationString(event), durationString(oldevent));
incidence[QStringLiteral("description")] = invitationDescriptionIncidence(event, noHtmlMode);
@@ -3288,7 +3314,7 @@ static QString secs2Duration(qint64 secs)
return tmp;
}
-QString IncidenceFormatter::durationString(const Incidence::Ptr &incidence)
+QString durationString(const Incidence::Ptr &incidence)
{
QString tmp;
if (incidence->type() == Incidence::TypeEvent) {
@@ -3317,7 +3343,7 @@ QString IncidenceFormatter::durationString(const Incidence::Ptr &incidence)
return tmp;
}
-QStringList IncidenceFormatter::reminderStringList(const Incidence::Ptr &incidence, [[maybe_unused]] bool shortfmt)
+QStringList reminderStringList(const Incidence::Ptr &incidence, [[maybe_unused]] bool shortfmt)
{
// TODO: implement shortfmt=false
QStringList reminderStringList;
diff --git a/src/incidenceformatter.h b/src/incidenceformatter.h
index 22e94b373..38397ffe6 100644
--- a/src/incidenceformatter.h
+++ b/src/incidenceformatter.h
@@ -162,25 +162,6 @@ KCALUTILS_EXPORT QString formatICalInvitationNoHtml(const QString &invitation,
*/
KCALUTILS_EXPORT QString recurrenceString(const KCalendarCore::Incidence::Ptr &incidence);
-/*!
- Returns a reminder string list computed for the specified Incidence.
- Each item of the returning QStringList corresponds to a string
- representation of a reminder belonging to this incidence.
- \param incidence a pointer to the Incidence
- \param shortfmt if true, a short version of each reminder is printed; else a longer version
- \return a list of formatted reminder strings
-*/
-KCALUTILS_EXPORT QStringList reminderStringList(const KCalendarCore::Incidence::Ptr &incidence, bool shortfmt = true);
-
-/*!
- Format the start and end dates/times of an incidence.
- \param start the start date/time
- \param end the end date/time
- \param isAllDay if true, the incidence is all-day; otherwise time information is included
- \return the formatted start and end string
-*/
-KCALUTILS_EXPORT QString formatStartEnd(const QDateTime &start, const QDateTime &end, bool isAllDay);
-
/*!
Build a QString date/time representation of a QDateTime object.
All dates and times are converted to local time for display.
@@ -192,13 +173,6 @@ KCALUTILS_EXPORT QString formatStartEnd(const QDateTime &start, const QDateTime
*/
KCALUTILS_EXPORT QString dateTimeToString(const QDateTime &date, bool dateOnly = false, bool shortfmt = true);
-/*!
- Returns a duration string computed for the specified Incidence.
- \param incidence a pointer to the Incidence
- \return the duration string
-*/
-KCALUTILS_EXPORT QString durationString(const KCalendarCore::Incidence::Ptr &incidence);
-
class EventViewerVisitor;
template<typename T>
class ScheduleMessageVisitor;