[gnome-software/135-restart-and-install-update-button-does-not-trigger-reboot-when-using-lxde] gs-application: Use new gs_utils_invoke_reboot_finish()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/135-restart-and-install-update-button-does-not-trigger-reboot-when-using-lxde] gs-application: Use new gs_utils_invoke_reboot_finish()
- Date: Tue, 21 Jun 2022 09:54:49 +0000 (UTC)
commit 1b9fe5b0446a9245f70c1f6c765f485bb1922932
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 21 08:55:14 2022 +0200
gs-application: Use new gs_utils_invoke_reboot_finish()
src/gs-application.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 702668447..6f0e01c1b 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -284,18 +284,16 @@ reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data)
{
GsApplication *app = GS_APPLICATION (user_data);
g_autoptr(GError) error = NULL;
- g_autoptr(GVariant) retval = NULL;
g_autoptr(GsPluginJob) plugin_job = NULL;
/* get result */
- retval = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source), res, &error);
- if (retval != NULL)
+ if (gs_utils_invoke_reboot_finish (source, res, &error))
return;
- if (error != NULL) {
- g_warning ("Calling org.gnome.SessionManager.Reboot failed: %s",
- error->message);
- }
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ g_debug ("Calling reboot had been cancelled");
+ else if (error != NULL)
+ g_warning ("Calling reboot failed: %s", error->message);
/* cancel trigger */
plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_UPDATE_CANCEL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]