Commit cffed744 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use KPluginFactory to load calendar plugins

Instead of the homegrown factory.

This brings the code more in line with how plugins are handled in other KDE code.
parent f4024cd1
Pipeline #76460 passed with stage
in 6 minutes and 7 seconds
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "5.18.40")
set(PIM_VERSION "5.18.41")
project(calendarsupport VERSION ${PIM_VERSION})
......
......@@ -19,8 +19,10 @@ namespace CalendarSupport
This class is shared between korganizer's print plugins and
calendarview's decoration plugins.
*/
class Plugin
class CALENDARSUPPORT_EXPORT Plugin : public QObject
{
Q_OBJECT
enum { INTERFACE_VERSION = 2 };
public:
......@@ -34,12 +36,10 @@ public:
return QStringLiteral("Calendar/Plugin");
}
Plugin()
{
}
virtual ~Plugin()
Plugin(QObject *parent = nullptr, const QVariantList &args = {})
: QObject(parent)
{
Q_UNUSED(args);
}
virtual QString info() const = 0;
......@@ -49,17 +49,5 @@ public:
}
};
class CALENDARSUPPORT_EXPORT PluginFactory : public KPluginFactory
{
Q_OBJECT
public:
virtual Plugin *createPluginFactory() = 0;
protected:
QObject *createObject(QObject *, const char *, const QStringList &) override
{
return nullptr;
}
};
}
......@@ -189,11 +189,5 @@ protected:
KConfig *mConfig = nullptr;
};
class PrintPluginFactory : public PluginFactory
{
Q_OBJECT
public:
PrintPlugin *createPluginFactory() override = 0;
};
}
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