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
Details
- Reviewers
apol
Diff Detail
- Repository
- R134 Discover Software Store
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
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 | Why are you dropping the const? |
I can definitely take a look once I have some time.
libdiscover/backends/FlatpakBackend/FlatpakResource.cpp | ||
---|---|---|
124 | 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. |
Alex, do I have to add support for this to PackageKit backend before this review gets approved? Or anything else?
- 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.
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? |