[gnome-software/135-restart-and-install-update-button-does-not-trigger-reboot-when-using-lxde: 148/153] 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: 148/153] gs-application: Use new gs_utils_invoke_reboot_finish()
- Date: Thu, 14 Jul 2022 06:43:18 +0000 (UTC)
commit 8f5ed8365e19af8de43b02bf618ecdb9ce733401
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 b9f32cfb3..684bb3e2c 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -289,18 +289,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]