From 2013215c4c50a242742a9661747ba003298fe32a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 18 Jan 2008 02:56:20 +0000 Subject: 2008-01-17 Dan Williams * src/NetworkManagerPolicy.c - (nm_policy_device_change_check): clear change check idle here - (device_change_check_done): remove - (schedule_change_check): simplify git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3242 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- src/NetworkManagerPolicy.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/NetworkManagerPolicy.c') diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index d767a3d4d8..927c54b132 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -224,6 +224,8 @@ nm_policy_device_change_check (gpointer user_data) NMDevice * old_dev = NULL; gboolean do_switch = FALSE; + policy->device_state_changed_idle_id = 0; + switch (nm_manager_get_state (policy->manager)) { case NM_STATE_CONNECTED: old_dev = nm_manager_get_active_device (policy->manager); @@ -403,23 +405,14 @@ global_state_changed (NMManager *manager, NMState state, gpointer user_data) nm_system_restart_mdns_responder (); } -static void -device_change_check_done (gpointer user_data) -{ - NMPolicy *policy = (NMPolicy *) user_data; - policy->device_state_changed_idle_id = 0; -} - static void schedule_change_check (NMPolicy *policy) { if (policy->device_state_changed_idle_id > 0) return; - policy->device_state_changed_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, - nm_policy_device_change_check, - policy, - device_change_check_done); + policy->device_state_changed_idle_id = g_idle_add (nm_policy_device_change_check, + policy); } static NMConnection * -- cgit v1.2.1