D26784: KCM KDED: Add immutability and fix default, reset, apply buttons
Kai Uwe Broulik
noreply at phabricator.kde.org
Wed Jan 22 15:24:19 GMT 2020
broulik added a comment.
Not a fan of the `AutoloadEnabledSavedRole` in the model
INLINE COMMENTS
> kcmkded.cpp:269
> + if (!idx.data(ModulesModel::ImmutableRole).toBool()) {
> + m_model->setData(idx, true, ModulesModel::AutoloadEnabledRole);
> }
I think instead you could have the model refuse to `setData` when immutable
> modulesmodel.cpp:128
> const bool autoloadEnabled = value.toBool();
> if (item.type == KDEDConfig::AutostartType
> + && item.autoloadEnabled != autoloadEnabled) {
Since generally `setData` only does things for `AutostartType`, perhaps move that check out of the `switch`
> modulesmodel.cpp:235
> const bool autoloadEnabled = cg.readEntry("autoload", true);
> + const bool immutable = cg.isEntryImmutable("autoload");
>
Superfluous space
> modulesmodel.cpp:275
> endResetModel();
> + emit autoloadedModulesChanged();
> }
Check whether it actually changed before emitting it
REPOSITORY
R119 Plasma Desktop
REVISION DETAIL
https://phabricator.kde.org/D26784
To: bport, ervin, crossi, meven, broulik
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200122/597bf287/attachment-0001.html>
More information about the Plasma-devel
mailing list