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 5780ce51 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Adapt to KCalCore API changes

parent cdaa0c21
......@@ -16,6 +16,7 @@ target_link_libraries(akonadi_invitations_agent
KF5::Mime
KF5::CalendarCore
KF5::AkonadiAgentBase
KF5::I18n
)
if( APPLE )
......
......@@ -7,24 +7,44 @@ add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_serializer_plugins\")
set(akonadi_serializer_addressee_PART_SRCS akonadi_serializer_addressee.cpp )
add_library(akonadi_serializer_addressee MODULE ${SERIALIZER_TYPE} ${akonadi_serializer_addressee_PART_SRCS})
target_link_libraries(akonadi_serializer_addressee KF5::Contacts KF5::AkonadiCore KF5::I18n)
target_link_libraries(akonadi_serializer_addressee
KF5::Contacts
KF5::AkonadiCore
KF5::I18n
)
install(TARGETS akonadi_serializer_addressee DESTINATION ${KDE_INSTALL_PLUGINDIR})
set(akonadi_serializer_mail_PART_SRCS akonadi_serializer_mail.cpp)
ecm_qt_declare_logging_category(akonadi_serializer_mail_PART_SRCS HEADER akonadi_serializer_mail_debug.h IDENTIFIER AKONADI_SERIALIZER_MAIL_LOG CATEGORY_NAME org.kde.pim.akonadi_serializer_mail)
add_library(akonadi_serializer_mail MODULE ${SERIALIZER_TYPE} ${akonadi_serializer_mail_PART_SRCS})
target_link_libraries(akonadi_serializer_mail KF5::Mime KF5::AkonadiCore KF5::AkonadiMime KF5::AkonadiPrivate Qt5::DBus )
target_link_libraries(akonadi_serializer_mail
KF5::Mime
KF5::AkonadiCore
KF5::AkonadiMime
KF5::AkonadiPrivate
Qt5::DBus
)
install(TARGETS akonadi_serializer_mail DESTINATION ${KDE_INSTALL_PLUGINDIR})
set(akonadi_serializer_kcalcore_SRCS akonadi_serializer_kcalcore.cpp)
add_library(akonadi_serializer_kcalcore MODULE ${SERIALIZER_TYPE} ${akonadi_serializer_kcalcore_SRCS})
target_link_libraries(akonadi_serializer_kcalcore KF5::CalendarUtils KF5::CalendarCore KF5::AkonadiCore)
target_link_libraries(akonadi_serializer_kcalcore
KF5::CalendarUtils
KF5::CalendarCore
KF5::AkonadiCore
KF5::I18n
)
install(TARGETS akonadi_serializer_kcalcore DESTINATION ${KDE_INSTALL_PLUGINDIR})
set(akonadi_serializer_contactgroup_PART_SRCS akonadi_serializer_contactgroup.cpp )
add_library(akonadi_serializer_contactgroup MODULE ${SERIALIZER_TYPE} ${akonadi_serializer_contactgroup_PART_SRCS})
target_link_libraries(akonadi_serializer_contactgroup KF5::Contacts KF5::AkonadiCore KF5::I18n KF5::AkonadiContact)
target_link_libraries(akonadi_serializer_contactgroup
KF5::Contacts
KF5::AkonadiCore
KF5::I18n
KF5::AkonadiContact
)
install(TARGETS akonadi_serializer_contactgroup DESTINATION ${KDE_INSTALL_PLUGINDIR})
set(akonadi_serializer_kalarm_SRCS akonadi_serializer_kalarm.cpp kaeventformatter.cpp)
......
......@@ -156,11 +156,6 @@ static QString toString(const QDate &date)
return date.toString();
}
static QString toString(const KDateTime &dateTime)
{
return dateTime.dateTime().toString();
}
static QString toString(const QDateTime &dateTime)
{
return dateTime.toString();
......
......@@ -99,8 +99,9 @@ private Q_SLOTS:
Event::Ptr event = Event::Ptr(new Event());
event->setUid(QStringLiteral("12345"));
event->setDtStart(KDateTime(currentDate));
event->setDtEnd(KDateTime(currentDate.addDays(1)));
event->setDtStart(QDateTime(currentDate, {}));
event->setDtEnd(QDateTime(currentDate.addDays(1), {}));
event->setAllDay(true);
// ü
const char latin1_umlaut[] = { static_cast<char>(0xFC), '\0' };
......
......@@ -31,6 +31,9 @@ target_link_libraries(akonadi_birthdays_resource
KF5::AkonadiAgentBase
KF5::Contacts
KF5::AkonadiWidgets
KF5::I18n
KF5::TextWidgets
KF5::WindowSystem
)
install( TARGETS akonadi_birthdays_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
......
......@@ -327,8 +327,8 @@ KCalCore::Event::Ptr BirthdaysResource::createAnniversary(const Akonadi::Item &c
KCalCore::Event::Ptr BirthdaysResource::createEvent(const QDate &date)
{
Event::Ptr event(new Event());
event->setDtStart(KDateTime(date, KDateTime::Spec(KDateTime::ClockTime)));
event->setDtEnd(KDateTime(date, KDateTime::Spec(KDateTime::ClockTime)));
event->setDtStart(QDateTime(date, {}));
event->setDtEnd(QDateTime(date, {}));
event->setAllDay(true);
event->setTransparency(Event::Transparent);
......
......@@ -59,6 +59,10 @@ add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_davgroupware_resource\")
KF5::AkonadiCore
KF5::Wallet
KF5::CalendarCore
KF5::Completion
KF5::ConfigCore
KF5::ConfigWidgets
KF5::WindowSystem
KPim::KDAV
)
......
......@@ -60,7 +60,7 @@ void DavFreeBusyHandler::retrieveFreeBusy(const QString &email, const QDateTime
return;
}
KCalCore::FreeBusy::Ptr fb(new KCalCore::FreeBusy(KDateTime(start), KDateTime(end)));
KCalCore::FreeBusy::Ptr fb(new KCalCore::FreeBusy(start, end));
KCalCore::Attendee::Ptr att(new KCalCore::Attendee(QString(), email));
fb->addAttendee(att);
......
......@@ -47,7 +47,6 @@
#include <KCalCore/ICalFormat>
#include <KCalCore/MemoryCalendar>
#include <KCalCore/Todo>
#include <kdatetime.h>
#include <kjob.h>
#include <attributefactory.h>
......
......@@ -25,7 +25,6 @@
#include "utils.h"
#include "davresource_debug.h"
#include <kapplication.h>
#include <klineedit.h>
#include <KLocalizedString>
......@@ -33,6 +32,7 @@
#include <KDAV/Utils>
#include <QCoreApplication>
#include <QByteArray>
#include <QDataStream>
#include <QFile>
......@@ -376,7 +376,7 @@ void Settings::buildUrlsList()
void Settings::loadMappings()
{
QString collectionsMappingCacheBase = QStringLiteral("akonadi-davgroupware/%1_c2u.dat").arg(KApplication::applicationName());
QString collectionsMappingCacheBase = QStringLiteral("akonadi-davgroupware/%1_c2u.dat").arg(QCoreApplication::applicationName());
mCollectionsUrlsMappingCache = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + collectionsMappingCacheBase;
QFile collectionsMappingsCache(mCollectionsUrlsMappingCache);
......
......@@ -26,7 +26,6 @@
#include <kmessagebox.h>
#include <KLocalizedString>
#include <KSharedConfigPtr>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QVBoxLayout>
......
......@@ -28,6 +28,7 @@ target_link_libraries(akonadi_facebook_resource
KF5::Wallet
KF5::Codecs
Qt5::WebEngineWidgets
KF5::KIOCore
)
install(TARGETS akonadi_facebook_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -137,11 +137,11 @@ Akonadi::Item EventsListJob::handleResponse(const QJsonObject &data)
}
const QString dtStart = data.value(QLatin1String("start_time")).toString();
event->setDtStart(KDateTime(parseDateTime(dtStart)));
event->setDtStart(parseDateTime(dtStart));
const auto endTime = data.constFind(QLatin1String("end_time"));
if (endTime != dataEnd) {
event->setDtEnd(KDateTime(parseDateTime(endTime->toString())));
event->setDtEnd(parseDateTime(endTime->toString()));
}
QString description = data.value(QLatin1String("description")).toString();
......
......@@ -38,7 +38,7 @@
#include <QWebEngineProfile>
#include <QWebEngineCookieStore>
#include <KWallet/Wallet>
#include <KWallet>
#include <KLocalizedString>
......
......@@ -53,6 +53,9 @@ target_link_libraries(akonadi_googlecalendar_resource
KF5::AkonadiAgentBase
KF5::Wallet
KF5::I18n
KF5::WindowSystem
KF5::Completion
KF5::TextWidgets
)
install(TARGETS akonadi_googlecalendar_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -810,10 +810,10 @@ void CalendarResource::slotRetrieveFreeBusyJobFinished(KGAPI2::Job *job)
fb->setOrganizer(account()->accountName());
fb->addAttendee(KCalCore::Attendee::Ptr(new KCalCore::Attendee(QString(), queryJob->id())));
// FIXME: is it really sort?
fb->setDateTime(KDateTime::currentUtcDateTime(), KCalCore::IncidenceBase::RoleSort);
fb->setDateTime(QDateTime::currentDateTimeUtc(), KCalCore::IncidenceBase::RoleSort);
Q_FOREACH (const KGAPI2::FreeBusyQueryJob::BusyRange &range, queryJob->busy()) {
fb->addPeriod(KDateTime(range.busyStart), KDateTime(range.busyEnd));
fb->addPeriod(range.busyStart, range.busyEnd);
}
KCalCore::ICalFormat format;
......
......@@ -20,8 +20,6 @@
#include <QVariant>
#include <QJsonDocument>
#include <KCalCore/Utils>
#include <KGAPI/Calendar/Reminder>
using namespace KGAPI2;
......@@ -100,7 +98,7 @@ KCalCore::Alarm::List DefaultReminderAttribute::alarms(KCalCore::Incidence *inci
KCalCore::Alarm::Ptr alarm(new KCalCore::Alarm(incidence));
alarm->setType(reminder->type());
alarm->setTime(KCalCore::k2q(incidence->dtStart()));
alarm->setTime(incidence->dtStart());
alarm->setStartOffset(reminder->startOffset());
alarm->setEnabled(true);
......
......@@ -29,8 +29,13 @@ endif ()
target_link_libraries(akonadi_icaldir_resource
KF5::AkonadiCore
KF5::AkonadiAgentBase
KF5::AkonadiAgentBase
KF5::CalendarCore
KF5::I18n
KF5::TextWidgets
KF5::KIOWidgets
KF5::ConfigWidgets
KF5::WindowSystem
)
install(TARGETS akonadi_icaldir_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -43,6 +43,7 @@ target_link_libraries(akonadi_kalarm_resource
KF5::KIOCore
KF5::AkonadiAgentBase
KF5::DBusAddons
KF5::I18n
akonadi-singlefileresource
)
......
......@@ -59,7 +59,7 @@ Akonadi::Item getErrorItem(Kolab::FolderType folderType, const QString &remoteId
case Kolab::EventType: {
KCalCore::Event::Ptr event(new KCalCore::Event);
//FIXME Use message creation date time
event->setDtStart(KDateTime::currentUtcDateTime());
event->setDtStart(QDateTime::currentDateTimeUtc());
event->setSummary(i18n("Corrupt Event"));
event->setDescription(i18n("Event could not be read. Delete this event to remove it from the server. Technical information: remote identifier %1", remoteId));
item.setMimeType(KCalCore::Event::eventMimeType());
......@@ -69,7 +69,7 @@ Akonadi::Item getErrorItem(Kolab::FolderType folderType, const QString &remoteId
case Kolab::TaskType: {
KCalCore::Todo::Ptr task(new KCalCore::Todo);
//FIXME Use message creation date time
task->setDtStart(KDateTime::currentUtcDateTime());
task->setDtStart(QDateTime::currentDateTimeUtc());
task->setSummary(i18n("Corrupt Task"));
task->setDescription(i18n("Task could not be read. Delete this task to remove it from the server."));
item.setMimeType(KCalCore::Todo::todoMimeType());
......@@ -79,7 +79,7 @@ Akonadi::Item getErrorItem(Kolab::FolderType folderType, const QString &remoteId
case Kolab::JournalType: {
KCalCore::Journal::Ptr journal(new KCalCore::Journal);
//FIXME Use message creation date time
journal->setDtStart(KDateTime::currentUtcDateTime());
journal->setDtStart(QDateTime::currentDateTimeUtc());
journal->setSummary(i18n("Corrupt journal"));
journal->setDescription(i18n("Journal could not be read. Delete this journal to remove it from the server."));
item.setMimeType(KCalCore::Journal::journalMimeType());
......
......@@ -56,7 +56,17 @@ if( APPLE )
endif ()
target_link_libraries(akonadi_openxchange_resource KF5::AkonadiAgentBase KF5::AkonadiCore KF5::Contacts KF5::KIOCore KF5::CalendarCore KF5::AkonadiContact )
target_link_libraries(akonadi_openxchange_resource
KF5::AkonadiAgentBase
KF5::AkonadiCore
KF5::Contacts
KF5::KIOCore
KF5::CalendarCore
KF5::AkonadiContact
KF5::I18n
KF5::Completion
KF5::WindowSystem
)
install(TARGETS akonadi_openxchange_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -23,8 +23,6 @@
#include "settings.h"
#include "ui_configdialog.h"
#include <kaboutdata.h>
#include <kaboutapplicationdialog.h>
#include <kconfigdialogmanager.h>
#include <kmessagebox.h>
#include <kwindowsystem.h>
......@@ -47,13 +45,10 @@ ConfigDialog::ConfigDialog(WId windowId)
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
QPushButton *user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfigDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfigDialog::reject);
mainLayout->addWidget(buttonBox);
user1Button->setText(i18n("About..."));
setWindowTitle(i18n("Open-Xchange Configuration"));
Ui::ConfigDialog ui;
......@@ -72,7 +67,6 @@ ConfigDialog::ConfigDialog(WId windowId)
mManager->updateWidgets();
connect(okButton, &QPushButton::clicked, this, &ConfigDialog::save);
connect(user1Button, &QPushButton::clicked, this, &ConfigDialog::showAboutDialog);
connect(mServerEdit, &KLineEdit::textChanged, this, &ConfigDialog::updateButtonState);
connect(mUserEdit, &KLineEdit::textChanged, this, &ConfigDialog::updateButtonState);
connect(mCheckConnectionButton, &QPushButton::clicked, this, &ConfigDialog::checkConnection);
......@@ -86,19 +80,6 @@ void ConfigDialog::save()
Settings::self()->save();
}
void ConfigDialog::showAboutDialog()
{
KAboutData aboutData(QStringLiteral("ox"), i18n("Open-Xchange"), QStringLiteral("0.1"),
i18n("Akonadi Open-Xchange Resource"),
KAboutLicense::LGPL,
i18n("(c) 2009 by Tobias Koenig (credativ GmbH)"));
aboutData.addAuthor(i18n("Tobias Koenig"), i18n("Current maintainer"), QStringLiteral("tokoe@kde.org"));
aboutData.addCredit(i18n("credativ GmbH"), i18n("Funded and supported"), QStringLiteral("http://www.credativ.com"));
KAboutApplicationDialog dlg(aboutData, this);
dlg.exec();
}
void ConfigDialog::updateButtonState()
{
mCheckConnectionButton->setEnabled(!mServerEdit->text().isEmpty() && !mUserEdit->text().isEmpty());
......
......@@ -35,7 +35,6 @@ public:
private Q_SLOTS:
void save();
void showAboutDialog();
void updateButtonState();
void checkConnection();
void checkConnectionJobFinished(KJob *);
......
......@@ -140,15 +140,11 @@ static void parseEventAttribute(const QDomElement &element,
const QString text = OXUtils::readString(element.text());
if (tagName == QLatin1String("start_date")) {
KDateTime dateTime = KDateTime(OXUtils::readDateTime(element.text()), KDateTime::UTC);
if (event->allDay()) {
dateTime.setDateOnly(true);
}
QDateTime dateTime = OXUtils::readDateTime(element.text());
event->setDtStart(dateTime);
} else if (tagName == QLatin1String("end_date")) {
KDateTime dateTime = KDateTime(OXUtils::readDateTime(element.text()), KDateTime::UTC);
QDateTime dateTime = OXUtils::readDateTime(element.text());
if (event->allDay()) {
dateTime = dateTime.addSecs(-1);
}
......@@ -167,12 +163,12 @@ static void parseTodoAttribute(const QDomElement &element,
const QString text = OXUtils::readString(element.text());
if (tagName == QLatin1String("start_date")) {
const KDateTime dateTime = KDateTime(OXUtils::readDateTime(element.text()), KDateTime::UTC);
const QDateTime dateTime = OXUtils::readDateTime(element.text());
if (dateTime.isValid()) {
todo->setDtStart(dateTime);
}
} else if (tagName == QLatin1String("end_date")) {
const KDateTime dateTime = KDateTime(OXUtils::readDateTime(element.text()), KDateTime::UTC);
const QDateTime dateTime = OXUtils::readDateTime(element.text());
if (dateTime.isValid()) {
todo->setDtDue(dateTime);
}
......@@ -371,9 +367,9 @@ static void createEventAttributes(QDomDocument &document, QDomElement &parent,
DAVUtils::addOxElement(document, parent, QStringLiteral("end_date"), OXUtils::writeDate(event->dtEnd().date()));
}
} else {
DAVUtils::addOxElement(document, parent, QStringLiteral("start_date"), OXUtils::writeDateTime(event->dtStart().dateTime()));
DAVUtils::addOxElement(document, parent, QStringLiteral("start_date"), OXUtils::writeDateTime(event->dtStart()));
if (event->hasEndDate()) {
DAVUtils::addOxElement(document, parent, QStringLiteral("end_date"), OXUtils::writeDateTime(event->dtEnd().dateTime()));
DAVUtils::addOxElement(document, parent, QStringLiteral("end_date"), OXUtils::writeDateTime(event->dtEnd()));
}
}
......@@ -396,13 +392,13 @@ static void createTaskAttributes(QDomDocument &document, QDomElement &parent,
const KCalCore::Todo::Ptr &todo)
{
if (todo->hasStartDate()) {
DAVUtils::addOxElement(document, parent, QStringLiteral("start_date"), OXUtils::writeDateTime(todo->dtStart().dateTime()));
DAVUtils::addOxElement(document, parent, QStringLiteral("start_date"), OXUtils::writeDateTime(todo->dtStart()));
} else {
DAVUtils::addOxElement(document, parent, QStringLiteral("start_date"));
}
if (todo->hasDueDate()) {
DAVUtils::addOxElement(document, parent, QStringLiteral("end_date"), OXUtils::writeDateTime(todo->dtDue().dateTime()));
DAVUtils::addOxElement(document, parent, QStringLiteral("end_date"), OXUtils::writeDateTime(todo->dtDue()));
} else {
DAVUtils::addOxElement(document, parent, QStringLiteral("end_date"));
}
......
......@@ -37,14 +37,14 @@ generate_export_header(akonadi-singlefileresource BASE_NAME akonadi-singlefilere
target_link_libraries(akonadi-singlefileresource
PUBLIC
KF5::I18n
KF5::Completion
KF5::KIOWidgets
KF5::ConfigWidgets
PRIVATE
KF5::AkonadiCore
KF5::AkonadiAgentBase
KF5::KIOCore
KF5::IMAP
KF5::Completion
KF5::KIOWidgets
KF5::ConfigWidgets
KF5::WindowSystem
)
......
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