Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Only hide KCM in KWin Scripts KCM #491

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions src/kcm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# SPDX-FileCopyrightText: 2021 Mikhail Zolotukhin <[email protected]>
# SPDX-FileCopyrightText: 2023 Alexander Lohnau <[email protected]>
# 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(
Expand All @@ -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)

Expand Down
17 changes: 3 additions & 14 deletions src/kcm/bismuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,13 @@
#include <KPluginFactory>
#include <qstringliteral.h>

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 <[email protected]>"));

aboutData->addAuthor(i18nc("@info:credit", "Author"), i18nc("@info:credit", "Author"), QStringLiteral("[email protected]"));

setAboutData(aboutData);
setButtons(Help | Apply | Default);

qmlRegisterAnonymousType<Bismuth::Config>("org.kde.bismuth.private", 1);
}

Expand Down
3 changes: 1 addition & 2 deletions src/kcm/bismuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
14 changes: 14 additions & 0 deletions src/kcm/kcm_bismuth.json
Original file line number Diff line number Diff line change
@@ -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"
}
18 changes: 0 additions & 18 deletions src/kcm/package/metadata.desktop

This file was deleted.

3 changes: 0 additions & 3 deletions src/kwinscript/metadata.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ 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@
X-KDE-PluginInfo-Author=Mikhail Zolotukhin
[email protected]
X-KDE-PluginInfo-Website=github.com/Bismuth-Forge/bismuth
X-KDE-PluginInfo-License=MIT

X-KWin-Exclude-Listing=true