Bug 388921 - Can't choose which Flatpak repo is default when more than one are active
Summary: Can't choose which Flatpak repo is default when more than one are active
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Flatpak Backend (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-13 17:54 UTC by Nate Graham
Modified: 2018-05-04 15:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kdeapps is the default Flatpak source for Krita, even though Flathub is also available (350.02 KB, image/png)
2018-01-13 17:54 UTC, Nate Graham
Details
Multiple Flatpak sources with flathub listed first, implying (erroneously) that it is the default Flatpak source (143.63 KB, image/png)
2018-01-13 17:54 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2018-01-13 17:54:06 UTC
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
Comment 1 Nate Graham 2018-01-13 17:54:47 UTC
Created attachment 109843 [details]
Multiple Flatpak sources with flathub listed first, implying (erroneously) that it is the default Flatpak source
Comment 2 Aleix Pol 2018-01-19 21:19:27 UTC
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.
Comment 3 Nate Graham 2018-01-19 21:29:11 UTC
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.
Comment 4 Aleix Pol 2018-01-20 01:34:54 UTC
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.
Comment 5 Thomas Pfeiffer 2018-02-01 15:32:02 UTC
Suggestion: Have a top-level entry for each package provider, for example

Distribution packages (or ideally the distro's name) 
KDE Flatpak
Flathub
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
Comment 6 Aleix Pol 2018-02-22 18:50:28 UTC
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.
Comment 7 Nate Graham 2018-02-22 18:51:32 UTC
Then if you install Flathub and KDEapps, it will default to KDEapps, which probably isn't what you want.
Comment 8 Aleix Pol 2018-02-23 00:56:24 UTC
Then you'll change back again?

Another metric could be to default to the repository that has the most applications installed.
Comment 9 Nate Graham 2018-02-23 01:24:05 UTC
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.
Comment 10 Aleix Pol 2018-05-04 15:20:53 UTC
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

https://commits.kde.org/discover/0f823c0bed40cbbe59cad7edc1caf424483c10c3