[gnome-control-center] user-accounts: Require logind for session tracking
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Require logind for session tracking
- Date: Mon, 22 Oct 2012 08:53:27 +0000 (UTC)
commit f6cc4a970a98f82a2eb1c70515648869bc8bdb90
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 22 10:52:19 2012 +0200
user-accounts: Require logind for session tracking
As is already used in gnome-settings-daemon.
configure.ac | 18 +----------------
panels/user-accounts/um-user.c | 42 +---------------------------------------
2 files changed, 2 insertions(+), 58 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fb18da9..c1f29e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,17 +63,6 @@ CPPFLAGS=$savecppflags
AC_CHECK_LIB(m, floor)
-AC_ARG_ENABLE([systemd],
- AS_HELP_STRING([--enable-systemd], [Use systemd]),
- [with_systemd=$enableval],
- [with_systemd=no])
-if test "$with_systemd" = "yes" ; then
- SYSTEMD=libsystemd-login
- AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd is available])
-else
- SYSTEMD=
-fi
-
# IBus support
IBUS_REQUIRED_VERSION=1.4.99
@@ -158,7 +147,7 @@ PKG_CHECK_MODULES(USER_ACCOUNTS_PANEL, $COMMON_MODULES
gnome-desktop-3.0
gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION
pwquality
- $SYSTEMD)
+ libsystemd-login)
GDESKTOP_PREFIX=`$PKG_CONFIG --variable prefix gsettings-desktop-schemas`
AC_SUBST(GDESKTOP_PREFIX)
@@ -524,11 +513,6 @@ if test "x$with_libsocialweb" = "xyes"; then
else
AC_MSG_NOTICE([ Background panel Flickr support disabled])
fi
-if test "x$with_systemd" = "xyes"; then
- AC_MSG_NOTICE([** systemd (Systemd session tracking)])
-else
- AC_MSG_NOTICE([ Using ConsoleKit for session tracking])
-fi
if test "x$have_wacom" = "xyes"; then
AC_MSG_NOTICE([** wacom (Wacom tablet panel)])
else
diff --git a/panels/user-accounts/um-user.c b/panels/user-accounts/um-user.c
index e80ebc6..c84b71b 100644
--- a/panels/user-accounts/um-user.c
+++ b/panels/user-accounts/um-user.c
@@ -36,6 +36,7 @@
#include <gtk/gtk.h>
#include <gio/gunixoutputstream.h>
+#include <systemd/sd-login.h>
#include "um-user.h"
#include "um-account-type.h"
@@ -942,10 +943,6 @@ um_user_set_password (UmUser *user,
}
}
-#ifdef HAVE_SYSTEMD
-
-#include <systemd/sd-login.h>
-
gboolean
um_user_is_logged_in (UmUser *user)
{
@@ -956,43 +953,6 @@ um_user_is_logged_in (UmUser *user)
return n_sessions > 0;
}
-#else
-
-gboolean
-um_user_is_logged_in (UmUser *user)
-{
- GVariant *result;
- GVariantIter *iter;
- gint n_sessions;
- GError *error = NULL;
-
- result = g_dbus_connection_call_sync (user->bus,
- "org.freedesktop.ConsoleKit",
- "/org/freedesktop/ConsoleKit/Manager",
- "org.freedesktop.ConsoleKit.Manager",
- "GetSessionsForUnixUser",
- g_variant_new ("(u)", um_user_get_uid (user)),
- G_VARIANT_TYPE ("(ao)"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- &error);
- if (!result) {
- g_warning ("GetSessionsForUnixUser failed: %s", error->message);
- g_error_free (error);
- return FALSE;
- }
-
- g_variant_get (result, "(ao)", &iter);
- n_sessions = g_variant_iter_n_children (iter);
- g_variant_iter_free (iter);
- g_variant_unref (result);
-
- return n_sessions > 0;
-}
-
-#endif
-
void
um_user_set_automatic_login (UmUser *user,
gboolean enabled)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]