[gnome-software/1308-gnome-software-cannot-install-epiphany-tech-preview-flatpakref] gs-plugin-loader: Retry uri-to-app with file-to-app for file:// URIs
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1308-gnome-software-cannot-install-epiphany-tech-preview-flatpakref] gs-plugin-loader: Retry uri-to-app with file-to-app for file:// URIs
- Date: Thu, 8 Jul 2021 12:44:50 +0000 (UTC)
commit 11f8f7a449ec626b168712ac2aeda337779fa9ef
Author: Milan Crha <mcrha redhat com>
Date: Thu Jul 8 14:41:36 2021 +0200
gs-plugin-loader: Retry uri-to-app with file-to-app for file:// URIs
When the uri-to-app action returns no result, retry with the file-to-app
action for the "file://" URIs, in case any of the plugins implement
only file-to-app actions.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1308
lib/gs-plugin-loader.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index a824746e5..474aad154 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -3309,6 +3309,24 @@ gs_plugin_loader_process_thread_cb (GTask *task,
g_task_return_error (task, error);
return;
}
+
+ if (action == GS_PLUGIN_ACTION_URL_TO_APP) {
+ const gchar *search = gs_plugin_job_get_search (helper->plugin_job);
+ if (search && g_ascii_strncasecmp (search, "file://", 7) == 0 && (
+ gs_plugin_job_get_list (helper->plugin_job) == NULL ||
+ gs_app_list_length (gs_plugin_job_get_list (helper->plugin_job)) == 0)) {
+ g_autoptr(GError) local_error = NULL;
+ g_autoptr(GFile) file = NULL;
+ file = g_file_new_for_uri (search);
+ gs_plugin_job_set_action (helper->plugin_job, GS_PLUGIN_ACTION_FILE_TO_APP);
+ gs_plugin_job_set_file (helper->plugin_job, file);
+ helper->function_name = gs_plugin_action_to_function_name
(GS_PLUGIN_ACTION_FILE_TO_APP);
+ if (!gs_plugin_loader_run_results (helper, cancellable, &local_error))
+ g_debug ("Failed to convert file:// URI to app using file-to-app
action: %s", local_error->message);
+ gs_plugin_job_set_action (helper->plugin_job, GS_PLUGIN_ACTION_URL_TO_APP);
+ gs_plugin_job_set_file (helper->plugin_job, NULL);
+ }
+ }
}
/* run per-app version */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]