Created attachment 109842 [details]
kdeapps is the default Flatpak source for Krita, even though Flathub is also available
Discover with PackageKit, Snap, and Flatpak backends compiled from source in KDE Neon
1. Install Flathub repo
2. Install kdeapps testing repo
3. Browse to Krita
The kdeapps testing repo is the default repo that shows up there. There are a few problems with this:
1. There is no way to change the ordering *within* a backend, to say "prefer Flathub over kdeapps"
2. The ordering displayed on the settings page has Flathub listed first, though it is apparently not the default flathub source
3. kdeapps is not an appropriate default Flatpak source for anyone other than KDE software developers. Whenever it's added as a Flatpak source and there's also at least one other Flatpak source, if it's feasible, we might want to make sure that the kdeapps repo is *not* automatically made the default one
Created attachment 109843 [details]
Multiple Flatpak sources with flathub listed first, implying (erroneously) that it is the default Flatpak source
Yes, I'm not sure what's the best UI there. It's more like we should be able to sort the sources by preference. i.e. having 1 main source doesn't really solve it because we can have an application that is available on several sources, just not on the main one.
Maybe the default chooser UI should apply to repos and not sources? That could get hairy since most distros are provisioned with multiple repos, though.
That would make it hairier, because then we'd get to: I want it from snap otherwise the PPA and fallback to the distro.
Priorities within sources could make sense.
Suggestion: Have a top-level entry for each package provider, for example
Distribution packages (or ideally the distro's name)
Ubuntu Store (or whatever they call their snap repos)
And then have the different repos/channels of the same provider on a second level. Because for a user, who the package comes from is more important than the format it's in
How about we default internally within Discover to whichever repository was last installed? This way we don't really have to add weird UI anyway to configure it.
Then if you install Flathub and KDEapps, it will default to KDEapps, which probably isn't what you want.
Then you'll change back again?
Another metric could be to default to the repository that has the most applications installed.
This bug isn't about which repository within a backend is the default, but rather how the user can choose which one it is.
Internally, what I think makes the most sense is to keep the first repository that's added as the default until the user deliberately changes it. We don't want the default changing out from under the user; that would be weird and jarring.
Git commit 0f823c0bed40cbbe59cad7edc1caf424483c10c3 by Aleix Pol.
Committed on 04/05/2018 at 15:15.
Pushed by apol into branch 'master'.
Make it possible to choose which is the favorite flatpak source
Includes controls to raise and lower the preference of the different
flatpak backends available.
M +1 -0 discover/DiscoverObject.cpp
M +21 -1 discover/qml/SourcesPage.qml
M +14 -0 libdiscover/backends/DummyBackend/DummySourcesBackend.cpp
M +3 -0 libdiscover/backends/DummyBackend/DummySourcesBackend.h
M +2 -1 libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
M +65 -2 libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp
M +8 -0 libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.h
M +20 -0 libdiscover/resources/AbstractSourcesBackend.cpp
M +11 -0 libdiscover/resources/AbstractSourcesBackend.h