[gnome-software/wip/kalev/dont-show-lvfs-stable-repo] fwupd: Don't show the stable lvfs repo in the repos dialog



commit 20d8f3d3313b08e77c39af37f05e0d95320e685b
Author: Kalev Lember <klember redhat com>
Date:   Tue Feb 20 16:06:32 2018 +0100

    fwupd: Don't show the stable lvfs repo in the repos dialog
    
    The repos dialog in it's current design is supposed to ony show
    supplemental sources and not allow changing core repositories.

 plugins/fwupd/gs-plugin-fwupd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c
index 3f205c4a..da3944bc 100644
--- a/plugins/fwupd/gs-plugin-fwupd.c
+++ b/plugins/fwupd/gs-plugin-fwupd.c
@@ -1047,6 +1047,15 @@ gs_plugin_file_to_app (GsPlugin *plugin,
        return TRUE;
 }
 
+static gboolean
+is_core_repo (const gchar *id)
+{
+       if (g_strcmp0 (id, "lvfs") == 0)
+               return TRUE;
+
+       return FALSE;
+}
+
 gboolean
 gs_plugin_add_sources (GsPlugin *plugin,
                       GsAppList *list,
@@ -1069,6 +1078,10 @@ gs_plugin_add_sources (GsPlugin *plugin,
                if (fwupd_remote_get_kind (remote) == FWUPD_REMOTE_KIND_LOCAL)
                        continue;
 
+               /* ignore core repos that users shouldn't disable */
+               if (is_core_repo (fwupd_remote_get_id (remote)))
+                       continue;
+
                /* create something that we can use to enable/disable */
                id = g_strdup_printf ("org.fwupd.%s.remote", fwupd_remote_get_id (remote));
                app = gs_app_new (id);


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