Changeset 1383
- Timestamp:
- 01/10/07 02:03:12
- Files:
-
- trunk/libtinymail-camel/tny-camel-account-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-account.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-pop-folder.c (modified) (5 diffs)
- trunk/libtinymail-camel/tny-camel-pop-store-account-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-pop-store-account.c (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-pop-store-account.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-store-account.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-session-camel.c (modified) (7 diffs)
- trunk/libtinymail-camel/tny-session-camel.h (modified) (1 diff)
- trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c (modified) (2 diffs)
- trunk/libtinymail-gpe/tny-gpe-account-store.c (modified) (2 diffs)
- trunk/libtinymail-maemo/tny-maemo-account-store.c (modified) (2 diffs)
- trunk/libtinymail-olpc/tny-olpc-account-store.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/tny-camel-account-priv.h
r826 r1383 40 40 gboolean connected, inuse_spin; 41 41 gchar *name; GList *options; 42 gchar *cache_location; 42 43 TnyAccountType account_type; 43 44 }; trunk/libtinymail-camel/tny-camel-account.c
r1368 r1383 573 573 TnyCamelAccount *self = (TnyCamelAccount *)instance; 574 574 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 575 576 priv->cache_location = NULL; 577 priv->service = NULL; 578 priv->session = NULL; 579 priv->url_string = NULL; 575 580 576 581 priv->ex = camel_exception_new (); … … 690 695 g_static_rec_mutex_lock (priv->service_lock); 691 696 697 if (G_LIKELY (priv->cache_location)) 698 g_free (priv->cache_location); 699 692 700 if (G_LIKELY (priv->id)) 693 701 g_free (priv->id); trunk/libtinymail-camel/tny-camel-folder.c
r1369 r1383 1495 1495 } 1496 1496 1497 1497 1498 static void 1498 1499 tny_camel_folder_transfer_msgs_default (TnyFolder *self, TnyList *headers, TnyFolder *folder_dst, gboolean delete_originals, GError **err) … … 1540 1541 } 1541 1542 1543 g_object_unref (G_OBJECT (iter)); 1544 1542 1545 ex = camel_exception_new (); 1543 1546 camel_exception_init (ex); … … 1563 1566 camel_exception_free (ex); 1564 1567 1565 if (transferred_uids) 1568 /* Why don't these delete the arrays with TRUE? */ 1569 if (transferred_uids) 1566 1570 g_ptr_array_free (transferred_uids, FALSE); 1567 1571 … … 1574 1578 } 1575 1579 1576 1577 1580 void 1578 1581 _tny_camel_folder_set_id (TnyCamelFolder *self, const gchar *id) 1579 1582 { 1580 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 1581 1582 g_mutex_lock (priv->folder_lock); 1583 1584 /* unload_folder_no_lock (priv, TRUE); */ 1585 1586 if (G_UNLIKELY (priv->folder_name)) 1587 g_free (priv->folder_name); 1588 1589 priv->folder_name = g_strdup (id); 1590 1591 g_mutex_unlock (priv->folder_lock); 1592 1593 return; 1594 } 1595 1583 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 1584 1585 g_mutex_lock (priv->folder_lock); 1586 1587 /* unload_folder_no_lock (priv, TRUE); */ 1588 1589 if (G_UNLIKELY (priv->folder_name)) 1590 g_free (priv->folder_name); 1591 1592 priv->folder_name = g_strdup (id); 1593 1594 g_mutex_unlock (priv->folder_lock); 1595 1596 return; 1597 } 1596 1598 1597 1599 void trunk/libtinymail-camel/tny-camel-pop-folder.c
r1368 r1383 52 52 53 53 static void 54 tny_camel_pop_folder_refresh (TnyFolder *self, GError **err)54 tny_camel_pop_folder_refresh_impl (TnyFolder *self, GError **err, CamelOperationStatusFunc status_func) 55 55 { 56 56 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 57 57 TnyCamelPopStoreAccountPriv *poppriv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (priv->account); 58 59 /* 60 * TODO: Reimplement this one for POP (you have poppriv->inbox) 61 * 62 * camel_folder_refresh_info (priv->folder, &ex); 63 * 64 * You don't need to do any status reporting in this one 65 */ 66 67 g_warning ("tny_camel_pop_folder_refresh unimplemented"); 58 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (priv->account); 59 CamelException ex = CAMEL_EXCEPTION_INITIALISER; 60 CamelURL *url = NULL; 61 GList *options = apriv->options; 62 TnyCamelFolderPriv *priv_dst; 63 TnyIterator *iter; 64 GPtrArray *uids, *transferred_uids = NULL; 65 guint list_length; 66 CamelFolder *pop_folder, *cfol_dst; 67 CamelStore *pop_store; 68 const gchar *myerr = NULL; 69 TnyFolder *to_folder = NULL; 70 71 to_folder = self; 72 73 url = camel_url_new ("pop://", &ex); 74 75 if (camel_exception_is_set (&ex)) 76 goto errorhandler; 77 78 camel_url_set_protocol (url, "pop"); 79 camel_url_set_user (url, apriv->user); 80 camel_url_set_host (url, apriv->host); 81 82 while (options) 83 { 84 gchar *ptr, *dup = g_strdup (options->data); 85 gchar *option, *value; 86 ptr = strchr (dup, '='); 87 if (ptr) { 88 ptr++; 89 value = g_strdup (ptr); ptr--; 90 *ptr = '\0'; option = dup; 91 } else { 92 option = dup; 93 value = g_strdup ("1"); 94 } 95 camel_url_set_param (url, option, value); 96 g_free (value); 97 g_free (dup); 98 options = g_list_next (options); 99 } 100 101 if (G_LIKELY (apriv->url_string)) 102 g_free (apriv->url_string); 103 104 apriv->url_string = camel_url_to_string (url, 0); 105 camel_url_free (url); url = NULL; 106 107 g_static_rec_mutex_lock (apriv->service_lock); 108 apriv->service = camel_session_get_service 109 ((CamelSession*) apriv->session, apriv->url_string, 110 apriv->type, &ex); 111 g_static_rec_mutex_unlock (apriv->service_lock); 112 113 /* TODO: Clean these up when done */ 114 tny_session_camel_set_pass_func (apriv->session, priv->account, apriv->get_pass_func); 115 tny_session_camel_set_forget_pass_func (apriv->session, priv->account, apriv->forget_pass_func); 116 117 if (apriv->service == NULL || camel_exception_is_set (&ex)) 118 goto errorhandler; 119 120 if (!camel_service_connect (apriv->service, &ex)) 121 goto errorhandler; 122 123 if (camel_exception_is_set (&ex)) 124 goto errorhandler; 125 126 pop_store = CAMEL_STORE (apriv->service); 127 128 pop_folder = camel_store_get_folder (pop_store, "INBOX", 0, &ex); 129 if (pop_folder == NULL || camel_exception_is_set (&ex)) 130 goto errorhandler; 131 132 camel_folder_refresh_info (pop_folder, &ex); 133 if (camel_exception_is_set (&ex)) 134 goto errorhandler; 135 136 priv_dst = TNY_CAMEL_FOLDER_GET_PRIVATE (to_folder); 137 138 cfol_dst = _tny_camel_folder_get_camel_folder (TNY_CAMEL_FOLDER (to_folder)); 139 140 uids = camel_folder_get_uids (pop_folder); 141 142 camel_folder_transfer_messages_to (pop_folder, uids, cfol_dst, 143 &transferred_uids, poppriv->delete_originals, &ex); 144 145 if (camel_exception_is_set (&ex)) { 146 g_mutex_unlock (priv_dst->folder_lock); 147 goto errorhandler; 148 } 149 150 if (poppriv->delete_originals) 151 camel_folder_sync (pop_folder, TRUE, &ex); 152 153 if (camel_exception_is_set (&ex)) { 154 g_mutex_unlock (priv_dst->folder_lock); 155 goto errorhandler; 156 } 157 158 /* Why don't these delete the arrays with TRUE? */ 159 160 if (transferred_uids) 161 g_ptr_array_free (transferred_uids, FALSE); 162 g_ptr_array_free (uids, FALSE); 163 164 return; 165 166 errorhandler: 167 168 if (camel_exception_is_set (&ex)) 169 { 170 if (!myerr) myerr = camel_exception_get_description (&ex); 171 camel_exception_clear (&ex); 172 } else 173 if (!myerr) myerr = "Unknown error"; 174 175 g_set_error (err, TNY_FOLDER_ERROR, 176 TNY_FOLDER_ERROR_REFRESH, myerr); 177 178 if (apriv->service) /* Must this one be unreffed? */ 179 apriv->service = NULL; 180 181 if (pop_folder) 182 camel_object_unref (CAMEL_OBJECT (pop_folder)); 183 184 if (url) 185 camel_url_free (url); 186 187 return; 188 } 189 190 static void 191 tny_camel_pop_folder_refresh (TnyFolder *self, GError **err) 192 { 193 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 194 TnyCamelPopStoreAccountPriv *poppriv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (priv->account); 195 196 g_mutex_lock (priv->folder_lock); 197 198 tny_camel_pop_folder_refresh_impl (self, err, NULL); 199 200 g_mutex_unlock (priv->folder_lock); 201 68 202 } 69 203 … … 80 214 81 215 82 83 216 static void 84 217 tny_camel_pop_folder_refresh_async_destroyer (gpointer thr_user_data) … … 198 331 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 199 332 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (priv->account); 200 201 TnyCamelPopStoreAccountPriv *poppriv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (priv->account); 202 203 gchar *str; 204 CamelException ex = CAMEL_EXCEPTION_INITIALISER; 333 gchar *str; CamelException ex = CAMEL_EXCEPTION_INITIALISER; 205 334 GError *err = NULL; 206 335 … … 221 350 g_free (str); 222 351 223 224 /* 225 * TODO: Reimplement this one for POP (you have poppriv->inbox) 226 * 227 * camel_folder_refresh_info (priv->folder, &ex); 228 * 229 * Oh and, please tell something to tny_camel_folder_refresh_async_status 230 * from time to times. 231 */ 232 233 g_warning ("tny_camel_pop_folder_refresh_async unimplemented"); 234 352 tny_camel_pop_folder_refresh_impl (self, &err, 353 tny_camel_pop_folder_refresh_async_status); 235 354 236 355 info->err = NULL; … … 277 396 tny_camel_pop_folder_refresh_async (TnyFolder *self, TnyRefreshFolderCallback callback, TnyRefreshFolderStatusCallback status_callback, gpointer user_data) 278 397 { 279 RefreshPopFolderInfo *info = g_slice_new (RefreshPopFolderInfo); 280 GThread *thread; 281 282 info->err = NULL; 283 info->self = self; 284 info->callback = callback; 285 info->status_callback = status_callback; 286 info->user_data = user_data; 287 info->depth = g_main_depth (); 288 289 /* thread reference */ 290 g_object_ref (G_OBJECT (self)); 291 292 thread = g_thread_create (tny_camel_pop_folder_refresh_async_thread, 293 info, FALSE, NULL); 398 if (TRUE) 399 { 400 /* Temporary solution until multithreaded authentication works */ 401 402 GError *err = NULL; 403 404 tny_camel_pop_folder_refresh_impl (self, &err, NULL); 405 406 if (callback) 407 callback (self, FALSE, &err, user_data); 408 409 if (err != NULL) 410 g_error_free (err); 411 412 } else 413 { 414 415 RefreshPopFolderInfo *info = g_slice_new (RefreshPopFolderInfo); 416 GThread *thread; 417 418 info->err = NULL; 419 info->self = self; 420 info->callback = callback; 421 info->status_callback = status_callback; 422 info->user_data = user_data; 423 info->depth = g_main_depth (); 424 425 /* thread reference */ 426 g_object_ref (G_OBJECT (self)); 427 428 thread = g_thread_create (tny_camel_pop_folder_refresh_async_thread, 429 info, FALSE, NULL); 430 431 } 294 432 295 433 return; trunk/libtinymail-camel/tny-camel-pop-store-account-priv.h
r1368 r1383 27 27 TnyFolder *inbox; 28 28 GMutex *lock; 29 gboolean delete_originals; 29 30 }; 30 31 trunk/libtinymail-camel/tny-camel-pop-store-account.c
r1370 r1383 103 103 fpriv->store = mdstore; 104 104 105 g_free (full_path);106 107 105 return TNY_FOLDER (folder); 108 106 … … 128 126 129 127 static void 130 report_error (TnyCamelAccountPriv *priv)131 {132 if (G_UNLIKELY (priv->service == NULL))133 {134 g_error (_("Couldn't get service %s: %s\n"), priv->url_string,135 camel_exception_get_description (priv->ex));136 camel_exception_clear (priv->ex);137 return;138 }139 }140 141 static void142 128 tny_camel_pop_store_account_reconnect (TnyCamelAccount *self) 143 129 { 144 130 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 145 131 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (self); 146 CamelSession *session = (CamelSession*) apriv->session;147 132 148 133 g_mutex_lock (priv->lock); 149 134 150 if (G_LIKELY (apriv->session) && G_UNLIKELY (apriv->user) 151 && G_UNLIKELY (apriv->host)) 152 { 153 if (!apriv->url_string) 135 if (G_UNLIKELY (apriv->user) && G_UNLIKELY (apriv->host)) 136 { 137 if (!priv->inbox) 154 138 { 155 gchar *name = NULL; 156 157 if (G_LIKELY (apriv->url_string)) 158 g_free (apriv->url_string); 159 160 name = g_strdup_printf ("%s@%s", apriv->user, apriv->host); 161 apriv->url_string = g_strdup_printf ("maildir://%s/mail/pop/%s/maildir", 162 session->storage_path, name); 163 if (priv->inbox != NULL) 164 g_object_unref (G_OBJECT (priv->inbox)); 165 priv->inbox = create_maildir (self, apriv, name, apriv->url_string); 166 g_free (name); 167 168 /* camel_session_get_service can launch GUI things */ 169 170 g_static_rec_mutex_lock (apriv->service_lock); 171 apriv->service = camel_session_get_service (session, 172 apriv->url_string, apriv->type, apriv->ex); 173 if (apriv->service == NULL) 174 report_error (apriv); 175 g_static_rec_mutex_unlock (apriv->service_lock); 176 177 /* TODO: Handle priv->ex using GError */ 178 179 } else if (G_LIKELY (apriv->session) && (apriv->url_string)) 180 { 181 /* camel_session_get_service can launch GUI things */ 182 183 g_static_rec_mutex_lock (apriv->service_lock); 184 apriv->service = camel_session_get_service (session, 185 apriv->url_string, apriv->type, apriv->ex); 186 if (apriv->service == NULL) 187 report_error (apriv); 188 g_static_rec_mutex_unlock (apriv->service_lock); 189 190 /* TODO: Handle priv->ex using GError */ 139 gchar *maildirpath = NULL; 140 maildirpath = g_strdup_printf ("maildir://%s/pop/%s@%s/maildir", 141 apriv->cache_location, apriv->user, apriv->host); 142 priv->inbox = create_maildir (self, apriv, "inbox", maildirpath); 143 g_free (maildirpath); 191 144 } 192 145 } … … 314 267 tny_camel_pop_store_account_finalize (GObject *object) 315 268 { 316 317 /* The abstract CamelStoreAccount finalizes everything correctly */ 318 269 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (object); 270 271 g_mutex_lock (priv->lock); 272 if (priv->inbox) 273 g_object_unref (G_OBJECT (priv->inbox)); 274 g_mutex_unlock (priv->lock); 275 276 g_mutex_free (priv->lock); 277 319 278 (*parent_class->finalize) (object); 320 279 … … 348 307 } 349 308 309 /** 310 * tny_camel_pop_store_account_get_delete_originals: 311 * @self: a TnyCamelPOPStoreAccount 312 * 313 * Get the delete originals property of @self. 314 * 315 * Return value: Whether or not to delete original messages from the service 316 **/ 317 gboolean 318 tny_camel_pop_store_account_get_delete_originals (TnyCamelPOPStoreAccount *self) 319 { 320 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (self); 321 322 return priv->delete_originals; 323 } 324 325 /** 326 * tny_camel_pop_store_account_set_delete_originals: 327 * @self: a TnyCamelPOPStoreAccount 328 * @delete_originals: Whether or not to delete original messages from the service 329 * 330 * Set the delete originals property of @self. 331 * 332 **/ 333 void 334 tny_camel_pop_store_account_set_delete_originals (TnyCamelPOPStoreAccount *self, gboolean delete_originals) 335 { 336 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (self); 337 338 priv->delete_originals = delete_originals; 339 } 350 340 351 341 static void 352 342 tny_camel_pop_store_account_instance_init (GTypeInstance *instance, gpointer g_class) 353 343 { 354 /* The abstract CamelStoreAccount initializes everything correctly */ 355 344 345 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (instance); 346 347 priv->lock = g_mutex_new (); 348 priv->inbox = NULL; 349 priv->delete_originals = FALSE; 350 356 351 return; 357 352 } trunk/libtinymail-camel/tny-camel-pop-store-account.h
r1357 r1383 52 52 TnyStoreAccount* tny_camel_pop_store_account_new (void); 53 53 54 gboolean tny_camel_pop_store_account_get_delete_originals (TnyCamelPOPStoreAccount *self); 55 void tny_camel_pop_store_account_set_delete_originals (TnyCamelPOPStoreAccount *self, gboolean delete_originals); 56 54 57 G_END_DECLS 55 58 trunk/libtinymail-camel/tny-camel-store-account.c
r1336 r1383 18 18 */ 19 19 20 /* TODO: Refactor to a TnyIMAPStoreAccount, TnyPOPStoreAccount and21 TnyNNTPStoreAccount. Maybe also add a TnyExchangeStoreAccount? This file can22 stay as an abstract TnyStoreAccount type. */23 24 20 #include <config.h> 25 21 #include <glib/gi18n-lib.h> trunk/libtinymail-camel/tny-session-camel.c
r1305 r1383 452 452 instance->prev_constat = FALSE; 453 453 instance->device = NULL; 454 instance->camel_dir = NULL; 454 455 } 455 456 … … 457 458 _tny_session_camel_add_account (TnySessionCamel *self, TnyCamelAccount *account) 458 459 { 460 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (account); 461 462 if (apriv->cache_location) 463 g_free (apriv->cache_location); 464 apriv->cache_location = g_strdup (self->camel_dir); 465 459 466 self->current_accounts = g_list_prepend (self->current_accounts, account); 460 467 } … … 463 470 _tny_session_camel_forget_account (TnySessionCamel *self, TnyCamelAccount *account) 464 471 { 472 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (account); 473 474 if (apriv->cache_location) 475 g_free (apriv->cache_location); 476 apriv->cache_location = NULL; 477 465 478 self->current_accounts = g_list_remove (self->current_accounts, account); 466 479 } … … 539 552 540 553 self->account_store = (gpointer)account_store; 541 base_directory = g_strdup (tny_account_store_get_cache_dir (account_store));554 base_directory = g_strdup (tny_account_store_get_cache_dir (account_store)); 542 555 543 556 if (G_LIKELY (camel_init (base_directory, TRUE) != 0)) … … 558 571 self->first_switch); 559 572 560 g_free (camel_dir);573 self->camel_dir = camel_dir; 561 574 g_free (base_directory); 562 575 563 576 tny_session_camel_set_device (self, device); 564 577 565 g_object_unref (G_OBJECT (device));578 g_object_unref (G_OBJECT (device)); 566 579 567 580 return; … … 583 596 (camel_object_new (TNY_TYPE_SESSION_CAMEL)); 584 597 598 retval->camel_dir = NULL; 585 599 tny_session_camel_set_account_store (retval, account_store); 586 600 … … 599 613 self->connchanged_signal); 600 614 } 615 616 if (self->camel_dir) 617 g_free (self->camel_dir); 601 618 602 619 /* CamelObject types don't need parent finalization (build-in camel) trunk/libtinymail-camel/tny-session-camel.h
r1148 r1383 42 42 guint connchanged_signal; 43 43 GList *current_accounts; 44 gchar *camel_dir; 44 45 }; 45 46 trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c
r1304 r1383 369 369 370 370 371 key = g_strdup_printf ("/apps/tinymail/accounts/%d/disabled", i); 372 if (gconf_client_get_bool (priv->client, (const gchar*) key, NULL)) 373 { 374 g_free (key); 375 continue; 376 } 377 g_free (key); 378 371 379 key = g_strdup_printf ("/apps/tinymail/accounts/%d/type", i); 372 380 type = gconf_client_get_string (priv->client, … … 389 397 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 390 398 account = TNY_ACCOUNT (tny_camel_nntp_store_account_new ()); 391 else if (!g_ascii_strncasecmp (proto, "pop", 4))399 else if (!g_ascii_strncasecmp (proto, "pop", 3)) 392 400 account = TNY_ACCOUNT (tny_camel_pop_store_account_new ()); 393 401 else /* Unknown, create a generic one? */ trunk/libtinymail-gpe/tny-gpe-account-store.c
r1290 r1383 250 250 g_free (key); 251 251 252 key = g_strdup_printf ("/apps/tinymail/accounts/%d/disabled", i); 253 if (gconf_client_get_bool (priv->client, (const gchar*) key, NULL)) 254 { 255 g_free (key); 256 continue; 257 } 258 g_free (key); 259 252 260 key = g_strdup_printf ("/apps/tinymail/accounts/%d/type", i); 253 261 type = gconf_client_get_string (priv->client, … … 271 279 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 272 280 account = TNY_ACCOUNT (tny_camel_nntp_store_account_new ()); 273 else if (!g_ascii_strncasecmp (proto, "pop", 4))281 else if (!g_ascii_strncasecmp (proto, "pop", 3)) 274 282 account = TNY_ACCOUNT (tny_camel_pop_store_account_new ()); 275 283 else /* Unknown, create a generic one? */ trunk/libtinymail-maemo/tny-maemo-account-store.c
r1290 r1383 251 251 g_free (key); 252 252 253 key = g_strdup_printf ("/apps/tinymail/accounts/%d/disabled", i); 254 if (gconf_client_get_bool (priv->client, (const gchar*) key, NULL)) 255 { 256 g_free (key); 257 continue; 258 } 259 g_free (key); 260 253 261 key = g_strdup_printf ("/apps/tinymail/accounts/%d/type", i); 254 262 type = gconf_client_get_string (priv->client, … … 272 280 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 273 281 account = TNY_ACCOUNT (tny_camel_nntp_store_account_new ()); 274 else if (!g_ascii_strncasecmp (proto, "pop", 4))282 else if (!g_ascii_strncasecmp (proto, "pop", 3)) 275 283 account = TNY_ACCOUNT (tny_camel_pop_store_account_new ()); 276 284 else /* Unknown, create a generic one? */ trunk/libtinymail-olpc/tny-olpc-account-store.c
r1290 r1383 212 212 } 213 213 214 if (g_key_file_get_boolean (keyfile, "tinymail", "disabled", NULL)) 215 { 216 g_free (fullfilen); 217 continue; 218 } 219 214 220 type = g_key_file_get_value (keyfile, "tinymail", "type", NULL); 215 221 proto = g_key_file_get_value (keyfile, "tinymail", "proto", NULL); … … 225 231 else if (!g_ascii_strncasecmp (proto, "nntp", 4)) 226 232 account = TNY_ACCOUNT (tny_camel_nntp_store_account_new ()); 227 else if (!g_ascii_strncasecmp (proto, "pop", 4))233 else if (!g_ascii_strncasecmp (proto, "pop", 3)) 228 234 account = TNY_ACCOUNT (tny_camel_pop_store_account_new ()); 229 235 else /* Unknown, create a generic one? */
