Changeset 1509
- Timestamp:
- 01/29/07 12:26:27
- Files:
-
- trunk/libtinymail-maemo/tny-maemo-device.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-maemo/tny-maemo-device.c
r1503 r1509 59 59 priv = TNY_MAEMO_DEVICE_GET_PRIVATE (device); 60 60 61 /* FIXME: do something useful with errors */61 62 62 switch (con_ic_connection_event_get_error(event)) { 63 63 case CON_IC_CONNECTION_ERROR_NONE: 64 64 break; 65 65 case CON_IC_CONNECTION_ERROR_INVALID_IAP: 66 g_warning ("conic: IAP is invalid"); 66 67 break; 67 68 case CON_IC_CONNECTION_ERROR_CONNECTION_FAILED: 69 g_warning ("conic: connection failed"); 68 70 break; 69 71 case CON_IC_CONNECTION_ERROR_USER_CANCELED: 72 g_warning ("conic: user cancelled"); 70 73 break; 71 74 default: … … 80 83 0, TRUE); 81 84 break; 82 83 85 case CON_IC_STATUS_DISCONNECTED: 84 86 priv->is_online = FALSE; … … 87 89 break; 88 90 case CON_IC_STATUS_DISCONNECTING: 89 /* nothing to do */91 priv->is_online = FALSE; 90 92 break; 91 93 default: … … 102 104 103 105 g_return_if_fail (TNY_IS_DEVICE(self)); 104 105 106 priv = TNY_MAEMO_DEVICE_GET_PRIVATE (self); 106 107 107 if (! con_ic_connection_connect (priv->cnx,108 CON_IC_CONNECT_FLAG_NONE))109 g_warning ("could not send connect dbus message");108 if (!priv->is_online) 109 if (!con_ic_connection_connect (priv->cnx,CON_IC_CONNECT_FLAG_NONE)) 110 g_warning ("could not send connect dbus message"); 110 111 } 111 112 … … 117 118 118 119 g_return_if_fail (TNY_IS_DEVICE(self)); 119 120 120 priv = TNY_MAEMO_DEVICE_GET_PRIVATE (self); 121 122 if (!con_ic_connection_disconnect (priv->cnx)) 123 g_warning ("could not send disconnect dbus message"); 121 122 if (priv->is_online) 123 if (!con_ic_connection_disconnect (priv->cnx)) 124 g_warning ("could not send disconnect dbus message"); 124 125 } 125 126 … … 140 141 TnyMaemoDevicePriv *priv = TNY_MAEMO_DEVICE_GET_PRIVATE (self); 141 142 142 priv->is_online = FALSE; /* FIXME: get this from IAP somehow? */143 priv->is_online = FALSE; 143 144 } 144 145 … … 165 166 return NULL; 166 167 } 167 168 168 g_signal_connect (priv->cnx, "connection-event", 169 169 G_CALLBACK(on_connection_event), self); 170 171 /* 172 * this will get us in connected state, but only if there is already a connection. 173 * thus, this will setup our state correctly when we receive the signals 174 */ 175 if (!con_ic_connection_connect (priv->cnx,CON_IC_CONNECT_FLAG_AUTOMATICALLY_TRIGGERED)) 176 g_warning ("could not send auto-connect dbus message"); 170 177 171 178 return TNY_DEVICE (self);
