Commit bff86ab1 authored by Richard Hughes's avatar Richard Hughes

fwupd: Remove the hidden fwupd easter egg

Now fwupd is in flathub it's confusing to see *devices* and apps.
parent 8eed55df
Pipeline #56858 passed with stage
in 15 minutes and 47 seconds
......@@ -1047,73 +1047,3 @@ gs_plugin_add_sources (GsPlugin *plugin,
}
return TRUE;
}
static gboolean
gs_plugin_fwupd_add_releases (GsPlugin *plugin, GsApp *app,
GCancellable *cancellable, GError **error)
{
GsPluginData *priv = gs_plugin_get_data (plugin);
g_autoptr(GError) error_local = NULL;
g_autoptr(GPtrArray) releases = NULL;
releases = fwupd_client_get_releases (priv->client,
gs_fwupd_app_get_device_id (app),
cancellable,
&error_local);
if (releases == NULL) {
/* just ignore empty array */
if (g_error_matches (error_local,
FWUPD_ERROR,
FWUPD_ERROR_NOTHING_TO_DO)) {
return TRUE;
}
g_propagate_error (error, g_steal_pointer (&error_local));
return FALSE;
}
for (guint j = 0; j < releases->len; j++) {
FwupdRelease *rel = g_ptr_array_index (releases, j);
g_autoptr(GsApp) app2 = gs_app_new (NULL);
gs_fwupd_app_set_from_release (app2, rel);
gs_app_add_history (app, app2);
}
return TRUE;
}
static gboolean
gs_plugin_fwupd_add_devices (GsPlugin *plugin, GsAppList *list,
GCancellable *cancellable, GError **error)
{
GsPluginData *priv = gs_plugin_get_data (plugin);
g_autoptr(GPtrArray) devices = NULL;
/* get devices */
devices = fwupd_client_get_devices (priv->client, cancellable, error);
if (devices == NULL)
return FALSE;
for (guint i = 0; i < devices->len; i++) {
FwupdDevice *device = g_ptr_array_index (devices, i);
g_autoptr(GsApp) app = NULL;
/* ignore these, we can't do anything */
if (!fwupd_device_has_flag (device, FWUPD_DEVICE_FLAG_UPDATABLE))
continue;
/* add releases */
app = gs_plugin_fwupd_new_app_from_device_raw (plugin, device);
if (!gs_plugin_fwupd_add_releases (plugin, app, cancellable, error))
return FALSE;
/* add all */
gs_app_list_add (list, g_steal_pointer (&app));
}
return TRUE;
}
gboolean
gs_plugin_add_search (GsPlugin *plugin, gchar **values, GsAppList *list,
GCancellable *cancellable, GError **error)
{
if (g_strv_contains ((const gchar * const *) values, "fwupd"))
return gs_plugin_fwupd_add_devices (plugin, list, cancellable, error);
return TRUE;
}
Markdown is supported
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