Hello community, here is the log from the commit of package kdepim-addons for openSUSE:Factory checked in at 2016-11-12 13:31:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdepim-addons (Old) and /work/SRC/openSUSE:Factory/.kdepim-addons.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdepim-addons" Changes: -------- --- /work/SRC/openSUSE:Factory/kdepim-addons/kdepim-addons.changes 2016-10-18 10:12:55.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kdepim-addons.new/kdepim-addons.changes 2016-11-12 13:31:13.000000000 +0100 @@ -1,0 +2,7 @@ +Wed Nov 9 06:11:11 UTC 2016 - lbeltr...@kde.org + +- Update to KDE Applications 16.08.3 + * KDE Applications 16.08.3 + * https://www.kde.org/announcements/announce-applications-16.08.3.php + +------------------------------------------------------------------- Old: ---- kdepim-addons-16.08.2.tar.xz New: ---- kdepim-addons-16.08.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdepim-addons.spec ++++++ --- /var/tmp/diff_new_pack.kIhcVM/_old 2016-11-12 13:31:14.000000000 +0100 +++ /var/tmp/diff_new_pack.kIhcVM/_new 2016-11-12 13:31:14.000000000 +0100 @@ -17,7 +17,7 @@ Name: kdepim-addons -Version: 16.08.2 +Version: 16.08.3 Release: 0 Summary: Addons for KDEPIM applications License: GPL-2.0 ++++++ kdepim-addons-16.08.2.tar.xz -> kdepim-addons-16.08.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/CMakeLists.txt new/kdepim-addons-16.08.3/CMakeLists.txt --- old/kdepim-addons-16.08.2/CMakeLists.txt 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/CMakeLists.txt 2016-10-14 13:50:03.000000000 +0200 @@ -17,7 +17,7 @@ set(KDEPIMADDONS_DEV_VERSION " ${KDEPIMADDONS_DEV_VERSION}") endif() -set(PIM_VERSION "5.3.2") +set(PIM_VERSION "5.3.3") set(KDEPIMADDONS_VERSION_NUMBER ${PIM_VERSION}) set(KDEPIMADDONS_VERSION "${KDEPIMADDONS_VERSION_NUMBER}${KDEPIMADDONS_DEV_VERSION}") @@ -25,7 +25,7 @@ set(KDEPIMADDONS_LIB_VERSION "${KDEPIMADDONS_VERSION_NUMBER}") set(KDEPIMADDONS_LIB_SOVERSION "5") -set(AKONADINOTES_LIB_VERSION "5.3.2") +set(AKONADINOTES_LIB_VERSION "5.3.3") set(QT_REQUIRED_VERSION "5.6.0") include(ECMOptionalAddSubdirectory) include(ECMInstallIcons) @@ -56,21 +56,21 @@ find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED) find_package(KF5Declarative ${KF5_VERSION} CONFIG REQUIRED) -set(MAILCOMMON_LIB_VERSION "5.3.2") -set(GRAVATAR_LIB_VERSION "5.3.2") -set(PIMCOMMON_LIB_VERSION "5.3.2") -set(GRANTLEETHEME_LIB_VERSION "5.3.2") -set(CALENDARSUPPORT_LIB_VERSION "5.3.2") -set(EVENTVIEW_LIB_VERSION "5.3.2") -set(LIBKDEPIM_LIB_VERSION "5.3.2") -set(KDEPIM_APPS_LIB_VERSION "5.3.2") -set(LIBKLEO_LIB_VERSION "5.3.2") -set(AKONADI_LIB_VERSION "5.3.2") -set(INCIDENCEEDITOR_LIB_VERSION "5.3.2") -set(KTNEF_LIB_VERSION "5.3.2") -set(MESSAGELIB_LIB_VERSION "5.3.2") -set(AKONADICALENDAR_LIB_VERSION "5.3.2") -set(CALENDAR_UTILS_VERSION "5.3.2") +set(MAILCOMMON_LIB_VERSION "5.3.3") +set(GRAVATAR_LIB_VERSION "5.3.3") +set(PIMCOMMON_LIB_VERSION "5.3.3") +set(GRANTLEETHEME_LIB_VERSION "5.3.3") +set(CALENDARSUPPORT_LIB_VERSION "5.3.3") +set(EVENTVIEW_LIB_VERSION "5.3.3") +set(LIBKDEPIM_LIB_VERSION "5.3.3") +set(KDEPIM_APPS_LIB_VERSION "5.3.3") +set(LIBKLEO_LIB_VERSION "5.3.3") +set(AKONADI_LIB_VERSION "5.3.3") +set(INCIDENCEEDITOR_LIB_VERSION "5.3.3") +set(KTNEF_LIB_VERSION "5.3.3") +set(MESSAGELIB_LIB_VERSION "5.3.3") +set(AKONADICALENDAR_LIB_VERSION "5.3.3") +set(CALENDAR_UTILS_VERSION "5.3.3") find_package(KF5CalendarUtils ${CALENDAR_UTILS_VERSION} CONFIG REQUIRED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/messageviewerheaderplugins/briefheaderstyleplugin/briefheaderstyle.cpp new/kdepim-addons-16.08.3/plugins/messageviewerheaderplugins/briefheaderstyleplugin/briefheaderstyle.cpp --- old/kdepim-addons-16.08.2/plugins/messageviewerheaderplugins/briefheaderstyleplugin/briefheaderstyle.cpp 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/plugins/messageviewerheaderplugins/briefheaderstyleplugin/briefheaderstyle.cpp 2016-10-14 13:50:03.000000000 +0200 @@ -103,11 +103,17 @@ } if (strategy->showHeader(QStringLiteral("cc")) && message->cc(false)) { - headerParts << i18n("CC: ") + StringUtil::emailAddrAsAnchor(message->cc(), StringUtil::DisplayNameOnly); + const QString str = StringUtil::emailAddrAsAnchor(message->cc(), StringUtil::DisplayNameOnly); + if (!str.isEmpty()) { + headerParts << i18n("CC: ") + str; + } } if (strategy->showHeader(QStringLiteral("bcc")) && message->bcc(false)) { - headerParts << i18n("BCC: ") + StringUtil::emailAddrAsAnchor(message->bcc(), StringUtil::DisplayNameOnly); + const QString str = StringUtil::emailAddrAsAnchor(message->bcc(), StringUtil::DisplayNameOnly); + if (!str.isEmpty()) { + headerParts << i18n("BCC: ") + str; + } } if (strategy->showHeader(QStringLiteral("date"))) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/CMakeLists.txt new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/CMakeLists.txt --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/CMakeLists.txt 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/CMakeLists.txt 2016-10-14 13:50:03.000000000 +0200 @@ -7,6 +7,7 @@ akonadipimdatasource.cpp eventdatavisitor.cpp settingschangenotifier.cpp + eventmodel.cpp ) ecm_qt_declare_logging_category(loggingcategory_SRCS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/akonadipimdatasource.cpp new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/akonadipimdatasource.cpp --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/akonadipimdatasource.cpp 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/akonadipimdatasource.cpp 2016-10-14 13:50:03.000000000 +0200 @@ -20,20 +20,21 @@ #include "akonadipimdatasource.h" #include "settingschangenotifier.h" #include "pimeventsplugin_debug.h" +#include "eventmodel.h" -#include <AkonadiCore/ChangeRecorder> -#include <AkonadiCore/ItemFetchScope> -#include <AkonadiCore/CollectionFetchScope> -#include <AkonadiCore/EntityDisplayAttribute> +#include <AkonadiCore/Collection> #include <AkonadiCore/CollectionColorAttribute> #include <AkonadiCore/AttributeFactory> -#include <Akonadi/Calendar/ETMCalendar> + +#include <QSet> #include <KSharedConfig> #include <KCoreConfigSkeleton> #include <EventViews/Prefs> +using namespace std::placeholders; + AkonadiPimDataSource::AkonadiPimDataSource(QObject *parent) : QObject(parent) { @@ -42,20 +43,16 @@ connect(SettingsChangeNotifier::self(), &SettingsChangeNotifier::settingsChanged, this, &AkonadiPimDataSource::onSettingsChanged); - mMonitor = new Akonadi::ChangeRecorder(this); - mMonitor->setChangeRecordingEnabled(false); - mMonitor->itemFetchScope().fetchFullPayload(true); - mMonitor->itemFetchScope().fetchAttribute<Akonadi::EntityDisplayAttribute>(); - mMonitor->collectionFetchScope().fetchAttribute<Akonadi::CollectionColorAttribute>(); - onSettingsChanged(); + mCalendar = new EventModel(this); - mCalendar = new Akonadi::ETMCalendar(mMonitor, this); - // TOOD: Only retrieve PLD:HEAD once it's supported - mCalendar->setCollectionFilteringEnabled(false); + const auto config = KSharedConfig::openConfig(); + const auto group = config->group("PIMEventsPlugin"); + const QList<qint64> calendars = group.readEntry(QStringLiteral("calendars"), QList<qint64>()); + onSettingsChanged(); // Would be nice to have a proper API to read KOrganizer calendar colors... - KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("korganizerrc")); - KCoreConfigSkeleton *skel = new KCoreConfigSkeleton(config); + const auto korganizerrc = KSharedConfig::openConfig(QStringLiteral("korganizerrc")); + const auto skel = new KCoreConfigSkeleton(korganizerrc); mEventViewsPrefs = EventViews::PrefsPtr(new EventViews::Prefs(skel)); mEventViewsPrefs->readConfig(); } @@ -105,27 +102,23 @@ void AkonadiPimDataSource::onSettingsChanged() { - QSet<Akonadi::Collection> currentCols; - Q_FOREACH (const Akonadi::Collection &col, mMonitor->collectionsMonitored()) { - currentCols.insert(col); + QSet<Akonadi::Collection> monitored; + Q_FOREACH (const Akonadi::Collection &col, mCalendar->collections()) { + monitored.insert(col); } - auto config = KSharedConfig::openConfig(); - auto group = config->group("PIMEventsPlugin"); + const auto config = KSharedConfig::openConfig(); + const auto group = config->group("PIMEventsPlugin"); const QList<qint64> calendars = group.readEntry(QStringLiteral("calendars"), QList<qint64>()); - QSet<Akonadi::Collection> configuredCols; - Q_FOREACH (qint64 colId, calendars) { - configuredCols.insert(Akonadi::Collection(colId)); - } - - Q_FOREACH (const Akonadi::Collection &col, (currentCols - configuredCols)) { - mMonitor->setCollectionMonitored(col, false); - } - Q_FOREACH (const Akonadi::Collection &col, (configuredCols - currentCols)) { - mMonitor->setCollectionMonitored(col, true); + QSet<Akonadi::Collection> configured; + for (const auto colId : calendars) { + configured.insert(Akonadi::Collection(colId)); } - const bool hasSelectedCols = mMonitor->collectionsMonitored().isEmpty(); - mMonitor->setMimeTypeMonitored(KCalCore::Event::eventMimeType(), hasSelectedCols); - mMonitor->setMimeTypeMonitored(KCalCore::Todo::todoMimeType(), hasSelectedCols); + const auto toEnable = configured - monitored; + std::for_each(toEnable.cbegin(), toEnable.cend(), + std::bind(&EventModel::addCalendar, mCalendar, _1)); + const auto toDisable = monitored - configured; + std::for_each(toDisable.cbegin(), toDisable.cend(), + std::bind(&EventModel::removeCalendar, mCalendar, _1)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/akonadipimdatasource.h new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/akonadipimdatasource.h --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/akonadipimdatasource.h 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/akonadipimdatasource.h 2016-10-14 13:50:03.000000000 +0200 @@ -24,11 +24,7 @@ #include <QObject> #include <EventViews/Prefs> -namespace Akonadi -{ -class ChangeRecorder; -class ETMCalendar; -} +class EventModel; class AkonadiPimDataSource : public QObject, public PimDataSource @@ -47,8 +43,7 @@ void onSettingsChanged(); private: - Akonadi::ChangeRecorder *mMonitor; - Akonadi::ETMCalendar *mCalendar; + EventModel *mCalendar; EventViews::PrefsPtr mEventViewsPrefs; mutable QHash<qint64, QString> mColorCache; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/autotests/CMakeLists.txt new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/autotests/CMakeLists.txt --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/autotests/CMakeLists.txt 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/autotests/CMakeLists.txt 2016-10-14 13:50:03.000000000 +0200 @@ -24,4 +24,4 @@ endmacro() add_plasma_pimeventsplugin_test(eventdatavisitortest.cpp ../eventdatavisitor.cpp) -add_plasma_pimeventsplugin_test(pimeventsplugintest.cpp "../eventdatavisitor.cpp;../pimeventsplugin.cpp;../akonadipimdatasource.cpp;../settingschangenotifier.cpp") +add_plasma_pimeventsplugin_test(pimeventsplugintest.cpp "../eventmodel.cpp;../eventdatavisitor.cpp;../pimeventsplugin.cpp;../akonadipimdatasource.cpp;../settingschangenotifier.cpp") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/eventmodel.cpp new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/eventmodel.cpp --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/eventmodel.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/eventmodel.cpp 2016-10-14 13:50:03.000000000 +0200 @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2016 Daniel Vrátil <dvra...@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include "eventmodel.h" +#include "pimeventsplugin_debug.h" + +#include <Akonadi/Calendar/IncidenceChanger> + +#include <AkonadiCore/Monitor> +#include <AkonadiCore/ItemFetchScope> +#include <AkonadiCore/CollectionFetchScope> +#include <AkonadiCore/EntityDisplayAttribute> +#include <AkonadiCore/CollectionColorAttribute> +#include <AkonadiCore/AttributeFactory> +#include <AkonadiCore/ItemFetchJob> + +EventModel::EventModel(QObject* parent) + : Akonadi::CalendarBase(parent) + , mMonitor(Q_NULLPTR) +{ + Akonadi::AttributeFactory::registerAttribute<Akonadi::CollectionColorAttribute>(); +} + +EventModel::~EventModel() +{ +} + +void EventModel::createMonitor() +{ + if (mMonitor) { + return; + } + + mMonitor = new Akonadi::Monitor(this); + mMonitor->itemFetchScope().fetchFullPayload(true); + mMonitor->collectionFetchScope().fetchAttribute<Akonadi::EntityDisplayAttribute>(); + mMonitor->collectionFetchScope().fetchAttribute<Akonadi::CollectionColorAttribute>(); + mMonitor->fetchCollection(true); + + connect(mMonitor, &Akonadi::Monitor::itemAdded, + this, [this](const Akonadi::Item &item) { + // This is super-ugly, but the only way how to insert into CalendarBase + // without having direct access to CalendarBasePrivate. + // changeId is luckily ignored by CalendarBase. + incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString()); + }); + connect(mMonitor, &Akonadi::Monitor::itemChanged, + this, [this](const Akonadi::Item &item) { + const KCalCore::Incidence::Ptr incidence = item.payload<KCalCore::Incidence::Ptr>(); + if (!incidence) { + return; // HUH?! + } + const KCalCore::Incidence::Ptr oldIncidence = this->incidence(incidence->instanceIdentifier()); + if (!oldIncidence) { + // Change for event we don't know about -> discard + return; + } + + // Unfortunately the plasma applet does not handle event moves + // so we have to simulate via remove+add + if (oldIncidence->allDay() != incidence->allDay() + || oldIncidence->dtStart() != incidence->dtStart() + || oldIncidence->dateTime(KCalCore::IncidenceBase::RoleEnd) != incidence->dateTime(KCalCore::IncidenceBase::RoleEnd)) { + incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString()); + incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString()); + } else { + incidenceChanger()->modifyFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString()); + } + }); + connect(mMonitor, &Akonadi::Monitor::itemRemoved, + this, [this](const Akonadi::Item &item) { + incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString()); + }); + connect(mMonitor, &Akonadi::Monitor::collectionRemoved, + this, &EventModel::removeCalendar); +} + + +void EventModel::addCalendar(const Akonadi::Collection &col) +{ + if (!mCols.contains(col)) { + mCols.push_back(col); + + createMonitor(); + mMonitor->setCollectionMonitored(col, true); + + populateCollection(col); + } +} + +void EventModel::removeCalendar(const Akonadi::Collection &col) +{ + auto it = std::find(mCols.begin(), mCols.end(), col); + if (it != mCols.end()) { + mCols.erase(it); + if (mMonitor) { + mMonitor->setCollectionMonitored(col, false); + } + + removeCollection(col); + } +} + +QVector<Akonadi::Collection> EventModel::collections() const +{ + return mCols; +} + +Akonadi::Collection EventModel::collection(qint64 id) const +{ + auto it = std::find(mCols.cbegin(), mCols.cend(), Akonadi::Collection(id)); + return it == mCols.cend() ? Akonadi::Collection(id) : *it; +} + + +void EventModel::populateCollection(const Akonadi::Collection &col) +{ + qCDebug(PIMEVENTSPLUGIN_LOG) << "Populating events from collection" << col.id(); + auto job = new Akonadi::ItemFetchJob(col, this); + job->fetchScope().fetchFullPayload(true); + job->fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent); + job->setDeliveryOption(Akonadi::ItemFetchJob::EmitItemsInBatches); + mFetchJobs.insert(col.id(), job); + connect(job, &Akonadi::ItemFetchJob::itemsReceived, + this, &EventModel::onItemsReceived); + connect(job, &Akonadi::ItemFetchJob::result, + job, [this, col](KJob *job) { + mFetchJobs.remove(col.id()); + auto fetch = qobject_cast<Akonadi::ItemFetchJob*>(job); + qCDebug(PIMEVENTSPLUGIN_LOG) << "Received" << fetch->count() << "events for collection" << col.id(); + }); +} + +void EventModel::onItemsReceived(const Akonadi::Item::List &items) +{ + qCDebug(PIMEVENTSPLUGIN_LOG) << "Batch: received" << items.count() << "items"; + for (const auto &item : items) { + incidenceChanger()->createFinished(0, item, + Akonadi::IncidenceChanger::ResultCodeSuccess, QString()); + } +} + +void EventModel::removeCollection(const Akonadi::Collection &col) +{ + if (KJob *job = mFetchJobs.take(col.id())) { + disconnect(job, Q_NULLPTR, this, Q_NULLPTR); + job->kill(); + } + + const auto items = this->items(col.id()); + qCDebug(PIMEVENTSPLUGIN_LOG) << "Removing" << items.count() << "events for collection" << col.id(); + if (items.isEmpty()) { + return; + } + + QVector<Akonadi::Item::Id> ids; + ids.reserve(items.size()); + std::transform(items.cbegin(), items.cend(), std::back_inserter(ids), + std::mem_fn(&Akonadi::Item::id)); + + incidenceChanger()->deleteFinished(0, ids, Akonadi::IncidenceChanger::ResultCodeSuccess, QString()); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/eventmodel.h new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/eventmodel.h --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/eventmodel.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/eventmodel.h 2016-10-14 13:50:03.000000000 +0200 @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2016 Daniel Vrátil <dvra...@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef EVENTMODEL_H +#define EVENTMODEL_H + +#include <Akonadi/Calendar/CalendarBase> +#include <QVector> + +namespace Akonadi +{ +class Monitor; +} + +class EventModel : public Akonadi::CalendarBase +{ + Q_OBJECT +public: + + explicit EventModel(QObject *parent = Q_NULLPTR); + ~EventModel(); + + QVector<Akonadi::Collection> collections() const; + + Akonadi::Collection collection(qint64 id) const; + +public Q_SLOTS: + void addCalendar(const Akonadi::Collection &col); + void removeCalendar(const Akonadi::Collection &col); + +private Q_SLOTS: + void onItemsReceived(const Akonadi::Item::List &items); + +private: + void createMonitor(); + void populateCollection(const Akonadi::Collection &col); + void removeCollection(const Akonadi::Collection &col); + + QVector<Akonadi::Collection> mCols; + Akonadi::Monitor *mMonitor; + QMap<Akonadi::Collection::Id, KJob *> mFetchJobs; +}; + +#endif + + + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp 2016-10-14 13:50:03.000000000 +0200 @@ -49,9 +49,9 @@ mEtm->setItemPopulationStrategy(Akonadi::EntityTreeModel::NoItemPopulation); mEtm->setListFilter(Akonadi::CollectionFetchScope::Enabled); connect(mEtm, &Akonadi::EntityTreeModel::collectionTreeFetched, - this, [this]() { - sort(0, Qt::AscendingOrder); - }); + this, [this]() { + sort(0, Qt::AscendingOrder); + }); setSourceModel(mEtm); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/pimeventsplugin.h new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/pimeventsplugin.h --- old/kdepim-addons-16.08.2/plugins/plasma/pimeventsplugin/pimeventsplugin.h 2016-10-10 14:26:30.000000000 +0200 +++ new/kdepim-addons-16.08.3/plugins/plasma/pimeventsplugin/pimeventsplugin.h 2016-10-14 13:50:03.000000000 +0200 @@ -30,7 +30,7 @@ class PimDataSource; class PimEventsPlugin : public CalendarEvents::CalendarEventsPlugin - , public KCalCore::Calendar::CalendarObserver + , public KCalCore::Calendar::CalendarObserver { Q_OBJECT Q_INTERFACES(CalendarEvents::CalendarEventsPlugin)