[gnome-packagekit] Do not support ConsoleKit anymore for restart detection
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Do not support ConsoleKit anymore for restart detection
- Date: Mon, 4 Nov 2013 16:12:27 +0000 (UTC)
commit 7b0e651986a78d29aab05bf8a84ff4ca16bf657d
Author: Richard Hughes <richard hughsie com>
Date: Mon Nov 4 15:36:25 2013 +0000
Do not support ConsoleKit anymore for restart detection
Just assume the system can restart if systemd does not exist.
src/Makefile.am | 4 -
src/egg-console-kit.c | 351 -----------------------------------------------
src/egg-console-kit.h | 71 ----------
src/gpk-update-viewer.c | 33 ++---
4 files changed, 12 insertions(+), 447 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2c0e7d4..7769f82 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -90,10 +90,6 @@ if WITH_SYSTEMD
libgpkshared_a_SOURCES += \
systemd-proxy.c \
systemd-proxy.h
-else
-libgpkshared_a_SOURCES += \
- egg-console-kit.c \
- egg-console-kit.h
endif
shared_LIBS = \
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index a2182a1..534b993 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -34,8 +34,6 @@
#include "egg-markdown.h"
#ifdef HAVE_SYSTEMD
#include "systemd-proxy.h"
-#else
-#include "egg-console-kit.h"
#endif
#include "gpk-cell-renderer-info.h"
@@ -62,9 +60,7 @@ static guint size_total = 0;
static guint number_total = 0;
static PkRestartEnum restart_worst = 0;
#ifdef HAVE_SYSTEMD
-static SystemdProxy *proxy = NULL;
-#else
-static EggConsoleKit *console = NULL;
+static SystemdProxy *proxy = NULL;
#endif
static EggMarkdown *markdown = NULL;
static GCancellable *cancellable = NULL;
@@ -249,9 +245,9 @@ gpk_update_viewer_check_restart (void)
if (restart_update == PK_RESTART_ENUM_SYSTEM ||
restart_update == PK_RESTART_ENUM_SECURITY_SYSTEM) {
#ifdef HAVE_SYSTEMD
- systemd_proxy_can_restart (proxy, &show_button, NULL);
+ systemd_proxy_can_restart (proxy, &show_button, NULL);
#else
- egg_console_kit_can_restart (console, &show_button, NULL);
+ show_button = FALSE;
#endif
}
@@ -271,19 +267,16 @@ gpk_update_viewer_check_restart (void)
ret = TRUE;
/* do the action */
- if (restart_update == PK_RESTART_ENUM_SYSTEM)
+ if (restart_update == PK_RESTART_ENUM_SYSTEM) {
#ifdef HAVE_SYSTEMD
- ret = systemd_proxy_restart (proxy, &error);
-#else
- /* use consolekit to restart */
- ret = egg_console_kit_restart (console, &error);
-#endif
+ ret = systemd_proxy_restart (proxy, &error);
if (!ret) {
/* TRANSLATORS: the PackageKit request did not complete, and it did not send an error
*/
gpk_update_viewer_error_dialog (_("Could not restart"), NULL, error->message);
g_error_free (error);
}
- else if (restart_update == PK_RESTART_ENUM_SESSION) {
+#endif
+ } else if (restart_update == PK_RESTART_ENUM_SESSION) {
GpkSession *session;
session = gpk_session_new ();
/* use gnome-session to log out */
@@ -2585,8 +2578,8 @@ gpk_update_viewer_detail_popup_menu_create (GtkWidget *treeview, GdkEventButton
gtk_widget_show_all (menu);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
- (event != NULL) ? event->button : 0,
- gdk_event_get_time((GdkEvent*)event));
+ (event != NULL) ? event->button : 0,
+ gdk_event_get_time((GdkEvent*)event));
}
/**
@@ -3250,9 +3243,7 @@ gpk_update_viewer_application_startup_cb (GtkApplication *_application, gpointer
settings = g_settings_new (GPK_SETTINGS_SCHEMA);
#ifdef HAVE_SYSTEMD
- proxy = systemd_proxy_new ();
-#else
- console = egg_console_kit_new ();
+ proxy = systemd_proxy_new ();
#endif
cancellable = g_cancellable_new ();
markdown = egg_markdown_new ();
@@ -3493,8 +3484,8 @@ main (int argc, char *argv[])
if (cancellable != NULL)
g_object_unref (cancellable);
#ifdef HAVE_SYSTEMD
- if (proxy != NULL)
- systemd_proxy_free (proxy);
+ if (proxy != NULL)
+ systemd_proxy_free (proxy);
#else
if (console != NULL)
g_object_unref (console);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]