From 744557f87c84398860c102ba8f8d10790487ae32 Mon Sep 17 00:00:00 2001 From: Brian Cameron Date: Wed, 21 Apr 2010 22:36:11 +0000 Subject: Remove icon monitor since it isn't functional and causes bug #609321. If there is a desire to update the icons when the icon files change it should be implemented in a way that deals with bug #609321. --- diff --git a/gui/simple-greeter/gdm-user-manager.c b/gui/simple-greeter/gdm-user-manager.c index 58def68..01dc507 100644 --- a/gui/simple-greeter/gdm-user-manager.c +++ b/gui/simple-greeter/gdm-user-manager.c @@ -483,13 +483,6 @@ on_user_sessions_changed (GdmUser *user, g_signal_emit (manager, signals [USER_IS_LOGGED_IN_CHANGED], 0, user); } -static void -on_user_icon_changed (GdmUser *user, - GdmUserManager *manager) -{ - g_debug ("GdmUserManager: user icon changed"); -} - static char * get_seat_id_for_session (DBusGConnection *connection, const char *session_id) @@ -736,10 +729,6 @@ create_user (GdmUserManager *manager) "sessions-changed", G_CALLBACK (on_user_sessions_changed), manager); - g_signal_connect (user, - "icon-changed", - G_CALLBACK (on_user_icon_changed), - manager); return user; } diff --git a/gui/simple-greeter/gdm-user-private.h b/gui/simple-greeter/gdm-user-private.h index 1b1b368..79cdcf4 100644 --- a/gui/simple-greeter/gdm-user-private.h +++ b/gui/simple-greeter/gdm-user-private.h @@ -37,8 +37,6 @@ void _gdm_user_add_session (GdmUser *user, void _gdm_user_remove_session (GdmUser *user, const char *session_id); -void _gdm_user_icon_changed (GdmUser *user); - void _gdm_user_show_full_display_name (GdmUser *user); void _gdm_user_show_short_display_name (GdmUser *user); diff --git a/gui/simple-greeter/gdm-user.c b/gui/simple-greeter/gdm-user.c index e2b612f..276a867 100644 --- a/gui/simple-greeter/gdm-user.c +++ b/gui/simple-greeter/gdm-user.c @@ -55,7 +55,6 @@ enum { }; enum { - ICON_CHANGED, SESSIONS_CHANGED, LAST_SIGNAL }; @@ -73,15 +72,12 @@ struct _GdmUser { char *shell; GList *sessions; gulong login_frequency; - - GFileMonitor *icon_monitor; }; typedef struct _GdmUserClass { GObjectClass parent_class; - void (* icon_changed) (GdmUser *user); void (* sessions_changed) (GdmUser *user); } GdmUserClass; @@ -302,14 +298,6 @@ gdm_user_class_init (GdmUserClass *class) 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); - signals [ICON_CHANGED] = - g_signal_new ("icon-changed", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GdmUserClass, icon_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); signals [SESSIONS_CHANGED] = g_signal_new ("sessions-changed", G_TYPE_FROM_CLASS (class), @@ -320,61 +308,6 @@ gdm_user_class_init (GdmUserClass *class) G_TYPE_NONE, 0); } - -static void -on_icon_monitor_changed (GFileMonitor *monitor, - GFile *file, - GFile *other_file, - GFileMonitorEvent event_type, - GdmUser *user) -{ - g_debug ("Icon changed: %d", event_type); - - if (event_type != G_FILE_MONITOR_EVENT_CHANGED && - event_type != G_FILE_MONITOR_EVENT_CREATED) { - return; - } - - _gdm_user_icon_changed (user); -} - -static void -update_icon_monitor (GdmUser *user) -{ - GFile *file; - GError *error; - char *path; - - if (user->home_dir == NULL) { - return; - } - - if (user->icon_monitor != NULL) { - g_file_monitor_cancel (user->icon_monitor); - user->icon_monitor = NULL; - } - - path = g_build_filename (user->home_dir, ".face", NULL); - g_debug ("adding monitor for '%s'", path); - file = g_file_new_for_path (path); - error = NULL; - user->icon_monitor = g_file_monitor_file (file, - G_FILE_MONITOR_NONE, - NULL, - &error); - if (user->icon_monitor != NULL) { - g_signal_connect (user->icon_monitor, - "changed", - G_CALLBACK (on_icon_monitor_changed), - user); - } else { - g_warning ("Unable to monitor %s: %s", path, error->message); - g_error_free (error); - } - g_object_unref (file); - g_free (path); -} - static void gdm_user_init (GdmUser *user) { @@ -392,8 +325,6 @@ gdm_user_finalize (GObject *object) user = GDM_USER (object); - g_file_monitor_cancel (user->icon_monitor); - g_free (user->user_name); g_free (user->real_name); g_free (user->display_name); @@ -499,7 +430,6 @@ _gdm_user_update (GdmUser *user, g_free (user->home_dir); user->home_dir = g_strdup (pwent->pw_dir); g_object_notify (G_OBJECT (user), "home-directory"); - g_signal_emit (user, signals[ICON_CHANGED], 0); } /* Shell */ @@ -513,28 +443,10 @@ _gdm_user_update (GdmUser *user, g_object_notify (G_OBJECT (user), "shell"); } - update_icon_monitor (user); - g_object_thaw_notify (G_OBJECT (user)); } /** - * _gdm_user_icon_changed: - * @user: the user to emit the signal for. - * - * Emits the "icon-changed" signal for @user. - * - * Since: 1.0 - **/ -void -_gdm_user_icon_changed (GdmUser *user) -{ - g_return_if_fail (GDM_IS_USER (user)); - - g_signal_emit (user, signals[ICON_CHANGED], 0); -} - -/** * gdm_user_get_uid: * @user: the user object to examine. * -- cgit v0.8.3.1