Commit 7df101c4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port away old plugin system

parent 6955e7c5
Pipeline #61233 canceled with stage
......@@ -369,11 +369,37 @@ set_target_properties(kmailprivate
)
########### kcm_kmail ###############
set(kcm_kmail_PART_SRCS kcm_kmail.cpp )
add_library(kcm_kmail MODULE ${kcm_kmail_PART_SRCS})
pim_target_precompile_headers(kcm_kmail PUBLIC ../kmail_pch.h)
target_link_libraries(kcm_kmail kmailprivate KF5::KCMUtils KF5::Completion KF5::I18n KF5::TextWidgets)
set(kcm_kmail_PART_SRCS kcm_kmail.cpp)
add_library(kcm_kmail_static STATIC ${kcm_kmail_PART_SRCS})
pim_target_precompile_headers(kcm_kmail_static PUBLIC ../kmail_pch.h)
target_link_libraries(kcm_kmail_static kmailprivate KF5::KCMUtils KF5::Completion KF5::I18n KF5::TextWidgets)
kcoreaddons_desktop_to_json(kcm_kmail_static "configuredialog/data/kmail_config_accounts.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_kmail_static "configuredialog/data/kmail_config_appearance.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_kmail_static "configuredialog/data/kmail_config_composer.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_kmail_static "configuredialog/data/kmail_config_misc.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_kmail_static "configuredialog/data/kmail_config_plugins.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_kmail_static "configuredialog/data/kmail_config_security.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_add_plugin(kcm_kmail_accounts SOURCES configuredialog/kcm_kmail_accounts.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_kmail_accounts kcm_kmail_static)
kcoreaddons_add_plugin(kcm_kmail_appearance SOURCES configuredialog/kcm_kmail_appearance.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_kmail_appearance kcm_kmail_static)
kcoreaddons_add_plugin(kcm_kmail_composer SOURCES configuredialog/kcm_kmail_composer.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_kmail_composer kcm_kmail_static)
kcoreaddons_add_plugin(kcm_kmail_misc SOURCES configuredialog/kcm_kmail_misc.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_kmail_misc kcm_kmail_static)
kcoreaddons_add_plugin(kcm_kmail_plugins SOURCES configuredialog/kcm_kmail_plugins.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_kmail_plugins kcm_kmail_static)
kcoreaddons_add_plugin(kcm_kmail_security SOURCES configuredialog/kcm_kmail_security.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_kmail_security kcm_kmail_static)
########### kmailpart ###############
set(kmailpart_PART_SRCS kmail_part.cpp ${kmail_common_SRCS})
......@@ -424,31 +450,31 @@ if(BUILD_TESTING)
add_subdirectory(job/autotests/)
endif()
########### install files ###############
install(TARGETS kmailprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS kmail ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES
configuredialog/data/kmail_config_misc.desktop
configuredialog/data/kmail_config_appearance.desktop
configuredialog/data/kmail_config_accounts.desktop
configuredialog/data/kmail_config_composer.desktop
configuredialog/data/kmail_config_security.desktop
configuredialog/data/kmail_config_plugins.desktop
DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
)
install(PROGRAMS data/org.kde.kmail2.desktop data/kmail_view.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg
DESTINATION ${KDE_INSTALL_KCFGDIR}
)
install(FILES data/org.kde.kmail2.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES
data/kmail_config_misc.desktop
data/kmail_config_appearance.desktop
data/kmail_config_accounts.desktop
data/kmail_config_composer.desktop
data/kmail_config_security.desktop
data/kmail_config_plugins.desktop
DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
)
install( FILES data/kmail2.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
install(TARGETS
kmailpart
kcm_kmail
DESTINATION ${KDE_INSTALL_PLUGINDIR}
)
install(FILES
......
......@@ -17,8 +17,8 @@
class ConfigModule : public KCModule
{
public:
explicit ConfigModule(QWidget *parent = nullptr)
: KCModule(parent)
explicit ConfigModule(QWidget *parent = nullptr, const QVariantList &args = {})
: KCModule(parent, args)
{
}
......
......@@ -49,8 +49,8 @@ QString AccountsPage::helpAnchor() const
return QStringLiteral("configure-accounts");
}
AccountsPage::AccountsPage(QWidget *parent)
: ConfigModuleWithTabs(parent)
AccountsPage::AccountsPage(QWidget *parent, const QVariantList &args)
: ConfigModuleWithTabs(parent, args)
{
// Identity Tab:
auto identityTab = new KMail::IdentityPage();
......
......@@ -105,7 +105,7 @@ class KMAIL_EXPORT AccountsPage : public ConfigModuleWithTabs
{
Q_OBJECT
public:
explicit AccountsPage(QWidget *parent = nullptr);
explicit AccountsPage(QWidget *parent = nullptr, const QVariantList &args = {});
QString helpAnchor() const override;
// hrmpf. moc doesn't like nested classes with slots/signals...:
......
......@@ -73,8 +73,8 @@ QString AppearancePage::helpAnchor() const
return QStringLiteral("configure-appearance");
}
AppearancePage::AppearancePage(QWidget *parent)
: ConfigModuleWithTabs(parent)
AppearancePage::AppearancePage(QWidget *parent, const QVariantList &args)
: ConfigModuleWithTabs(parent, args)
{
//
// "General" tab:
......
......@@ -264,7 +264,7 @@ class KMAIL_EXPORT AppearancePage : public ConfigModuleWithTabs
{
Q_OBJECT
public:
explicit AppearancePage(QWidget *parent = nullptr);
explicit AppearancePage(QWidget *parent = nullptr, const QVariantList &args = {});
QString helpAnchor() const override;
......
......@@ -55,8 +55,8 @@ QString ComposerPage::helpAnchor() const
return QStringLiteral("configure-composer");
}
ComposerPage::ComposerPage(QWidget *parent)
: ConfigModuleWithTabs(parent)
ComposerPage::ComposerPage(QWidget *parent, const QVariantList &args)
: ConfigModuleWithTabs(parent, args)
{
//
// "General" tab:
......
......@@ -234,7 +234,7 @@ class KMAIL_EXPORT ComposerPage : public ConfigModuleWithTabs
{
Q_OBJECT
public:
explicit ComposerPage(QWidget *parent = nullptr);
explicit ComposerPage(QWidget *parent = nullptr, const QVariantList &args = {});
QString helpAnchor() const override;
......
......@@ -16,8 +16,8 @@
// Other headers:
ConfigModuleWithTabs::ConfigModuleWithTabs(QWidget *parent)
: ConfigModule(parent)
ConfigModuleWithTabs::ConfigModuleWithTabs(QWidget *parent, const QVariantList &args)
: ConfigModule(parent, args)
, mTabWidget(new QTabWidget(this))
{
auto vlay = new QVBoxLayout(this);
......
......@@ -62,7 +62,7 @@ class KMAIL_EXPORT ConfigModuleWithTabs : public ConfigModule
{
Q_OBJECT
public:
explicit ConfigModuleWithTabs(QWidget *parent = nullptr);
explicit ConfigModuleWithTabs(QWidget *parent = nullptr, const QVariantList &args = {});
~ConfigModuleWithTabs() override = default;
// don't reimplement any of those methods
......
......@@ -27,8 +27,8 @@ QString MiscPage::helpAnchor() const
return QStringLiteral("configure-misc");
}
MiscPage::MiscPage(QWidget *parent)
: ConfigModuleWithTabs(parent)
MiscPage::MiscPage(QWidget *parent, const QVariantList &args)
: ConfigModuleWithTabs(parent, args)
{
auto folderTab = new FolderTab();
addTab(folderTab, i18n("Folders"));
......
......@@ -57,7 +57,7 @@ class KMAIL_EXPORT MiscPage : public ConfigModuleWithTabs
{
Q_OBJECT
public:
explicit MiscPage(QWidget *parent = nullptr);
explicit MiscPage(QWidget *parent = nullptr, const QVariantList &args = {});
QString helpAnchor() const override;
using FolderTab = MiscPageFolderTab;
......
......@@ -10,8 +10,8 @@
#include <QHBoxLayout>
ConfigurePluginPage::ConfigurePluginPage(QWidget *parent)
: ConfigModule(parent)
ConfigurePluginPage::ConfigurePluginPage(QWidget *parent, const QVariantList &args)
: ConfigModule(parent, args)
{
auto l = new QHBoxLayout(this);
l->setContentsMargins({});
......
......@@ -17,7 +17,7 @@ class KMAIL_EXPORT ConfigurePluginPage : public ConfigModule
{
Q_OBJECT
public:
explicit ConfigurePluginPage(QWidget *parent);
explicit ConfigurePluginPage(QWidget *parent, const QVariantList &args = {});
~ConfigurePluginPage() override;
Q_REQUIRED_RESULT QString helpAnchor() const override;
......
......@@ -35,8 +35,8 @@ QString SecurityPage::helpAnchor() const
return QStringLiteral("configure-security");
}
SecurityPage::SecurityPage(QWidget *parent)
: ConfigModuleWithTabs(parent)
SecurityPage::SecurityPage(QWidget *parent, const QVariantList &args)
: ConfigModuleWithTabs(parent, args)
{
//
// "Reading" tab:
......
......@@ -136,7 +136,7 @@ class KMAIL_EXPORT SecurityPage : public ConfigModuleWithTabs
{
Q_OBJECT
public:
explicit SecurityPage(QWidget *parent = nullptr);
explicit SecurityPage(QWidget *parent = nullptr, const QVariantList &args = {});
QString helpAnchor() const override;
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_kmail
X-KDE-FactoryName=kmail_config_accounts
X-KDE-Library=kcms/kcm_kmail_accounts
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=kmail
X-KDE-ParentComponents=kmail,kontact_kmailplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_kmail
X-KDE-FactoryName=kmail_config_appearance
X-KDE-Library=kcms/kcm_kmail_appearance
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=kmail
X-KDE-ParentComponents=kmail,kontact_kmailplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_kmail
X-KDE-FactoryName=kmail_config_composer
X-KDE-Library=kcms/kcm_kmail_composer
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=kmail
X-KDE-ParentComponents=kmail,kontact_kmailplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_kmail
X-KDE-FactoryName=kmail_config_misc
X-KDE-Library=kcms/kcm_kmail_misc
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=kmail
X-KDE-ParentComponents=kmail,kontact_kmailplugin
......
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