Commit 8e37d1c6 authored by Benjamin Port's avatar Benjamin Port
Browse files

KCM don't support icons effect anymore, clean-up config file

Summary: Settings for icons effect where removed in plasma 5.16, cleanup config file and code

Test Plan: Added manually entry to my config file and after script was run the entry was not there anymore

Reviewers: #plasma, mart, broulik, ervin

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24845
parent 8a5439f8
......@@ -24,6 +24,7 @@ add_executable(plasma-changeicons changeicons.cpp)
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)
......
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
......@@ -164,41 +164,17 @@ void IconModule::save()
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 @@ void IconModule::save()
setNeedsSave(false);
m_selectedThemeDirty = false;
m_iconSizesDirty = false;
m_revertIconEffects = false;
}
void IconModule::processPendingDeletions()
......@@ -249,7 +224,6 @@ void IconModule::defaults()
setThemeIfAvailable(QStringLiteral("breeze"));
}
m_revertIconEffects = true;
setNeedsSave(true);
}
......
......@@ -112,9 +112,6 @@ private:
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<int> m_iconSizes;
QStringList m_iconGroups;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment