Fix device label with unknown size
ClosedPublic

Authored by broulik on Jul 2 2018, 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
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Jul 2 2018, 1:00 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 2 2018, 1:00 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Jul 2 2018, 1:00 PM
bruns added a subscriber: bruns.Jul 2 2018, 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.Jul 3 2018, 2:40 PM
This revision is now accepted and ready to land.Jul 3 2018, 2:40 PM
This revision was automatically updated to reflect the committed changes.