Make difference between download and installed size
AbandonedPublic

Authored by jgrulich on Mar 7 2017, 1:49 PM.

Details

Reviewers
apol
Summary

Currently in discover we show app size, but we don't make difference between download size and installed
size which can be different (e.g. in flatpak backend). This patch adds download/installed size labels into
the UI instead the original "size" label. The download size label is shown only when the application is not
installed or there is an update available. The installed size label is shown all the time, except if the size
is zero which doesn't make sense. If backend doesn't have download/installed size properties implemented then
the original size label is shown instead so current backends remains unchtouched

Diff Detail

Repository
R134 Discover Software Store
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
jgrulich created this revision.Mar 7 2017, 1:49 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 7 2017, 1:49 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol edited edge metadata.Mar 7 2017, 3:18 PM

All in all, +1.
Would you be interested in implementing it for PackageKit? It's probably more interesting and complex there, as we need to compute the dependencies.

libdiscover/backends/FlatpakBackend/FlatpakResource.cpp
124 ↗(On Diff #12266)

Why are you dropping the const?

jgrulich marked an inline comment as done.Mar 7 2017, 3:26 PM
In D4967#93376, @apol wrote:

All in all, +1.
Would you be interested in implementing it for PackageKit? It's probably more interesting and complex there, as we need to compute the dependencies.

I can definitely take a look once I have some time.

libdiscover/backends/FlatpakBackend/FlatpakResource.cpp
124 ↗(On Diff #12266)

Because I made downloadSize() and installedSize() non const in AbstractResource, same as size() in case you need to compute the size andf if you want to override it you have to follow the exact signature.

jgrulich marked an inline comment as done.Mar 8 2017, 8:47 AM

Alex, do I have to add support for this to PackageKit backend before this review gets approved? Or anything else?

jgrulich updated this revision to Diff 12281.Mar 8 2017, 9:18 AM
  • Make downloadSize() and installedSize() to return size() if they are not implemented
  • Make downloadSize() and installedSize() to return size() if they are not implemented

This fixes compilation for backends which don't have these properties implemented. I had previously enabled only flatpak backend and didn't hit this issue before.

apol added inline comments.Mar 8 2017, 9:55 AM
libdiscover/resources/AbstractResource.cpp
60

Won't this make the hiding of the Label fail? Will it be false when it's not implemented? Or we'll have the same value trice?

jgrulich abandoned this revision.Mar 8 2017, 12:28 PM