Allow users to change the format to BCD (decimal) in Binary Clock widget
ClosedPublic

Authored by piotrkakol on Feb 11 2018, 12:02 AM.

Details

Summary

Hours, minutes and seconds are in hexadecimal system. This is sexagesimal format according to Wikipedia. In Plasma4 the format was BCD (Binary-coded decimal) which means that each digit was encoded separately in decimal system.

My fix allows users to choose the format in config. By default the sexagesimal format is used since that was the format after porting the widget to Plasma5.

Here's a screenshot of 2 widgets. On the left there's Binary Clock widget after choosing BCD format in config and on the right there's an old widget displaying time in hexadecimal form. Screenshot was taken when my Digital Clock showed: 00:19.

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
piotrkakol created this revision.Feb 11 2018, 12:02 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 11 2018, 12:02 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
piotrkakol requested review of this revision.Feb 11 2018, 12:02 AM
piotrkakol edited the summary of this revision. (Show Details)Feb 11 2018, 12:05 AM
piotrkakol edited the summary of this revision. (Show Details)Feb 11 2018, 12:10 AM

I don't know if it was intended

It's pretty clear this was a deliberate choice initially, not a bug, otherwise that startBit property wouldn't exist.

not an expected behavior from my perspective.

I think you can make a valid case for either.

It's not exactly an integral piece of plasma, so I don't really care either way, but I think this would really confuse anyone who currently uses it.

piotrkakol updated this revision to Diff 27024.Feb 12 2018, 8:19 PM
piotrkakol retitled this revision from Changed hexadecimal system to decimal for Binary Clock widget to Allow users to change the format to BCD (decimal) in Binary Clock widget.
piotrkakol edited the summary of this revision. (Show Details)

Instead of changing the base to decimal I decided to allow users to choose between base 10 (BCD format) and 16 (sexagesimal format) in the config.

davidedmundson accepted this revision.Feb 19 2018, 10:47 AM

Do you have commit access?

This revision is now accepted and ready to land.Feb 19 2018, 10:47 AM

Thank you for reviewing.

No, I don't have commit access.

I was instructed to give my contact details that will be included in the commit message.
Piotr Kąkol piotrkakol@pm.me

This revision was automatically updated to reflect the committed changes.