D26895: Introduce an Info Center mode
Ovidiu Chi
noreply at phabricator.kde.org
Mon Feb 3 14:10:45 GMT 2020
ovichiro added a comment.
Not sure it's my place to do so, but I'd like to make a small comment.
Instead of passing `mode` around and all the `if` statements, wouldn't it be better to have a single decision point in `main.cpp`, like a factory class?
Use polymorphism and create something like `InfoCenter : CommonParent`, `SystemSettings : CommonParent`, each knowing how to initialize their `KAboutData`, GUI elements, icons etc.?
And in `main.cpp` do something like `CommonParent * commonParent = new InfoCenter() // or new SystemSettings()` and use that instead of `mode`.
Further down the road, if you need to add something to system settings, you could do it in the SystemSettings class maybe and not have to add another `if` to remove it from the InfoCenter part. Just a thought, not sure if it fits.
REPOSITORY
R124 System Settings
REVISION DETAIL
https://phabricator.kde.org/D26895
To: mart, #plasma, davidedmundson
Cc: ovichiro, meven, davidedmundson, broulik, 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/20200203/ff240edd/attachment.html>
More information about the Plasma-devel
mailing list