[gnome-software/1453-flathub-repo-misleadingly-considered-present-on-fedora-35-with-filtered-flathub] flatpak: Store filter and description on a remote app
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1453-flathub-repo-misleadingly-considered-present-on-fedora-35-with-filtered-flathub] flatpak: Store filter and description on a remote app
- Date: Tue, 21 Sep 2021 12:09:02 +0000 (UTC)
commit cb809158e81157b53245e4c290ada418d5bcd03d
Author: Milan Crha <mcrha redhat com>
Date: Tue Sep 21 14:02:47 2021 +0200
flatpak: Store filter and description on a remote app
Store the description also on an installed remote, not only on the file
remote. Similarly store also the filters for the remotes.
plugins/flatpak/gs-flatpak-utils.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak-utils.c b/plugins/flatpak/gs-flatpak-utils.c
index 8b107b37c..7aa735b0b 100644
--- a/plugins/flatpak/gs-flatpak-utils.c
+++ b/plugins/flatpak/gs-flatpak-utils.c
@@ -72,6 +72,8 @@ gs_flatpak_app_new_from_remote (GsPlugin *plugin,
{
g_autofree gchar *title = NULL;
g_autofree gchar *url = NULL;
+ g_autofree gchar *filter = NULL;
+ g_autofree gchar *description = NULL;
g_autoptr(GsApp) app = NULL;
app = gs_flatpak_app_new (flatpak_remote_get_name (xremote));
@@ -101,11 +103,19 @@ gs_flatpak_app_new_from_remote (GsPlugin *plugin,
* not the remote title */
gs_app_set_origin_ui (app, _("Applications"));
+ description = flatpak_remote_get_description (xremote);
+ if (description != NULL)
+ gs_app_set_description (app, GS_APP_QUALITY_NORMAL, description);
+
/* url */
url = flatpak_remote_get_url (xremote);
if (url != NULL)
gs_app_set_url (app, AS_URL_KIND_HOMEPAGE, url);
+ filter = flatpak_remote_get_filter (xremote);
+ if (filter != NULL)
+ gs_flatpak_app_set_repo_filter (app, filter);
+
/* success */
return g_steal_pointer (&app);
}
@@ -127,6 +137,7 @@ gs_flatpak_app_new_from_repo_file (GFile *file,
g_autofree gchar *repo_id = NULL;
g_autofree gchar *repo_title = NULL;
g_autofree gchar *repo_url = NULL;
+ g_autofree gchar *repo_filter = NULL;
g_autoptr(GError) error_local = NULL;
g_autoptr(GKeyFile) kf = NULL;
g_autoptr(GsApp) app = NULL;
@@ -229,6 +240,9 @@ gs_flatpak_app_new_from_repo_file (GFile *file,
g_autoptr(GIcon) icon = gs_remote_icon_new (repo_icon);
gs_app_add_icon (app, icon);
}
+ repo_filter = g_key_file_get_string (kf, "Flatpak Repo", "Filter", NULL);
+ if (repo_filter != NULL && *repo_filter != '\0')
+ gs_flatpak_app_set_repo_filter (app, repo_filter);
/* success */
return g_steal_pointer (&app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]