Verified Commit 7d68b36b authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

eventpluginsmanager: relay `alternateDateReady` and `subLabelReady`

Two new signals are added in CalendarEventsPlugin, so we need to relay
them to make DaysModel receive them.

CCBUG: 429892
parent 31a6d1c6
......@@ -6,8 +6,6 @@
#include "eventpluginsmanager.h"
#include <CalendarEvents/CalendarEventsPlugin>
#include <QAbstractListModel>
#include <QCoreApplication>
#include <QDebug>
......@@ -258,6 +256,8 @@ void EventPluginsManager::loadPlugin(const QString &absolutePath)
connect(eventsPlugin, &CalendarEvents::CalendarEventsPlugin::dataReady, this, &EventPluginsManager::dataReady);
connect(eventsPlugin, &CalendarEvents::CalendarEventsPlugin::eventModified, this, &EventPluginsManager::eventModified);
connect(eventsPlugin, &CalendarEvents::CalendarEventsPlugin::eventRemoved, this, &EventPluginsManager::eventRemoved);
connect(eventsPlugin, &CalendarEvents::CalendarEventsPlugin::alternateDateReady, this, &EventPluginsManager::alternateDateReady);
connect(eventsPlugin, &CalendarEvents::CalendarEventsPlugin::subLabelReady, this, &EventPluginsManager::subLabelReady);
} else {
// not our/valid plugin, so unload it
loader.unload();
......
......@@ -10,9 +10,10 @@
#include <QObject>
#include <QStringList>
#include <CalendarEvents/CalendarEventsPlugin>
namespace CalendarEvents
{
class CalendarEventsPlugin;
class EventData;
}
class EventPluginsModel;
......@@ -44,13 +45,27 @@ public:
Q_SIGNALS:
void pluginsChanged();
// These three signals below are used for relaying the
// These 5 signals below are used for relaying the
// plugin signals so that the EventPluginsManager don't
// have to worry about connecting to newly loaded plugins
void dataReady(const QMultiHash<QDate, CalendarEvents::EventData> &data);
void eventModified(const CalendarEvents::EventData &modifiedEvent);
void eventRemoved(const QString &uid);
/**
* Relays the plugin signal that contains alternate dates
*
* @param data a hash from CalendarEventsPlugin
*/
void alternateDateReady(const QHash<QDate, QDate> &data);
/**
* Relays the plugin signal that contains sub-labels
*
* @param data a hash from CalendarEventsPlugin
*/
void subLabelReady(const QHash<QDate, CalendarEvents::CalendarEventsPlugin::SubLabel> &data);
private:
void loadPlugin(const QString &absolutePath);
......
Supports Markdown
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