Remove invalid tabbox configs from defaults
We know that org.kde.breeze.desktop is invalid as LayoutName for the tabbox, it will break the default button in the tabbox kcm. Also the DesktopListLayout and DesktopLayout aren't valid anymore BUG:481640
This commit is contained in:
parent
d377b5cdab
commit
86ede0ecf2
3 changed files with 49 additions and 0 deletions
|
@ -11,5 +11,10 @@ target_sources(kwin-6.0-reset-active-mouse-screen PRIVATE kwin-6.0-reset-active-
|
||||||
target_link_libraries(kwin-6.0-reset-active-mouse-screen PRIVATE KF6::ConfigCore)
|
target_link_libraries(kwin-6.0-reset-active-mouse-screen PRIVATE KF6::ConfigCore)
|
||||||
install(TARGETS kwin-6.0-reset-active-mouse-screen DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/)
|
install(TARGETS kwin-6.0-reset-active-mouse-screen DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/)
|
||||||
|
|
||||||
|
add_executable(kwin-6.0-remove-breeze-tabbox-default)
|
||||||
|
target_sources(kwin-6.0-remove-breeze-tabbox-default PRIVATE kwin-6.0-remove-breeze-tabbox-default.cpp)
|
||||||
|
target_link_libraries(kwin-6.0-remove-breeze-tabbox-default PRIVATE KF6::ConfigCore)
|
||||||
|
install(TARGETS kwin-6.0-remove-breeze-tabbox-default DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/)
|
||||||
|
|
||||||
install(FILES kwin.upd
|
install(FILES kwin.upd
|
||||||
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
|
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
|
||||||
|
|
40
kconf_update/kwin-6.0-remove-breeze-tabbox-default.cpp
Normal file
40
kconf_update/kwin-6.0-remove-breeze-tabbox-default.cpp
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2024 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <KConfigGroup>
|
||||||
|
#include <KSharedConfig>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
KConfig config(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1String("/kdedefaults/kwinrc"), KConfig::SimpleConfig);
|
||||||
|
|
||||||
|
KConfigGroup windows = config.group(QStringLiteral("TabBox"));
|
||||||
|
bool needsSync = false;
|
||||||
|
|
||||||
|
if (!windows.exists()) {
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (windows.hasKey(QStringLiteral("LayoutName")) && windows.readEntry(QStringLiteral("LayoutName"), QString()) == QString("org.kde.breeze.desktop")) {
|
||||||
|
windows.deleteEntry(QStringLiteral("LayoutName"));
|
||||||
|
needsSync = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (windows.hasKey(QStringLiteral("DesktopListLayout"))) {
|
||||||
|
windows.deleteEntry(QStringLiteral("DesktopListLayout"));
|
||||||
|
needsSync = true;
|
||||||
|
}
|
||||||
|
if (windows.hasKey(QStringLiteral("DesktopLayout"))) {
|
||||||
|
windows.deleteEntry(QStringLiteral("DesktopLayout"));
|
||||||
|
needsSync = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsSync) {
|
||||||
|
return windows.sync() ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
|
} else {
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,3 +10,7 @@ Script=kwin-6.0-reset-active-mouse-screen
|
||||||
# Delete old desktop switching shortcuts.
|
# Delete old desktop switching shortcuts.
|
||||||
Id=kwin-6.0-delete-desktop-switching-shortcuts
|
Id=kwin-6.0-delete-desktop-switching-shortcuts
|
||||||
Script=kwin-6.0-delete-desktop-switching-shortcuts
|
Script=kwin-6.0-delete-desktop-switching-shortcuts
|
||||||
|
|
||||||
|
# Delete old tabbox defaults
|
||||||
|
Id=kwin-6.0-remove-breeze-tabbox-default
|
||||||
|
Script=kwin-6.0-remove-breeze-tabbox-default
|
||||||
|
|
Loading…
Reference in a new issue