Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/calendar/eventpluginsmanager.cpp
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Line(s) | 201 | { | |||
---|---|---|---|---|---|
225 | Q_EMIT pluginsChanged(); | 225 | Q_EMIT pluginsChanged(); | ||
226 | } | 226 | } | ||
227 | 227 | | |||
228 | QStringList EventPluginsManager::enabledPlugins() const | 228 | QStringList EventPluginsManager::enabledPlugins() const | ||
229 | { | 229 | { | ||
230 | return m_enabledPlugins; | 230 | return m_enabledPlugins; | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | QList<CalendarEvents::CalendarEventsPlugin*> EventPluginsManager::enabledPluginsInstances() const | ||||
234 | { | ||||
235 | QList<CalendarEvents::CalendarEventsPlugin*> rv; | ||||
236 | std::copy_if(m_plugins.cbegin(), m_plugins.cend(), std::back_inserter(rv), | ||||
237 | [this](const CalendarEvents::CalendarEventsPlugin *plugin) { | ||||
238 | return m_enabledPlugins.contains(plugin->property("pluginPath").toString()); | ||||
239 | }); | ||||
240 | return rv; | ||||
241 | } | ||||
242 | | ||||
233 | void EventPluginsManager::loadPlugin(const QString &absolutePath) | 243 | void EventPluginsManager::loadPlugin(const QString &absolutePath) | ||
234 | { | 244 | { | ||
235 | QPluginLoader loader(absolutePath); | 245 | QPluginLoader loader(absolutePath); | ||
236 | 246 | | |||
237 | if (!loader.load()) { | 247 | if (!loader.load()) { | ||
238 | qWarning() << "Could not create Plasma Calendar Plugin: " << absolutePath; | 248 | qWarning() << "Could not create Plasma Calendar Plugin: " << absolutePath; | ||
239 | qWarning() << loader.errorString(); | 249 | qWarning() << loader.errorString(); | ||
240 | return; | 250 | return; | ||
Show All 37 Lines |