Commit 1ee7ec0f authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Only allow backends with proper source awareness to filter

PackageKit gives us different ids for the source, so we can't reliably
filter.

BUG: 388917
parent d725d754
......@@ -168,6 +168,7 @@ DiscoverPage {
Layout.fillWidth: true
enabled: display.length>0
highlighted: ListView.isCurrentItem
supportsMouseEvents: sourcesBackend.canFilterSources
onClicked: Navigation.openApplicationListSource(sourceId)
Keys.onReturnPressed: clicked()
......
......@@ -43,6 +43,7 @@ public:
QString idDescription() override;
QList<QAction*> actions() const override;
bool supportsAdding() const override { return true; }
bool canFilterSources() const override { return true; }
FlatpakRemote * installSource(FlatpakResource *resource);
bool canMoveSources() const override { return true; }
......
......@@ -37,6 +37,7 @@ class DISCOVERCOMMON_EXPORT AbstractSourcesBackend : public QObject
Q_PROPERTY(QList<QAction*> actions READ actions CONSTANT)
Q_PROPERTY(bool supportsAdding READ supportsAdding CONSTANT)
Q_PROPERTY(bool canMoveSources READ canMoveSources CONSTANT)
Q_PROPERTY(bool canFilterSources READ canFilterSources CONSTANT)
Q_PROPERTY(QString firstSourceId READ firstSourceId NOTIFY firstSourceIdChanged)
Q_PROPERTY(QString lastSourceId READ lastSourceId NOTIFY lastSourceIdChanged)
public:
......@@ -61,6 +62,7 @@ class DISCOVERCOMMON_EXPORT AbstractSourcesBackend : public QObject
AbstractResourcesBackend* resourcesBackend() const;
virtual bool canFilterSources() const { return false; }
virtual bool canMoveSources() const { return false; }
Q_SCRIPTABLE virtual bool moveSource(const QString &sourceId, int delta);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment