phonemgr r345 - in trunk: . libgsm src



Author: hadess
Date: Thu Mar 26 15:48:26 2009
New Revision: 345
URL: http://svn.gnome.org/viewvc/phonemgr?rev=345&view=rev

Log:
2009-03-26  Bastien Nocera  <hadess hadess net>

	* libgsm/phonemgr-listener.c (phonemgr_listener_connect):
	* src/connection.c (attempt_reconnect), (connect_phone):
	Patch from Daniele Forsi <dforsi gmail com> to really
	fix reconnecting when a connection fails. Otherwise
	devices that go out of range will never be reconnected
	to (Closes: #495278)



Modified:
   trunk/ChangeLog
   trunk/libgsm/phonemgr-listener.c
   trunk/src/connection.c

Modified: trunk/libgsm/phonemgr-listener.c
==============================================================================
--- trunk/libgsm/phonemgr-listener.c	(original)
+++ trunk/libgsm/phonemgr-listener.c	Thu Mar 26 15:48:26 2009
@@ -454,6 +454,7 @@
 		channel = phonemgr_utils_get_serial_channel (device);
 		if (channel < 0) {
 			//FIXME
+			phonemgr_listener_emit_status (l, PHONEMGR_LISTENER_ERROR);
 			return FALSE;
 		}
 	}
@@ -462,6 +463,7 @@
 	l->phone_state = phonemgr_utils_connect (device, NULL, channel, l->debug, error);
 	if (l->phone_state == NULL) {
 		//FIXME
+		phonemgr_listener_emit_status (l, PHONEMGR_LISTENER_ERROR);
 		return FALSE;
 	}
 
@@ -471,6 +473,7 @@
 		//FIXME
 		phonemgr_utils_disconnect (l->phone_state);
 		phonemgr_utils_free (l->phone_state);
+		phonemgr_listener_emit_status (l, PHONEMGR_LISTENER_ERROR);
 		return FALSE;
 	}
 
@@ -484,6 +487,7 @@
 			l->driver = NULL;
 			//FIXME
 			g_message ("Couldn't connect to the device, gnapplet needed but not running");
+			phonemgr_listener_emit_status (l, PHONEMGR_LISTENER_ERROR);
 			return FALSE;
 		}
 	}
@@ -498,6 +502,7 @@
 		l->phone_state = phonemgr_utils_connect (device, l->driver, channel, l->debug, error);
 		if (l->phone_state == NULL) {
 			//FIXME
+			phonemgr_listener_emit_status (l, PHONEMGR_LISTENER_ERROR);
 			return FALSE;
 		}
 	}

Modified: trunk/src/connection.c
==============================================================================
--- trunk/src/connection.c	(original)
+++ trunk/src/connection.c	Thu Mar 26 15:48:26 2009
@@ -85,9 +85,8 @@
 {
 	if (gconf_client_get_bool (app->client,
 				CONFBASE"/auto_retry", NULL) &&
-			! phonemgr_listener_connected (app->listener) &&
-			! app->connecting &&
-			app->status == PHONEMGR_LISTENER_IDLE) {
+			phonemgr_listener_connected (app->listener) == FALSE &&
+			app->connecting == FALSE) {
 		g_message ("Auto-retrying the connection");
 		reconnect_phone (app);
 	}
@@ -152,8 +151,7 @@
 {
 	g_mutex_lock (app->connecting_mutex);
 	if (phonemgr_listener_connected (app->listener) == FALSE
-	    && app->connecting == FALSE
-	    && app->status == PHONEMGR_LISTENER_IDLE) {
+	    && app->connecting == FALSE) {
 		app->connecting = TRUE;
 		g_mutex_unlock (app->connecting_mutex);
 		/* we're neither connected, nor connecting */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]