diff --git a/src/kcm/CMakeLists.txt b/src/kcm/CMakeLists.txt index aa508844..937a6601 100644 --- a/src/kcm/CMakeLists.txt +++ b/src/kcm/CMakeLists.txt @@ -1,14 +1,11 @@ # SPDX-FileCopyrightText: 2021 Mikhail Zolotukhin +# SPDX-FileCopyrightText: 2023 Alexander Lohnau # SPDX-License-Identifier: MIT -cmake_minimum_required(VERSION 3.16) - -project(bismuth-kcm) - -add_library(kcm_bismuth MODULE) +kcoreaddons_add_plugin(kcm_bismuth INSTALL_NAMESPACE plasma/kcms/systemsettings) +kcmutils_generate_desktop_file(kcm_bismuth) qt_add_dbus_interface(kwin_dbus_srcs org.kde.KWin.xml kwin_interface) - target_sources(kcm_bismuth PRIVATE bismuth.cpp ${kwin_dbus_srcs}) target_link_libraries( @@ -22,13 +19,6 @@ target_link_libraries( KF5::ConfigGui) kconfig_add_kcfg_files(kcm_bismuth GENERATE_MOC "bismuth_config.kcfgc") -kcoreaddons_desktop_to_json(kcm_bismuth "package/metadata.desktop") - -install(TARGETS kcm_bismuth DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms) -install( - FILES package/metadata.desktop - RENAME kcm_bismuth.desktop - DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) kpackage_install_package(package kcm_bismuth kcms) diff --git a/src/kcm/bismuth.cpp b/src/kcm/bismuth.cpp index cde969e1..bd33a103 100644 --- a/src/kcm/bismuth.cpp +++ b/src/kcm/bismuth.cpp @@ -16,24 +16,13 @@ #include #include -K_PLUGIN_CLASS_WITH_JSON(BismuthSettings, "metadata.json") +K_PLUGIN_CLASS_WITH_JSON(BismuthSettings, "kcm_bismuth.json") -BismuthSettings::BismuthSettings(QObject *parent, const QVariantList &args) - : KQuickAddons::ManagedConfigModule(parent, args) +BismuthSettings::BismuthSettings(QObject *parent, const KPluginMetaData &data, const QVariantList &args) + : KQuickAddons::ManagedConfigModule(parent, data, args) , m_config(new Bismuth::Config(this)) { - KAboutData *aboutData = new KAboutData(QStringLiteral("kcm_bismuth"), - i18nc("@title", "Window Tiling"), - QStringLiteral("1.0"), - QStringLiteral(""), - KAboutLicense::LicenseKey::Custom, - i18nc("@info:credit", "Copyright 2021 Mikhail Zolotukhin ")); - - aboutData->addAuthor(i18nc("@info:credit", "Author"), i18nc("@info:credit", "Author"), QStringLiteral("author@domain.com")); - - setAboutData(aboutData); setButtons(Help | Apply | Default); - qmlRegisterAnonymousType("org.kde.bismuth.private", 1); } diff --git a/src/kcm/bismuth.h b/src/kcm/bismuth.h index 272f3029..00526f94 100644 --- a/src/kcm/bismuth.h +++ b/src/kcm/bismuth.h @@ -16,8 +16,7 @@ class BismuthSettings : public KQuickAddons::ManagedConfigModule Q_PROPERTY(Bismuth::Config *config READ config CONSTANT) public: - BismuthSettings(QObject *parent, const QVariantList &args); - virtual ~BismuthSettings() override = default; + BismuthSettings(QObject *parent, const KPluginMetaData &data, const QVariantList &args); Bismuth::Config *config() const; diff --git a/src/kcm/kcm_bismuth.json b/src/kcm/kcm_bismuth.json new file mode 100644 index 00000000..8c46d134 --- /dev/null +++ b/src/kcm/kcm_bismuth.json @@ -0,0 +1,14 @@ +{ + "KPlugin": { + "Description": "Configure window tiling appearance and behavior", + "FormFactors": [ + "desktop", + "handset", + "mediacenter" + ], + "Icon": "bismuth-kcm", + "Name": "Window Tiling" + }, + "X-KDE-Keywords": "KWin,Script,Tiling,Bismuth,Window,WM,Layout,Gaps,Borders,Rules,Minimization,Float", + "X-KDE-System-Settings-Parent-Category": "windowmanagement" +} diff --git a/src/kcm/package/metadata.desktop b/src/kcm/package/metadata.desktop deleted file mode 100644 index bf67eeaa..00000000 --- a/src/kcm/package/metadata.desktop +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-FileCopyrightText: none -# -# SPDX-License-Identifier: MIT - -[Desktop Entry] -Name=Window Tiling -Comment=Configure window tiling appearance and behavior -Encoding=UTF-8 -Type=Service -Icon=bismuth-kcm -X-KDE-Library=kcm_bismuth -X-KDE-ServiceTypes=KCModule -X-KDE-FormFactors=desktop,handset,tablet,mediacenter -X-Plasma-MainScript=ui/main.qml -X-KDE-System-Settings-Parent-Category=windowmanagement -X-KDE-Keywords=KWin,Script,Tiling,Bismuth,Window,WM,Layout,Gaps,Borders,Rules,Minimization,Float -X-KDE-ParentApp=kcontrol -X-KDE-PluginInfo-Name=kcm_bismuth diff --git a/src/kwinscript/metadata.desktop b/src/kwinscript/metadata.desktop index b0a4d86f..34641c75 100644 --- a/src/kwinscript/metadata.desktop +++ b/src/kwinscript/metadata.desktop @@ -14,7 +14,6 @@ X-Plasma-MainScript=ui/main.qml X-KDE-ServiceTypes=KWin/Script X-KDE-PluginKeyword=bismuth -X-KDE-ParentComponents=bismuth X-KDE-PluginInfo-Name=bismuth X-KDE-PluginInfo-Version=@CMAKE_PROJECT_VERSION@ @@ -22,5 +21,3 @@ X-KDE-PluginInfo-Author=Mikhail Zolotukhin X-KDE-PluginInfo-Email=mail@genda.life X-KDE-PluginInfo-Website=github.com/Bismuth-Forge/bismuth X-KDE-PluginInfo-License=MIT - -X-KWin-Exclude-Listing=true