[gnome-software/135-restart-and-install-update-button-does-not-trigger-reboot-when-using-lxde] gs-updates-page: Use gs_utils_invoke_reboot_async() to request reboot
- 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-updates-page: Use gs_utils_invoke_reboot_async() to request reboot
- Date: Tue, 21 Jun 2022 09:54:49 +0000 (UTC)
commit d43f9fea6e7edb00921cfc8513c05b980c5ee555
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 21 08:56:18 2022 +0200
gs-updates-page: Use gs_utils_invoke_reboot_async() to request reboot
src/gs-updates-page.c | 24 ++++++------------------
1 file changed, 6 insertions(+), 18 deletions(-)
---
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 22ecbf7b2..4456ddd86 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -961,17 +961,15 @@ upgrade_reboot_failed_cb (GObject *source,
GsApp *app;
g_autoptr(GError) error = NULL;
g_autoptr(GsPluginJob) plugin_job = NULL;
- g_autoptr(GVariant) retval = 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);
app = gs_upgrade_banner_get_app (GS_UPGRADE_BANNER (self->upgrade_banner));
if (app == NULL) {
@@ -995,7 +993,6 @@ upgrade_trigger_finished_cb (GObject *source,
gpointer user_data)
{
GsUpdatesPage *self = (GsUpdatesPage *) user_data;
- g_autoptr(GDBusConnection) bus = NULL;
g_autoptr(GError) error = NULL;
/* get the results */
@@ -1005,16 +1002,7 @@ upgrade_trigger_finished_cb (GObject *source,
}
/* trigger reboot */
- bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
- g_dbus_connection_call (bus,
- "org.gnome.SessionManager",
- "/org/gnome/SessionManager",
- "org.gnome.SessionManager",
- "Reboot",
- NULL, NULL, G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT, NULL,
- upgrade_reboot_failed_cb,
- self);
+ gs_utils_invoke_reboot_async (NULL, upgrade_reboot_failed_cb, self);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]