D27785: [Fonts KCM] Change setNearestExistingFonts() to set the fonts only when necessary

Benjamin Port noreply at phabricator.kde.org
Mon Mar 9 09:43:53 GMT 2020


bport requested changes to this revision.
bport added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> fonts.cpp:115
> +    if (!sameFont) {
> +        if (font.weight() == QFont::Normal && font.styleName().isEmpty()
> +            && result.weight() == QFont::Normal

You can use && to have only one if there

> fonts.cpp:552
>  {
> -    m_settings->setFont(nearestExistingFont(m_settings->font()));
> -    m_settings->setFixed(nearestExistingFont(m_settings->fixed()));

Those change will compare font twice, here and on setters so I will keep old code there

> fonts.cpp:576
> -    // KCM expect save state to be false at this point (can be true because of setNearestExistingFonts
> -    setNeedsSave(false);
>  }

I will keep that until we have a proper tested fix for https://phabricator.kde.org/D27452
can prevent bug and ensure apply button is on the good state on all case

REPOSITORY
  R119 Plasma Desktop

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

To: ahmadsamir, #plasma, davidedmundson, broulik, ervin, meven, bport
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, 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/20200309/06b295e2/attachment.html>


More information about the Plasma-devel mailing list