D27384: [KCM Fonts] force need save to false during load to avoid state to be true too early

Benjamin Port noreply at phabricator.kde.org
Thu Feb 13 23:59:04 GMT 2020


bport added a comment.


  @davidedmundson 
  We have 2 bugs :
  
  - KCModuleQML apply button will stay disabled forever if at the end of load function need save is true (probably qml connection not yet done or something like that I guess, not yet found why) => We need to investigate on it too, I reproduced the same behavior with KCM icons  by changing a setting at the end of load method.
  - In theory at the end of load we don't need to save data. However in some case for the font KCM data are dirty and need save. Came from Qt font comparison, if in your kdeglobals you have a font definition without style name, our algorithm to match a nearest font will add one, and font comparison between referential data and current data will return false because they are different.
  
  - My first approach was to fix algorithm to find the nearest font and keep style name empty if we don't have information. After this fix apply button work as expected, but when you adjust this font the selected style will be the first one on the list and not the one expected  (regular)
  - Second approach by setting need save to false at the end of load allow us to be on the good state and the next change will allow us to enable apply button. By the way apply button will be enable directly because settings changed is trigered by another time after loading not sure where (didn't investigated yet)
  
  About KCModuleQML didn't investigate a lot but KCModule (parent class) emit a changed false on showEvent (the way the handle to set need save to false. On qml side we use directly stNeedsSave (you can look at save method implementation), so a proper fix can be to add "d->configModule->setNeedsSave(false);" after loading

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D27384

To: bport, #plasma, broulik, ervin, crossi, meven, ngraham, davidedmundson, The-Feren-OS-Dev
Cc: The-Feren-OS-Dev, plasma-devel, Orage, LeGast00n, cblack, 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/20200213/10d1c2fd/attachment.html>


More information about the Plasma-devel mailing list