Changeset 2067
- Timestamp:
- 05/31/07 19:13:38
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-maemo/tny-maemo-conic-device.c (modified) (6 diffs)
- trunk/libtinymail/tny-folder.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r2064 r2067 1 2007-05-31 Murray Cumming <murrayc@murrayc.com> 2 3 * libtinymail-maemo/tny-maemo-conic-device.c: 4 (tny_maemo_conic_device_connect): Block until the result is received by 5 the on_connection_event() signal handler. This always seems to indicate 6 failure on Maemo Bora, but maybe it works properly in later versions. 7 It is OK for this to block because the Maemo connection dialog is totally 8 modal anyway, and because most applications will not be able to do anything 9 sensible while waiting, because the user is already waiting for an operation 10 that he has initiated. 11 12 * libtinymail/tny-folder.c: (tny_folder_get_all_count): Warn when this 13 is not implemented. Maybe not very necessary, but I seem to have had this 14 in my local checkout and maybe things crash without the check. Can be removed 15 later if you like. 16 1 17 2007-05-29 Philip Van Hoof <pvanhoof@gnome.org> 2 18 trunk/libtinymail-maemo/tny-maemo-conic-device.c
r2061 r2067 54 54 gboolean forced; /* Whether the is_online value is forced rather than real. */ 55 55 56 /* When TRUE, we are waiting for the success or failure signal. */ 57 gboolean attempting_connection; 58 56 59 #ifdef MAEMO_CONIC_DUMMY 57 60 gint dummy_env_check_timeout; … … 117 120 priv->iap = g_strdup (con_ic_event_get_iap_id ((ConIcEvent*)(event))); 118 121 is_online = TRUE; 122 123 /* Set this to FALSE to stop blocking 124 * tny_maemo_conic_device_connect(): */ 125 if (priv->attempting_connection) 126 priv->attempting_connection = FALSE; 127 119 128 g_message ("new status: CONNECTED (%s)", priv->iap); 120 129 break; … … 122 131 priv->iap = NULL; 123 132 is_online = FALSE; 133 134 /* Set this to FALSE to stop blocking 135 * tny_maemo_conic_device_connect(): */ 136 if (priv->attempting_connection) 137 priv->attempting_connection = FALSE; 138 124 139 g_message ("new status: DISCONNECTED", priv->iap); 125 140 break; … … 134 149 priv->is_online = is_online; 135 150 priv->forced = FALSE; /* is_online is now accurate. */ 136 g_message ("emitting signa CONNECTION_CHANGED: %s", is_online ? "online" : "offline");151 g_message ("emitting signal CONNECTION_CHANGED: %s", is_online ? "online" : "offline"); 137 152 g_signal_emit (device, tny_device_signals [TNY_DEVICE_CONNECTION_CHANGED], 138 153 0, is_online); … … 146 161 * @iap_id: the id of the Internet Access Point (IAP), or NULL for 'any; 147 162 * 148 * try to connect to a specific IAP, or to any if @iap_id == NULL 149 * this calls con_ic_connection_connect(_by_id) 150 * 151 * Returns TRUE if sending the command worked, FALSE otherwise 163 * Try to connect to a specific IAP, or to any if @iap_id == NULL 164 * this calls con_ic_connection_connect(_by_id). 165 * This may show a dialog to allow the user to select a connection, or 166 * may otherwise take a significant amount of time. This function blocks until 167 * the connection has either succeeded or failed. 168 * 169 * Returns TRUE if a connection was made, FALSE otherwise. 152 170 **/ 153 171 gboolean … … 165 183 166 184 if (iap_id) { 185 priv->attempting_connection = TRUE; 186 167 187 if (!con_ic_connection_connect_by_id (priv->cnx, iap_id, CON_IC_CONNECT_FLAG_NONE)) { 168 188 g_warning ("could not send connect_by_id dbus message"); 169 189 return FALSE; 170 190 } 171 } else 191 } else { 192 priv->attempting_connection = TRUE; 193 172 194 if (!con_ic_connection_connect (priv->cnx, CON_IC_CONNECT_FLAG_NONE)) { 173 195 g_warning ("could not send connect dbus message"); 174 196 return FALSE; 175 197 } 176 177 return TRUE; 198 } 199 200 /* Wait for the CON_IC_STATUS_CONNECTED (succeeded) or 201 * CON_IC_STATUS_DISCONNECTED event: */ 202 203 /* When the signal has been handled, 204 * attempting_connection will be reset to FALSE. */ 205 while (priv->attempting_connection) { 206 /* Iterate the main loop so that the signal can be called. */ 207 if (g_main_context_pending (NULL)) { 208 g_main_context_iteration (NULL, FALSE); 209 } 210 } 211 212 return priv->is_online; 178 213 } 179 214 trunk/libtinymail/tny-folder.c
r2030 r2067 813 813 #endif 814 814 815 if (TNY_FOLDER_GET_IFACE (self)->get_all_count_func == NULL) { 816 g_warning ("get_all_count_func() not implemented in %s", G_OBJECT_TYPE_NAME(self)); 817 } 818 815 819 return TNY_FOLDER_GET_IFACE (self)->get_all_count_func (self); 816 820 }
