diff --git a/kcms/icons/CMakeLists.txt b/kcms/icons/CMakeLists.txt --- a/kcms/icons/CMakeLists.txt +++ b/kcms/icons/CMakeLists.txt @@ -24,6 +24,7 @@ target_link_libraries(plasma-changeicons PRIVATE Qt5::Core KF5::KIOWidgets KF5::IconThemes) kcoreaddons_desktop_to_json(kcm_icons "kcm_icons.desktop") +install(FILES icons_remove_effects.upd DESTINATION ${KDE_INSTALL_DATADIR}/kconf_update) install(FILES kcm_icons.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) install(TARGETS kcm_icons DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms) diff --git a/kcms/icons/icons_remove_effects.upd b/kcms/icons/icons_remove_effects.upd new file mode 100644 --- /dev/null +++ b/kcms/icons/icons_remove_effects.upd @@ -0,0 +1,105 @@ +Version=5 +Id=IconsRemoveEffects +File=kdeglobals +Group=DesktopIcons +RemoveKey=Animated +RemoveKey=DefaultEffect +RemoveKey=DefaultValue +RemoveKey=DefaultColor +RemoveKey=DefaultColor2 +RemoveKey=DefaultSemiTransparent +RemoveKey=ActiveEffect +RemoveKey=ActiveValue +RemoveKey=ActiveColor +RemoveKey=ActiveColor2 +RemoveKey=ActiveSemiTransparent +RemoveKey=DisabledEffect +RemoveKey=DisabledValue +RemoveKey=DisabledColor +RemoveKey=DisabledColor2 +RemoveKey=DisabledSemiTransparent +Group=ToolbarIcons +RemoveKey=Animated +RemoveKey=DefaultEffect +RemoveKey=DefaultValue +RemoveKey=DefaultColor +RemoveKey=DefaultColor2 +RemoveKey=DefaultSemiTransparent +RemoveKey=ActiveEffect +RemoveKey=ActiveValue +RemoveKey=ActiveColor +RemoveKey=ActiveColor2 +RemoveKey=ActiveSemiTransparent +RemoveKey=DisabledEffect +RemoveKey=DisabledValue +RemoveKey=DisabledColor +RemoveKey=DisabledColor2 +RemoveKey=DisabledSemiTransparent +Group=MainToolbarIcons +RemoveKey=Animated +RemoveKey=DefaultEffect +RemoveKey=DefaultValue +RemoveKey=DefaultColor +RemoveKey=DefaultColor2 +RemoveKey=DefaultSemiTransparent +RemoveKey=ActiveEffect +RemoveKey=ActiveValue +RemoveKey=ActiveColor +RemoveKey=ActiveColor2 +RemoveKey=ActiveSemiTransparent +RemoveKey=DisabledEffect +RemoveKey=DisabledValue +RemoveKey=DisabledColor +RemoveKey=DisabledColor2 +RemoveKey=DisabledSemiTransparent +Group=SmallIcons +RemoveKey=Animated +RemoveKey=DefaultEffect +RemoveKey=DefaultValue +RemoveKey=DefaultColor +RemoveKey=DefaultColor2 +RemoveKey=DefaultSemiTransparent +RemoveKey=ActiveEffect +RemoveKey=ActiveValue +RemoveKey=ActiveColor +RemoveKey=ActiveColor2 +RemoveKey=ActiveSemiTransparent +RemoveKey=DisabledEffect +RemoveKey=DisabledValue +RemoveKey=DisabledColor +RemoveKey=DisabledColor2 +RemoveKey=DisabledSemiTransparent +Group=PanelIcons +RemoveKey=Animated +RemoveKey=DefaultEffect +RemoveKey=DefaultValue +RemoveKey=DefaultColor +RemoveKey=DefaultColor2 +RemoveKey=DefaultSemiTransparent +RemoveKey=ActiveEffect +RemoveKey=ActiveValue +RemoveKey=ActiveColor +RemoveKey=ActiveColor2 +RemoveKey=ActiveSemiTransparent +RemoveKey=DisabledEffect +RemoveKey=DisabledValue +RemoveKey=DisabledColor +RemoveKey=DisabledColor2 +RemoveKey=DisabledSemiTransparent +Group=DialogIcons +RemoveKey=Animated +RemoveKey=DefaultEffect +RemoveKey=DefaultValue +RemoveKey=DefaultColor +RemoveKey=DefaultColor2 +RemoveKey=DefaultSemiTransparent +RemoveKey=ActiveEffect +RemoveKey=ActiveValue +RemoveKey=ActiveColor +RemoveKey=ActiveColor2 +RemoveKey=ActiveSemiTransparent +RemoveKey=DisabledEffect +RemoveKey=DisabledValue +RemoveKey=DisabledColor +RemoveKey=DisabledColor2 +RemoveKey=DisabledSemiTransparent diff --git a/kcms/icons/main.h b/kcms/icons/main.h --- a/kcms/icons/main.h +++ b/kcms/icons/main.h @@ -112,9 +112,6 @@ bool m_selectedThemeDirty = false; bool m_iconSizesDirty = false; - // set when user hits "Defaults" button at which point we'll remove all custom icon effects on Apply - bool m_revertIconEffects = false; - QVector m_iconSizes; QStringList m_iconGroups; diff --git a/kcms/icons/main.cpp b/kcms/icons/main.cpp --- a/kcms/icons/main.cpp +++ b/kcms/icons/main.cpp @@ -164,41 +164,17 @@ QProcess::startDetached(CMAKE_INSTALL_FULL_LIBEXECDIR "/plasma-changeicons", {m_model->selectedTheme()}); } - if (m_iconSizesDirty || m_revertIconEffects) { + if (m_iconSizesDirty) { auto cfg = KSharedConfig::openConfig(); for (int i = 0; i < m_iconGroups.count(); ++i) { const QString &group = m_iconGroups.at(i); KConfigGroup cg(cfg, group + QLatin1String("Icons")); cg.writeEntry("Size", m_iconSizes.at(i), KConfig::Normal | KConfig::Global); - - if (m_revertIconEffects) { - cg.revertToDefault("Animated"); - - const QStringList states = { - QStringLiteral("Default"), - QStringLiteral("Active"), - QStringLiteral("Disabled") - }; - - const QStringList keys = { - QStringLiteral("Effect"), - QStringLiteral("Value"), - QStringLiteral("Color"), - QStringLiteral("Color2"), - QStringLiteral("SemiTransparent") - }; - - for (const QString &state : states) { - for (const QString &key : keys) { - cg.revertToDefault(state + key); - } - } - } } cfg->sync(); } - if (m_selectedThemeDirty || m_iconSizesDirty || m_revertIconEffects) { + if (m_selectedThemeDirty || m_iconSizesDirty) { exportToKDE4(); } @@ -209,7 +185,6 @@ setNeedsSave(false); m_selectedThemeDirty = false; m_iconSizesDirty = false; - m_revertIconEffects = false; } void IconModule::processPendingDeletions() @@ -249,7 +224,6 @@ setThemeIfAvailable(QStringLiteral("breeze")); } - m_revertIconEffects = true; setNeedsSave(true); }