Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 76adaee8 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Import Akonadi Serializer plugin for KAlarm from kdepim-runtime

See commit cde643e6d840d591b6ae1b7f1a49488c495c4774 in kdepim-runtime
for details.
parent 7eba9639
......@@ -26,6 +26,7 @@ include(ECMCoverageOption)
set(KALARM_LIB_VERSION ${PIM_VERSION})
set(CALENDARCORE_LIB_VERSION "5.7.40")
set(CALENDARUTILS_LIB_VERSION "5.7.40")
set(HOLIDAY_LIB_VERSION "5.7.40")
set(IDENTITYMANAGER_LIB_VERSION "5.7.40")
set(AKONADI_LIB_VERSION "5.7.40")
......@@ -42,6 +43,7 @@ find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${CALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGER_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${HOLIDAY_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
add_definitions(-DTRANSLATION_DOMAIN=\"libkalarmcal5\")
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
......@@ -49,6 +51,7 @@ add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
########### Targets ###########
add_subdirectory(src)
add_subdirectory(serializers)
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5AlarmCalendar")
......
org.kde.pim.kalarmcal kalarmcal (kalarmcal)
org.kde.pim.akonadi_serializer_kalarm kalarmcal (akonadi_serializer_kalarmcal)
add_definitions(-DTRANSLATION_DOMAIN=\"libkalarmcal5-serializer\")
set(akonadi_serializer_kalarm_SRCS
akonadi_serializer_kalarm.cpp
kaeventformatter.cpp
)
ecm_qt_declare_logging_category(akonadi_serializer_kalarm_SRCS
HEADER akonadi_serializer_kalarm_debug.h
IDENTIFIER AKONADI_SERIALIZER_KALARM_LOG
CATEGORY_NAME org.kde.pim.akonadi_serializer_kalarm
)
add_library(akonadi_serializer_kalarm MODULE ${akonadi_serializer_kalarm_SRCS})
target_link_libraries(akonadi_serializer_kalarm
KF5::AlarmCalendar
KF5::CalendarCore
KF5::CalendarUtils
KF5::AkonadiCore
)
install(TARGETS akonadi_serializer_kalarm
DESTINATION ${KDE_INSTALL_PLUGINDIR}
)
install(FILES akonadi_serializer_kalarm.desktop
DESTINATION ${KDE_INSTALL_DATADIR}/akonadi/plugins/serializer
)
#!/bin/sh
$XGETTEXT `find . -name "*.cpp"` -o $podir/libkalarmcal5-serializer.pot
This diff is collapsed.
[Misc]
Name=KAlarm Event Serializer
Name[ar]=مُسلسِل «منبّهك» للأحداث
Name[bs]=KAlarm događajni serializer
Name[ca]=Serialitzador d'esdeveniments del KAlarm
Name[ca@valencia]=Serialitzador d'esdeveniments del KAlarm
Name[da]=Serieordning af KAlarm-hændelser
Name[de]=Kalarm Ereignis-Serialisierung
Name[el]=Σειριακοποιητής γεγονότων KAlarm
Name[en_GB]=KAlarm Event Serialiser
Name[es]=Serializador de eventos de KAlarm
Name[et]=KAlarmi sündmuste jadasti
Name[fi]=KAlarm-tapahtumasarjoittaja
Name[fr]=Sérialiseur d'évènements KAlarm
Name[ga]=Srathóir Imeachtaí KAlarm
Name[gl]=Serializador de eventos de KAlarm
Name[hu]=KAlarm eseménykezelő
Name[ia]=Divulgator partial de evento de KAlarm
Name[it]=Serializzatore degli eventi di KAlarm
Name[ja]=KAlarm イベント用シリアライザ
Name[kk]=KAlarm оқиғалар тізбектеуіші
Name[km]=កម្មវិធី​បោះពុម្ព​ព្រឹត្តិការណ៍ KAlarm
Name[ko]=KAlarm 이벤트 시리얼라이저
Name[lt]=KAlarm įvykių serializatorius
Name[lv]=KAlarm notikumu serializētājs
Name[nb]=KAlarm hendelsesserialisator
Name[nds]=KAlarm-Begeefnis-Reegmoduul
Name[nl]=KAlarm gebeurtenissen in volgorde zetten
Name[nn]=Serialisator for KAlarm-hendingar
Name[pa]=ਕੇਅਲਾਰਮ ਈਵੈਂਟ ਸੀਰੀਅਲਾਈਜ਼ਰ
Name[pl]=Szeregowanie zdarzeń KAlarm
Name[pt]=Serializador de Eventos do KAlarm
Name[pt_BR]=Serializador de eventos do KAlarm
Name[ru]=Сохранение событий KAlarm
Name[sk]=Serializátor udalostí KAlarm
Name[sl]=Razvrščevalnik dogodkov KAlarm v zaporedje
Name[sr]=Серијализатор К‑алармових догађаја
Name[sr@ijekavian]=Серијализатор К‑алармових догађаја
Name[sr@ijekavianlatin]=Serijalizator K‑alarmovih događaja
Name[sr@latin]=Serijalizator K‑alarmovih događaja
Name[sv]=Kalarm händelseserialisering
Name[tr]=KAlarm Olay Sıralandırıcı
Name[uk]=Серіалізатор подій KAlarm
Name[x-test]=xxKAlarm Event Serializerxx
Name[zh_CN]=KAlarm 事件序列器
Name[zh_TW]=KAlarm 事件序列器
Comment=An Akonadi serializer plugin for KAlarm events
Comment[ar]=ملحقة سَلسَلة «أكونادي» لأحداث «منبّهك»
Comment[bs]=Akonadi serializirajući dodatak za KAlarm događaje
Comment[ca]=Un connector de serialització de l'Akonadi pels esdeveniments del KAlarm
Comment[ca@valencia]=Un connector de serialització de l'Akonadi pels esdeveniments del KAlarm
Comment[da]=Et Akonadi-plugin til serieordning af KAlarm-hændelser
Comment[de]=Akonadi-Modul zur Serialisierung von KAlarm-Ereignissen
Comment[el]=Ένα πρόσθετο σειριακοποιητή Akonadi για γεγονότα KAlarm
Comment[en_GB]=An Akonadi serialiser plugin for KAlarm events
Comment[es]=Un complemento serializador de Akonadi para eventos de KAlarm
Comment[et]=Akonadi KAlarmi sündmuste jadastamisplugin
Comment[fi]=Akonadi-sarjoitusliitännäinen KAlarmin tapahtumille
Comment[fr]=Un module externe Akonadi pour la sérialisation des évènements KAlarm
Comment[ga]=Breiseán srathóra Akonadi le haghaidh imeachtaí KAlarm
Comment[gl]=Un complemento serializador de Akonadi para os eventos de KAlarm
Comment[hu]=Akonadi modul KAlarm események kezeléséhez
Comment[ia]=Un plug-in de Akonadi pro divulgar partialmente eventos de alarmas in KAlarm
Comment[it]=Un'estensione di Akonadi per la serializzazione di eventi di KAlarm
Comment[ja]=KAlarm のイベントのための Akonadi シリアライザプラグイン
Comment[kk]=KAlarm оқиғалардың Akonadi тізбектеуіш плагині
Comment[km]=កម្មវិធី​ជំនួយ​​របស់​កម្មវិធី​បោះពុម្ព Akonadi សម្រាប់​ព្រឹត្តិការណ៍ KAlarm
Comment[ko]=KAlarm 이벤트를 위한 Akonadi 시리얼라이저 플러그인
Comment[lt]=Akonadi serializatoriaus papildinys KAlarm įvykiai
Comment[lv]=Akonadi KAlarm notikumu serializēšanas spraudnis
Comment[nb]=Et Akonadi programtillegg for serialisering av KAlarm-hendelser
Comment[nds]=Akonadi-Inreegmoduul för KAlarm-Begeefnissen
Comment[nl]=Een Akonadi-plugin voor het in volgorde zetten van KAlarm gebeurtenissen
Comment[nn]=Eit Akonadi-serialisatortillegg for KAlarm-hendingar
Comment[pl]=Wtyczka Akonadi do szeregowania zdarzeń KAlarm
Comment[pt]=Um 'plugin' de serialização do Akonadi para os eventos do KAlarm
Comment[pt_BR]=Um plugin de serialização do Akonadi para eventos do KAlarm
Comment[ru]=Модуль Akonadi сохранения событий KAlarm
Comment[sk]=Plugin serializátora Akonadi pre udalosti KAlarm
Comment[sl]=Akonadijev vstavek za razvrščanje predmetov dogodkov KAlarm v zaporedje
Comment[sr]=Аконадијев прикључак серијализатора за К‑алармове догађаје
Comment[sr@ijekavian]=Аконадијев прикључак серијализатора за К‑алармове догађаје
Comment[sr@ijekavianlatin]=Akonadijev priključak serijalizatora za K‑alarmove događaje
Comment[sr@latin]=Akonadijev priključak serijalizatora za K‑alarmove događaje
Comment[sv]=Ett insticksprogram till Akonadi för serialisering av Kalarm-händelser
Comment[tr]=KAlarm olayları için bir Akonadi sıralandırıcısı
Comment[uk]=Додаток серіалізації Akonadi для подій KAlarm
Comment[x-test]=xxAn Akonadi serializer plugin for KAlarm eventsxx
Comment[zh_CN]=用于操作 KAlarm 事件的 Akonadi 序列插件
Comment[zh_TW]=KAlarm 事件使用的 Akonadi 序列器外掛程式
[Plugin]
Type=application/x-vnd.kde.alarm,application/x-vnd.kde.alarm.active,application/x-vnd.kde.alarm.archived,application/x-vnd.kde.alarm.template
X-Akonadi-Class=default;KAlarmCal::KAEvent;
X-KDE-Library=akonadi_serializer_kalarm
X-KDE-ClassName=SerializerPluginKAlarm
/*
* akonadi_serializer_kalarm.h - Akonadi resource serializer for KAlarm
* Copyright © 2009-2014 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
* License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#ifndef AKONADI_SERIALIZER_KALARM_H
#define AKONADI_SERIALIZER_KALARM_H
#include "kaeventformatter.h"
#include <AkonadiCore/itemserializerplugin.h>
#include <AkonadiCore/differencesalgorithminterface.h>
#include <AkonadiCore/gidextractorinterface.h>
#include <KCalCore/ICalFormat>
#include <QObject>
namespace Akonadi {
class Item;
class AbstractDifferencesReporter;
}
class SerializerPluginKAlarm : public QObject, public Akonadi::ItemSerializerPlugin, public Akonadi::DifferencesAlgorithmInterface, public Akonadi::GidExtractorInterface
{
Q_OBJECT
Q_INTERFACES(Akonadi::ItemSerializerPlugin)
Q_INTERFACES(Akonadi::DifferencesAlgorithmInterface)
Q_INTERFACES(Akonadi::GidExtractorInterface)
Q_PLUGIN_METADATA(IID "org.kde.akonadi.SerializerPluginKAlarm")
public:
bool deserialize(Akonadi::Item &item, const QByteArray &label, QIODevice &data, int version) override;
void serialize(const Akonadi::Item &item, const QByteArray &label, QIODevice &data, int &version) override;
void compare(Akonadi::AbstractDifferencesReporter *, const Akonadi::Item &left, const Akonadi::Item &right) override;
QString extractGid(const Akonadi::Item &item) const override;
private:
void reportDifference(Akonadi::AbstractDifferencesReporter *, KAEventFormatter::Parameter);
KCalCore::ICalFormat mFormat;
KAEventFormatter mValueL;
KAEventFormatter mValueR;
QString mRegistered;
};
#endif // AKONADI_SERIALIZER_KALARM_H
This diff is collapsed.
/*
* kaeventformatter.h - converts KAlarmCal::KAEvent properties to text
* Copyright © 2010-2011 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
* License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#ifndef KAEVENTFORMATTER_H
#define KAEVENTFORMATTER_H
#include <kalarmcal/kaevent.h>
#include <QString>
using namespace KAlarmCal;
class KAEventFormatter
{
public:
// KAEvent parameter identifiers.
// Note that parameters stored in Akonadi attributes are not included.
enum Parameter {
Id,
AlarmType,
AlarmCategory,
TemplateName,
CreatedTime,
StartTime,
TemplateAfterTime,
Recurs, // does the event recur?
Recurrence,
NextRecurrence, // next alarm time excluding repetitions, including reminder/deferral
SubRepetition, // is there a sub-repetition?
RepeatInterval,
RepeatCount,
NextRepetition, // next repetition count
LateCancel,
AutoClose,
WorkTimeOnly,
HolidaysExcluded,
CopyKOrganizer,
Enabled,
ReadOnly,
Archive,
Revision,
CustomProperties,
MessageText,
MessageFile,
FgColour,
BgColour,
Font,
PreAction,
PreActionCancel,
PreActionNoError,
PostAction,
ConfirmAck,
KMailSerial,
Sound,
SoundRepeat,
SoundVolume,
SoundFadeVolume,
SoundFadeTime,
Reminder,
ReminderOnce,
DeferralType,
DeferralTime,
DeferDefault,
DeferDefaultDate,
Command,
LogFile,
CommandXTerm,
EmailSubject,
EmailFromId,
EmailTo,
EmailBcc,
EmailBody,
EmailAttachments
};
KAEventFormatter()
{
}
KAEventFormatter(const KAEvent &e, bool falseForUnspecified);
bool isApplicable(Parameter) const;
QString value(Parameter) const;
const KAEvent &event() const
{
return mEvent;
}
static QString label(Parameter);
private:
KAEvent mEvent;
QString mUnspecifiedValue;
};
#endif // KAEVENTFORMATTER_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment