Changeset 3577
- Timestamp:
- 04/14/08 16:28:37
- Files:
-
- trunk/libtinymail-maemo/tny-maemo-conic-device.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-maemo/tny-maemo-conic-device.c
r3545 r3577 86 86 info = (EmitStatusInfo *) user_data; 87 87 88 g_debug ("%s: destroying %p (idle)", __FUNCTION__, user_data); 89 88 90 /* We lock the gdk thread because tinymail wants implementations to do 89 91 * this before emitting signals from within a g_idle_add_full callback. 90 92 * See http://www.tinymail.org/trac/tinymail/wiki/HowTnyLockable */ 91 92 93 gdk_threads_enter (); 93 94 g_signal_emit (info->self, tny_device_signals [TNY_DEVICE_CONNECTION_CHANGED], … … 95 96 gdk_threads_leave (); 96 97 98 g_debug ("%s: emitted tny-device-connection-changed signal", __FUNCTION__); 99 97 100 return FALSE; 98 101 } … … 107 110 info = (EmitStatusInfo *) user_data; 108 111 112 g_debug ("%s: destroying status info (%p)", __FUNCTION__, user_data); 113 109 114 if (G_IS_OBJECT(info->self)) 110 115 g_object_unref (info->self); 111 116 112 117 g_slice_free (EmitStatusInfo, info); 118 119 g_debug ("%s: destroyed %p", __FUNCTION__, user_data); 113 120 } 114 121 … … 129 136 if (!dnsmasq_has_resolv()) 130 137 time = 5000; 138 139 g_debug ("%s: emitting status (%s, %s) in %d ms", 140 __FUNCTION__, info, status ? "true" : "false", time); 131 141 132 142 g_timeout_add_full (G_PRIORITY_DEFAULT, time, conic_emit_status_idle, … … 212 222 } HandleConnInfo; 213 223 214 static gboolean /* FIXME: this function will always return FALSE, is that correct? */224 static gboolean 215 225 handle_con_idle (gpointer data) 216 226 { … … 418 428 if (iap_id) { 419 429 if (!con_ic_connection_disconnect_by_id (priv->cnx, iap_id)) { 420 g_warning ("Could not send disconnect_by_id dbus message"); 430 g_warning ("%s: disconnect_by_id failed (%s)", 431 __FUNCTION__, iap_id); 421 432 return FALSE; 422 433 } 423 } else {424 /* don't try to disconnect if iap_id==NULL, or conic will crash... */425 g_warning ("Could not send disconnect dbus message");434 } else 435 if (!con_ic_connection_disconnect (priv->cnx)) 436 g_warning ("Could not send disconnect dbus message"); 426 437 return FALSE; 427 438 } … … 594 605 priv->cnx = con_ic_connection_new (); 595 606 596 if (!priv->cnx) 597 g_warning ("con_ic_connection_new failed. The TnyMaemoConicDevice will be useless."); 607 if (!priv->cnx) { 608 g_warning ("%s: con_ic_connection_new failed.", __FUNCTION__); 609 return; 610 } 598 611 599 612 /* This might be necessary to make the connection object actually emit … … 609 622 * thus, this will setup our state correctly when we receive the signals. */ 610 623 if (!con_ic_connection_connect (priv->cnx, CON_IC_CONNECT_FLAG_AUTOMATICALLY_TRIGGERED)) 611 g_warning ("could not send connect dbus message"); 612 613 return; 624 g_warning ("%s: could not send connect dbus message", 625 __FUNCTION__); 614 626 } 615 627 … … 632 644 633 645 g_return_if_fail (obj && G_IS_OBJECT(obj)); 646 647 g_debug ("%s", __FUNCTION__); 634 648 635 649 priv = TNY_MAEMO_CONIC_DEVICE_GET_PRIVATE (obj); 650 636 651 if (g_signal_handler_is_connected (priv->cnx, priv->signal1)) 637 652 g_signal_handler_disconnect (priv->cnx, priv->signal1); 638 653 639 654 if (priv->cnx && CON_IC_IS_CONNECTION(priv->cnx)) { 640 tny_maemo_conic_device_disconnect (TNY_MAEMO_CONIC_DEVICE(obj),priv->iap); 655 tny_maemo_conic_device_disconnect (TNY_MAEMO_CONIC_DEVICE(obj), 656 priv->iap); 641 657 g_object_unref (priv->cnx); 642 658 priv->cnx = NULL;
