[KFontChooser] Use one QFontDatabase object for the ::Private class
AbandonedPublic

Authored by ahmadsamir on Mar 21 2020, 7:34 PM.

Details

Reviewers
cfeck
apol
bport
dfaure
Group Reviewers
Frameworks
Summary

Minor optimisation by instantiating one QFontDatabase Object, and using
it in KFontChooser::Private members.

Test Plan

kfontchooserdialogtest app still works

Diff Detail

Repository
R236 KWidgetsAddons
Branch
l-kfontchooser-2 (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24090
Build 24108: arc lint + arc unit
ahmadsamir created this revision.Mar 21 2020, 7:34 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 21 2020, 7:34 PM
ahmadsamir requested review of this revision.Mar 21 2020, 7:34 PM
ahmadsamir updated this revision to Diff 78266.Mar 23 2020, 4:30 AM
ahmadsamir added a reviewer: dfaure.

Rebase

ahmadsamir abandoned this revision.Mar 24 2020, 5:05 PM
ahmadsamir reclaimed this revision.Mar 24 2020, 5:20 PM
ahmadsamir updated this revision to Diff 78383.Mar 24 2020, 5:23 PM
ahmadsamir edited the test plan for this revision. (Show Details)

Verbatim

I don't think this makes any difference, they all share the same underlying private singleton.
So all this does is to use a tiny bit more memory while the widget is up (the member var).
The additional CPU usage without this patch or the additional memory usage with this patch are both negligible, so I can't really say which way is best.

ahmadsamir abandoned this revision.Mar 24 2020, 8:44 PM

I don't think this makes any difference, they all share the same underlying private singleton.
So all this does is to use a tiny bit more memory while the widget is up (the member var).
The additional CPU usage without this patch or the additional memory usage with this patch are both negligible, so I can't really say which way is best.

OK, thanks for the explanation. (It seems Q{Font,Mime}Database are special in that regard).

QMimeDatabase was modeled after QFontDatabase, so it's not surprising that they both work the same way ;)