Fix device label with unknown size
ClosedPublic

Authored by broulik on Mon, Jul 2, 1:00 PM.

Details

Summary

size_str can never actually become empty as formatByteSize returns "0 B" and never an empty string.

Test Plan

Made it pretend my hard drive had 0 byte size, used to show "0 B Hard Drive", now it just shows "Hard Drive" as intended

Diff Detail

Repository
R245 Solid
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mon, Jul 2, 1:00 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMon, Jul 2, 1:00 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Mon, Jul 2, 1:00 PM
bruns added a subscriber: bruns.Mon, Jul 2, 1:47 PM

So the question is, on which occasion does solid return a size of 0?

I have seen it do that for e.g. a Floppy that is not "present" (I fixed that independently from this patch to show "Floppy" again). I guess whenever an external media isn't present, like an SD card in a reader or so.

davidedmundson accepted this revision.Tue, Jul 3, 2:40 PM
This revision is now accepted and ready to land.Tue, Jul 3, 2:40 PM
This revision was automatically updated to reflect the committed changes.