Verified Commit f269d880 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port away from create functions

parent ac95558e
......@@ -14,8 +14,8 @@
#include <QWhatsThis>
using namespace NoteShared;
NoteActionConfig::NoteActionConfig(QWidget *parent)
: KCModule(parent)
NoteActionConfig::NoteActionConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
{
auto layout = new QGridLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
......
......@@ -12,7 +12,7 @@ class NOTESHARED_EXPORT NoteActionConfig : public KCModule
{
Q_OBJECT
public:
explicit NoteActionConfig(QWidget *parent);
explicit NoteActionConfig(QWidget *parent = nullptr, const QVariantList &args = QVariantList());
/** Reimplemented from KCModule. */
void load() override;
void save() override;
......
......@@ -96,8 +96,8 @@ void NoteNetworkConfigWidget::load()
d->kcfg_Port->setValue(NoteShared::NoteSharedGlobalConfig::self()->port());
}
NoteNetworkConfig::NoteNetworkConfig(QWidget *parent)
: KCModule(parent)
NoteNetworkConfig::NoteNetworkConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
{
auto lay = new QVBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
......
......@@ -27,7 +27,7 @@ class NOTESHARED_EXPORT NoteNetworkConfig : public KCModule
{
Q_OBJECT
public:
explicit NoteNetworkConfig(QWidget *parent);
explicit NoteNetworkConfig(QWidget *parent = nullptr, const QVariantList &args = QVariantList());
/** Reimplemented from KCModule. */
void load() override;
void save() override;
......
......@@ -122,21 +122,18 @@ install(TARGETS knotes ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(kcm_knotes_PART_SRCS knoteconfigmodule.cpp kcm_knotes.cpp configdialog/knotecollectionconfigwidget.cpp)
set(kcm_knotes_PART_SRCS knoteconfigmodule.cpp configdialog/knotecollectionconfigwidget.cpp)
ecm_qt_declare_logging_category(kcm_knotes_PART_SRCS HEADER knotes_kcm_debug.h IDENTIFIER KNOTES_MODULES_LOG CATEGORY_NAME org.kde.pim.knotes.module
DESCRIPTION "kcm knotes (knotes)"
OLD_CATEGORY_NAMES log_knotes_modules
EXPORT KNOTES
)
add_library(kcm_knote MODULE ${kcm_knotes_PART_SRCS} )
add_library(kcm_knote_static STATIC ${kcm_knotes_PART_SRCS} )
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(kcm_knote PROPERTIES UNITY_BUILD ON)
set_target_properties(kcm_knote_static PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kcm_knote knotesprivate KF5::AkonadiCore KF5::KCMUtils KF5::NewStuff notesharedprivate KF5::AkonadiNotes KF5::PimCommon KF5::I18n KF5::AkonadiWidgets)
install(TARGETS kcm_knote DESTINATION ${KDE_INSTALL_PLUGINDIR})
target_link_libraries(kcm_knote_static knotesprivate KF5::AkonadiCore KF5::KCMUtils KF5::NewStuff notesharedprivate KF5::AkonadiNotes KF5::PimCommon KF5::I18n KF5::AkonadiWidgets)
install(FILES
data/knote_config_action.desktop
......@@ -148,6 +145,37 @@ install(FILES
data/knote_config_misc.desktop
DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
kcoreaddons_desktop_to_json(kcm_knote_static "data/knote_config_action.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_knote_static "data/knote_config_display.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_knote_static "data/knote_config_editor.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_knote_static "data/knote_config_network.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_knote_static "data/knote_config_print.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_knote_static "data/knote_config_collection.desktop" SERVICE_TYPES kcmodule.desktop)
kcoreaddons_desktop_to_json(kcm_knote_static "data/knote_config_misc.desktop" SERVICE_TYPES kcmodule.desktop)
# Create the individual KCMs
kcoreaddons_add_plugin(kcm_knote_action SOURCES kcm_knote_action.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_knote_action kcm_knote_static)
kcoreaddons_add_plugin(kcm_knote_display SOURCES kcm_knote_display.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_knote_display kcm_knote_static)
kcoreaddons_add_plugin(kcm_knote_editor SOURCES kcm_knote_editor.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_knote_editor kcm_knote_static)
kcoreaddons_add_plugin(kcm_knote_network SOURCES kcm_knote_network.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_knote_network kcm_knote_static)
kcoreaddons_add_plugin(kcm_knote_print SOURCES kcm_knote_print.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_knote_print kcm_knote_static)
kcoreaddons_add_plugin(kcm_knote_collection SOURCES kcm_knote_collection.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_knote_collection kcm_knote_static)
kcoreaddons_add_plugin(kcm_knote_misc SOURCES kcm_knote_misc.cpp INSTALL_NAMESPACE "kcms")
target_link_libraries(kcm_knote_misc kcm_knote_static)
########### install files ###############
install( PROGRAMS data/org.kde.knotes.desktop DESTINATION ${KDE_INSTALL_APPDIR})
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_knote
X-KDE-FactoryName=knote_config_action
X-KDE-Library=kcms/kcm_knote_action
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=knotes
X-KDE-ParentComponents=knotes,kontact_knotesplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_knote
X-KDE-FactoryName=knote_config_collection
X-KDE-Library=kcms/kcm_knote_collection
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=knotes
X-KDE-ParentComponents=knotes,kontact_knotesplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_knote
X-KDE-FactoryName=knote_config_display
X-KDE-Library=kcms/kcm_knote_display
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=knotes
X-KDE-ParentComponents=knotes,kontact_knotesplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_knote
X-KDE-FactoryName=knote_config_editor
X-KDE-Library=kcms/kcm_knote_editor
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=knotes
X-KDE-ParentComponents=knotes,kontact_knotesplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_knote
X-KDE-FactoryName=knote_config_misc
X-KDE-Library=kcms/kcm_knote_misc
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=knotes
X-KDE-ParentComponents=knotes,kontact_knotesplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_knote
X-KDE-FactoryName=knote_config_network
X-KDE-Library=kcms/kcm_knote_network
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=knotes
X-KDE-ParentComponents=knotes,kontact_knotesplugin
......
......@@ -4,8 +4,7 @@ Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_knote
X-KDE-FactoryName=knote_config_print
X-KDE-Library=kcms/kcm_knote_print
X-KDE-HasReadOnlyMode=false
X-KDE-ParentApp=knotes
X-KDE-ParentComponents=knotes,kontact_knotesplugin
......
/*
SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include <KPluginFactory>
#include <config/noteactionconfig.h>
K_PLUGIN_FACTORY_WITH_JSON(NoteActionConfigFactory, "knote_config_editor.json", registerPlugin<NoteShared::NoteActionConfig>();)
#include "kcm_knote_action.moc"
/*
SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "knoteconfigmodule.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(KNoteCollectionConfigFactory, "knote_config_collection.json", registerPlugin<KNoteCollectionConfig>();)
#include "kcm_knote_collection.moc"
/*
SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "knoteconfigmodule.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(KNoteEditorConfigFactory, "knote_config_display.json", registerPlugin<KNoteDisplayConfig>();)
#include "kcm_knote_display.moc"
/*
SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "knoteconfigmodule.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(KNoteEditorConfigFactory, "knote_config_editor.json", registerPlugin<KNoteEditorConfig>();)
#include "kcm_knote_editor.moc"
/*
SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "knoteconfigmodule.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(KNoteMiscConfigFactory, "knote_config_misc.json", registerPlugin<KNoteMiscConfig>();)
#include "kcm_knote_misc.moc"
/*
SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include <KPluginFactory>
#include <config/notenetworkconfig.h>
K_PLUGIN_FACTORY_WITH_JSON(NoteNetworkConfigFactory, "knote_config_network.json", registerPlugin<NoteShared::NoteNetworkConfig>();)
#include "kcm_knote_network.moc"
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "knoteconfigmodule.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(KNotePrintConfigFactory, "knote_config_print.json", registerPlugin<KNotePrintConfig>();)
#include "kcm_knote_print.moc"
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "knoteconfigmodule.h"
#include <KCModule>
#include <config/noteactionconfig.h>
#include <config/notenetworkconfig.h>
extern "C" {
Q_DECL_EXPORT KCModule *create_knote_config_display(QWidget *parent)
{
return new KNoteDisplayConfig(parent);
}
}
extern "C" {
Q_DECL_EXPORT KCModule *create_knote_config_collection(QWidget *parent)
{
return new KNoteCollectionConfig(parent);
}
}
extern "C" {
Q_DECL_EXPORT KCModule *create_knote_config_editor(QWidget *parent)
{
return new KNoteEditorConfig(parent);
}
}
extern "C" {
Q_DECL_EXPORT KCModule *create_knote_config_action(QWidget *parent)
{
return new NoteShared::NoteActionConfig(parent);
}
}
extern "C" {
Q_DECL_EXPORT KCModule *create_knote_config_network(QWidget *parent)
{
return new NoteShared::NoteNetworkConfig(parent);
}
}
extern "C" {
Q_DECL_EXPORT KCModule *create_knote_config_print(QWidget *parent)
{
return new KNotePrintConfig(parent);
}
}
extern "C" {
Q_DECL_EXPORT KCModule *create_knote_config_misc(QWidget *parent)
{
return new KNoteMiscConfig(parent);
}
}
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