diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt index aa3f12a6e..ac1b27814 100644 --- a/misc/CMakeLists.txt +++ b/misc/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory(qtcurvepreset) -add_subdirectory(kde4breeze) add_subdirectory(breezetobreezelight) add_subdirectory(breezehighcontrasttobreezedark) add_subdirectory(breezetobreezeclassic) diff --git a/misc/kde4breeze/CMakeLists.txt b/misc/kde4breeze/CMakeLists.txt deleted file mode 100644 index ec9a18da1..000000000 --- a/misc/kde4breeze/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -find_package(Qt5 REQUIRED COMPONENTS Widgets) -find_package(KF5 REQUIRED COMPONENTS CoreAddons Config) - - -add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) - -add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) -add_definitions(-DQT_NO_URL_CAST_FROM_STRING) - -remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS) - - -add_subdirectory( src ) - diff --git a/misc/kde4breeze/src/CMakeLists.txt b/misc/kde4breeze/src/CMakeLists.txt deleted file mode 100644 index 8f4c445ff..000000000 --- a/misc/kde4breeze/src/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -# In this CMakeLists.txt we define which files -# are used to compile the application -set(kde4breeze_SRCS - #application.cpp - main.cpp - ) - -# Set the name of the application -add_executable(kde4breeze ${kde4breeze_SRCS}) - -# Select which libraries we need to link to -target_link_libraries(kde4breeze Qt::Widgets KF5::CoreAddons KF5::ConfigCore) - -# Tell cmake to install the application binary -install(TARGETS kde4breeze DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/) -install(FILES kde4breeze.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) - -# Install the color scheme - diff --git a/misc/kde4breeze/src/Messages.sh b/misc/kde4breeze/src/Messages.sh deleted file mode 100644 index 1dda7e302..000000000 --- a/misc/kde4breeze/src/Messages.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env bash -$EXTRACTRC `find . -name \*.rc` >> rc.cpp -$XGETTEXT *.cpp -o $podir/kde4breeze.pot diff --git a/misc/kde4breeze/src/kde4breeze.upd b/misc/kde4breeze/src/kde4breeze.upd deleted file mode 100644 index f3293178c..000000000 --- a/misc/kde4breeze/src/kde4breeze.upd +++ /dev/null @@ -1,3 +0,0 @@ -Version=5 -Id=5.0KDE4Breeze_2 -Script=kde4breeze diff --git a/misc/kde4breeze/src/main.cpp b/misc/kde4breeze/src/main.cpp deleted file mode 100644 index af6c9f6bc..000000000 --- a/misc/kde4breeze/src/main.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2014 Marco Martin - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -static const QString defaultLookAndFeelPackage = "org.kde.breeze.desktop"; - -void applyColorScheme(const QString &colorScheme, KConfig *other) -{ - QString src = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "color-schemes/" + colorScheme + ".colors"); - - KSharedConfigPtr config = KSharedConfig::openConfig(src); - - foreach (const QString &grp, config->groupList()) { - KConfigGroup cg(config, grp); - KConfigGroup cg2(other, grp); - cg.copyTo(&cg2, KConfigBase::Notify); - } -} - -void cloneColorScheme(const QString &colorScheme) -{ - Kdelibs4Migration migration; - QString src = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "color-schemes/" + colorScheme + ".colors"); - QString dest = migration.saveLocation("data", "color-schemes") + colorScheme + ".colors"; - - QDir dir; - dir.mkpath(migration.saveLocation("data", "color-schemes")); - QFile::remove(dest); - QFile::copy(src, dest); -} - -QVariant readConfigValue(KSharedConfigPtr lnfConfig, KSharedConfigPtr defaultLnfConfig, - const QString &group, const QString &key, const QVariant &defaultValue) -{ - QVariant value; - - if (lnfConfig) { - KConfigGroup lnfCg(lnfConfig, "kdeglobals"); - lnfCg = KConfigGroup(&lnfCg, group); - if (lnfCg.isValid()) { - value = lnfCg.readEntry(key, defaultValue); - - if (!value.isNull()) { - return value; - } - } - } - - KConfigGroup lnfCg(defaultLnfConfig, "kdeglobals"); - lnfCg = KConfigGroup(defaultLnfConfig, group); - if (lnfCg.isValid()) { - return lnfCg.readEntry(key, defaultValue); - } - - return defaultValue; -} - -void updateKdeGlobals() -{ - Kdelibs4Migration migration; - //Apply the color scheme - KConfig config(migration.saveLocation("config") + "kdeglobals", KConfig::SimpleConfig); - - KSharedConfig::Ptr kf5Config = KSharedConfig::openConfig("kdeglobals"); - KConfigGroup kf5Group(kf5Config, "General"); - KConfigGroup kf52Group(kf5Config, "KDE"); - - const QString looknfeel = kf52Group.readEntry("LookAndFeelPackage", defaultLookAndFeelPackage); - - KSharedConfigPtr lnfConfig; - KSharedConfigPtr defaultLnfConfig = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/look-and-feel/" + defaultLookAndFeelPackage + "/contents/defaults")); - if (looknfeel != defaultLookAndFeelPackage) { - lnfConfig = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/look-and-feel/" + looknfeel + "/contents/defaults")); - } - - const QString widgetStyle = readConfigValue(lnfConfig, defaultLnfConfig, "KDE", "widgetStyle", "Breeze").toString(); - const QString colorScheme = readConfigValue(lnfConfig, defaultLnfConfig, "General", "ColorScheme", "BreezeLight").toString(); - const QString icons = readConfigValue(lnfConfig, defaultLnfConfig, "Icons", "Theme", "breeze").toString(); - - cloneColorScheme(colorScheme); - - //use only if the style from the look and feel package is installed - const bool hasWidgetStyle = QStyleFactory::keys().contains(widgetStyle); - KConfigGroup group(&config, "General"); - group.writeEntry("ColorScheme", colorScheme); - - qDebug() << "setting widget style:" << widgetStyle << hasWidgetStyle; - if (hasWidgetStyle) { - group.writeEntry("widgetStyle", widgetStyle); - //for some reason this seems necessary - group.sync(); - } - applyColorScheme(colorScheme, &config); - group.sync(); - - KConfigGroup iconGroup(&config, "Icons"); - iconGroup.writeEntry("Theme", icons); - iconGroup.sync(); - - - kf5Group.writeEntry("ColorScheme", colorScheme); - kf5Group.sync(); - if (hasWidgetStyle) { - kf5Group.writeEntry("widgetStyle", widgetStyle); - } - applyColorScheme(colorScheme, kf5Group.config()); - kf5Group.sync(); - - - kf52Group.writeEntry("ColorScheme", colorScheme); - if (hasWidgetStyle) { - kf52Group.writeEntry("widgetStyle", widgetStyle); - } - applyColorScheme(colorScheme, kf52Group.config()); - kf52Group.sync(); - - KConfigGroup kf5IconGroup(kf5Config, "Icons"); - kf5IconGroup.writeEntry("Theme", icons); - kf5IconGroup.sync(); -} - -int main(int argc, char **argv) -{ - - QCoreApplication app(argc, argv); - - updateKdeGlobals(); - - return 0; -}