[gnome-software] snap: Set origin_hostname



commit 33608caac13710a86704306314d85b7861366fc4
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Nov 29 14:09:33 2019 +1300

    snap: Set origin_hostname

 plugins/snap/gs-plugin-snap.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index f6fc2bc5..2c90843d 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -15,6 +15,7 @@
 struct GsPluginData {
        SnapdAuthData           *auth_data;
        gchar                   *store_name;
+       gchar                   *store_hostname;
        SnapdSystemConfinement   system_confinement;
 
        GMutex                   store_snaps_lock;
@@ -185,9 +186,11 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
        if (system_information == NULL)
                return FALSE;
        priv->store_name = g_strdup (snapd_system_information_get_store (system_information));
-       if (priv->store_name == NULL)
+       if (priv->store_name == NULL) {
                priv->store_name = g_strdup (/* TRANSLATORS: default snap store name */
                                             _("Snap Store"));
+               priv->store_hostname = g_strdup ("snapcraft.io");
+       }
        priv->system_confinement = snapd_system_information_get_confinement (system_information);
 
        /* success */
@@ -335,6 +338,7 @@ gs_plugin_destroy (GsPlugin *plugin)
 {
        GsPluginData *priv = gs_plugin_get_data (plugin);
        g_free (priv->store_name);
+       g_free (priv->store_hostname);
        g_clear_pointer (&priv->store_snaps, g_hash_table_unref);
        g_mutex_clear (&priv->store_snaps_lock);
 }
@@ -937,6 +941,7 @@ gs_plugin_refine_app (GsPlugin *plugin,
        /* add information specific to store snaps */
        if (store_snap != NULL) {
                gs_app_set_origin (app, priv->store_name);
+               gs_app_set_origin_hostname (app, priv->store_hostname);
                gs_app_set_size_download (app, snapd_snap_get_download_size (store_snap));
 
                if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS && gs_app_get_screenshots (app)->len 
== 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]