Changeset 3592
- Timestamp:
- 04/15/08 18:34:21
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c (modified) (1 diff)
- trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c (modified) (6 diffs)
- trunk/libtinymail-gpe/tny-gpe-account-store.c (modified) (7 diffs)
- trunk/libtinymail-maemo/tny-maemo-account-store.c (modified) (7 diffs)
- trunk/libtinymail-olpc/tny-olpc-account-store.c (modified) (7 diffs)
- trunk/libtinymailui-gtk/tny-gtk-account-list-model.c (modified) (2 diffs)
- trunk/libtinymailui-gtk/tny-gtk-attach-list-model.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3589 r3592 4 4 not set to NULL 5 5 * Moved the POP's get-msg-qasync queue to its normal interactive queue 6 * Various bugfixes 6 7 7 8 2008-04-14 Philip Van Hoof <pvanhoof@gnome.org> trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c
r3559 r3592 970 970 dir = g_build_filename (session->storage_path, ".camel_certs", NULL); 971 971 972 if (g_stat (dir, &st) == -1 && g_mkdir (dir, 0700) == -1) {972 if (g_stat (dir, &st) == -1 && g_mkdir_with_parents (dir, 0700) == -1) { 973 973 g_warning ("Could not create cert directory '%s': %s", dir, strerror (errno)); 974 974 g_free (dir); trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c
r3304 r3592 358 358 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 359 359 360 if (G_UNLIKELY (!priv->cache_dir)) 361 { 362 /* Note that there's no listener for this key. If it changes, 363 the camelsession should be destroyed and rebuild from scratch. 364 Which basically means reloading the accounts aswell. 365 366 So say you're a nut who wants this key to be updatable at 367 runtime, you'll have to unload all the accounts here, and of 368 course reload them. All the functionality for that is already 369 available. Perhaps I should just do it ... hmm, maybe another 370 day. Soon. Perhaps. I don't know. Probably . . . . bleh. 371 372 Oh and, not to forget! You should probably also move the old 373 cache location to the new one. Or cleanup the old one. */ 374 360 if (!priv->cache_dir) { 375 361 gchar *cache_dir = gconf_client_get_string (priv->client, 376 362 "/apps/tinymail/cache_dir", NULL); … … 394 380 load_accounts (self); 395 381 396 if (priv->accounts) 397 { 382 if (priv->accounts) { 398 383 GList *copy = priv->accounts; 399 while (copy) 400 { 384 while (copy) { 401 385 TnyAccount *account = copy->data; 402 386 403 if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS) 404 { 387 if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS) { 405 388 if (TNY_IS_STORE_ACCOUNT (account)) 406 389 tny_list_prepend (list, (GObject*)account); 407 } else if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS) 408 { 390 } else if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS) { 409 391 if (TNY_IS_TRANSPORT_ACCOUNT (account)) 410 392 tny_list_prepend (list, (GObject*)account); 411 393 } 412 413 394 copy = g_list_next (copy); 414 395 } … … 448 429 449 430 */ 450 #if 0451 static void452 tny_gnome_account_store_add_account (TnyAccountStore *self, TnyAccount *account, const gchar *type)453 {454 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self);455 gchar *key = NULL;456 gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL);457 458 g_assert (TNY_IS_ACCOUNT (account));459 460 key = g_strdup_printf ("/apps/tinymail/accounts/%d/hostname", count);461 gconf_client_set_string (priv->client, (const gchar*) key,462 tny_account_get_hostname (account), NULL);463 g_free (key);464 465 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", count);466 gconf_client_set_string (priv->client, (const gchar*) key,467 tny_account_get_proto (account), NULL);468 g_free (key);469 470 key = g_strdup_printf ("/apps/tinymail/accounts/%d/type", count);471 gconf_client_set_string (priv->client, (const gchar*) key, type, NULL);472 g_free (key);473 474 key = g_strdup_printf ("/apps/tinymail/accounts/%d/user", count);475 gconf_client_set_string (priv->client, (const gchar*) key,476 tny_account_get_user (account), NULL);477 g_free (key);478 479 count++;480 481 gconf_client_set_int (priv->client, "/apps/tinymail/accounts/count",482 count, NULL);483 484 return;485 }486 #endif487 431 488 432 … … 523 467 TnyPlatformFactory *platfact; 524 468 469 priv->cache_dir = NULL; 525 470 priv->accounts = NULL; 526 471 priv->client = gconf_client_get_default (); … … 549 494 kill_stored_accounts (priv); 550 495 551 if ( G_LIKELY (priv->cache_dir))496 if (priv->cache_dir) 552 497 g_free (priv->cache_dir); 553 498 … … 570 515 { 571 516 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 572 573 517 return priv->session; 574 518 } trunk/libtinymail-gpe/tny-gpe-account-store.c
r3304 r3592 334 334 load_accounts (self); 335 335 336 if (priv->accounts) 337 { 336 if (priv->accounts) { 338 337 GList *copy = priv->accounts; 339 while (copy) 340 { 338 while (copy) { 341 339 TnyAccount *account = copy->data; 342 343 if (tny_account_matches_url_string (account, url_string)) 344 { 340 if (tny_account_matches_url_string (account, url_string)) { 345 341 found = TNY_ACCOUNT (g_object_ref (G_OBJECT (account))); 346 342 break; 347 343 } 348 349 344 copy = g_list_next (copy); 350 345 } … … 360 355 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 361 356 362 if (G_UNLIKELY (!priv->cache_dir)) 363 { 364 /* Note that there's no listener for this key. If it changes, 365 the camelsession should be destroyed and rebuild from scratch. 366 Which basically means reloading the accounts aswell. 367 368 So say you're a nut who wants this key to be updatable at 369 runtime, you'll have to unload all the accounts here, and of 370 course reload them. All the functionality for that is already 371 available. Perhaps I should just do it ... hmm, maybe another 372 day. Soon. Perhaps. I don't know. Probably . . . . bleh. 373 374 Oh and, not to forget! You should probably also move the old 375 cache location to the new one. Or cleanup the old one. */ 376 357 if (!priv->cache_dir) { 377 358 gchar *cache_dir = gconf_client_get_string (priv->client, 378 359 "/apps/tinymail/cache_dir", NULL); … … 399 380 { 400 381 GList *copy = priv->accounts; 401 while (copy) 402 { 382 while (copy) { 403 383 TnyAccount *account = copy->data; 404 405 if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS) 406 { 384 if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS) { 407 385 if (TNY_IS_STORE_ACCOUNT (account)) 408 386 tny_list_prepend (list, (GObject*)account); 409 } else if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS) 410 { 387 } else if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS) { 411 388 if (TNY_IS_TRANSPORT_ACCOUNT (account)) 412 389 tny_list_prepend (list, (GObject*)account); 413 390 } 414 415 391 copy = g_list_next (copy); 416 392 } … … 452 428 453 429 */ 454 455 static void456 tny_gpe_account_store_add_account (TnyAccountStore *self, TnyAccount *account, const gchar *type)457 {458 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self);459 gchar *key = NULL;460 gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL);461 462 g_assert (TNY_IS_ACCOUNT (account));463 464 count++;465 466 key = g_strdup_printf ("/apps/tinymail/accounts/%d/hostname", count);467 gconf_client_set_string (priv->client, (const gchar*) key,468 tny_account_get_hostname (account), NULL);469 g_free (key);470 471 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", count);472 gconf_client_set_string (priv->client, (const gchar*) key,473 tny_account_get_proto (account), NULL);474 g_free (key);475 476 key = g_strdup_printf ("/apps/tinymail/accounts/%d/type", count);477 gconf_client_set_string (priv->client, (const gchar*) key, type, NULL);478 g_free (key);479 480 key = g_strdup_printf ("/apps/tinymail/accounts/%d/user", count);481 gconf_client_set_string (priv->client, (const gchar*) key,482 tny_account_get_user (account), NULL);483 g_free (key);484 485 gconf_client_set_int (priv->client, "/apps/tinymail/accounts/count",486 count, NULL);487 488 return;489 }490 430 491 431 … … 524 464 TnyPlatformFactory *platfact; 525 465 466 priv->cache_dir = NULL; 526 467 priv->accounts = NULL; 527 468 priv->client = gconf_client_get_default (); … … 543 484 tny_gpe_account_store_finalize (GObject *object) 544 485 { 545 TnyGpeAccountStore *self = (TnyGpeAccountStore *) object;486 TnyGpeAccountStore *self = (TnyGpeAccountStore *) object; 546 487 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 547 488 … … 551 492 kill_stored_accounts (priv); 552 493 553 if ( G_LIKELY (priv->cache_dir))494 if (priv->cache_dir) 554 495 g_free (priv->cache_dir); 555 496 trunk/libtinymail-maemo/tny-maemo-account-store.c
r3433 r3592 341 341 load_accounts (self); 342 342 343 if (priv->accounts) 344 { 343 if (priv->accounts) { 345 344 GList *copy = priv->accounts; 346 while (copy) 347 { 345 while (copy) { 348 346 TnyAccount *account = copy->data; 349 350 if (tny_account_matches_url_string (account, url_string)) 351 { 347 if (tny_account_matches_url_string (account, url_string)) { 352 348 found = TNY_ACCOUNT (g_object_ref (G_OBJECT (account))); 353 349 break; 354 350 } 355 356 351 copy = g_list_next (copy); 357 352 } … … 367 362 TnyMaemoAccountStorePriv *priv = TNY_MAEMO_ACCOUNT_STORE_GET_PRIVATE (self); 368 363 369 if (G_UNLIKELY (!priv->cache_dir)) 370 { 371 /* Note that there's no listener for this key. If it changes, 372 the camelsession should be destroyed and rebuild from scratch. 373 Which basically means reloading the accounts aswell. 374 375 So say you're a nut who wants this key to be updatable at 376 runtime, you'll have to unload all the accounts here, and of 377 course reload them. All the functionality for that is already 378 available. Perhaps I should just do it ... hmm, maybe another 379 day. Soon. Perhaps. I don't know. Probably . . . . bleh. 380 381 Oh and, not to forget! You should probably also move the old 382 cache location to the new one. Or cleanup the old one. */ 383 364 if (!priv->cache_dir) { 384 365 gchar *cache_dir = gconf_client_get_string (priv->client, 385 366 "/apps/tinymail/cache_dir", NULL); … … 406 387 { 407 388 GList *copy = priv->accounts; 408 while (copy) 409 { 389 while (copy) { 410 390 TnyAccount *account = copy->data; 411 412 if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS) 413 { 391 if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS) { 414 392 if (TNY_IS_STORE_ACCOUNT (account)) 415 393 tny_list_prepend (list, (GObject*)account); 416 } else if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS) 417 { 394 } else if (types == TNY_ACCOUNT_STORE_BOTH || types == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS) { 418 395 if (TNY_IS_TRANSPORT_ACCOUNT (account)) 419 396 tny_list_prepend (list, (GObject*)account); 420 397 } 421 422 398 copy = g_list_next (copy); 423 399 } … … 460 436 */ 461 437 462 #if 0 /* Not used. */463 static void464 tny_maemo_account_store_add_account (TnyAccountStore *self, TnyAccount *account, const gchar *type)465 {466 TnyMaemoAccountStorePriv *priv = TNY_MAEMO_ACCOUNT_STORE_GET_PRIVATE (self);467 gchar *key = NULL;468 gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL);469 470 g_assert (TNY_IS_ACCOUNT (account));471 472 count++;473 474 key = g_strdup_printf ("/apps/tinymail/accounts/%d/hostname", count);475 gconf_client_set_string (priv->client, (const gchar*) key,476 tny_account_get_hostname (account), NULL);477 g_free (key);478 479 key = g_strdup_printf ("/apps/tinymail/accounts/%d/proto", count);480 gconf_client_set_string (priv->client, (const gchar*) key,481 tny_account_get_proto (account), NULL);482 g_free (key);483 484 key = g_strdup_printf ("/apps/tinymail/accounts/%d/type", count);485 gconf_client_set_string (priv->client, (const gchar*) key, type, NULL);486 g_free (key);487 488 key = g_strdup_printf ("/apps/tinymail/accounts/%d/user", count);489 gconf_client_set_string (priv->client, (const gchar*) key,490 tny_account_get_user (account), NULL);491 g_free (key);492 493 gconf_client_set_int (priv->client, "/apps/tinymail/accounts/count",494 count, NULL);495 496 return;497 }498 #endif499 500 501 438 502 439 static TnyDevice* … … 504 441 { 505 442 TnyMaemoAccountStorePriv *priv = TNY_MAEMO_ACCOUNT_STORE_GET_PRIVATE (self); 506 507 return g_object_ref (G_OBJECT (priv->device)); 443 return g_object_ref (priv->device); 508 444 } 509 445 … … 534 470 TnyPlatformFactory *platfact; 535 471 472 priv->cache_dir = NULL; 536 473 priv->accounts = NULL; 537 474 priv->client = gconf_client_get_default (); … … 562 499 kill_stored_accounts (priv); 563 500 564 if ( G_LIKELY (priv->cache_dir))501 if (priv->cache_dir) 565 502 g_free (priv->cache_dir); 566 503 trunk/libtinymail-olpc/tny-olpc-account-store.c
r3304 r3592 67 67 68 68 static gchar* 69 70 69 per_account_get_pass(TnyAccount *account, const gchar *prompt, gboolean *cancel) 71 70 { … … 77 76 retval = (gchar*) tny_password_getter_get_password (pwdgetter, 78 77 tny_account_get_id (account), prompt, cancel); 79 g_object_unref ( G_OBJECT (pwdgetter));78 g_object_unref (pwdgetter); 80 79 81 80 return retval; … … 91 90 pwdgetter = tny_platform_factory_new_password_getter (platfact); 92 91 tny_password_getter_forget_password (pwdgetter, tny_account_get_id (account)); 93 g_object_unref ( G_OBJECT (pwdgetter));92 g_object_unref (pwdgetter); 94 93 95 94 return; … … 166 165 TnyAccount *account = NULL; gint port = 0; 167 166 gchar *fullfilen = g_build_filename (g_get_home_dir(), 168 ".tinymail", "accounts", filen );167 ".tinymail", "accounts", filen, NULL); 169 168 keyfile = g_key_file_new (); 170 169 … … 365 364 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 366 365 367 return g_object_ref ( G_OBJECT (priv->device));366 return g_object_ref (priv->device); 368 367 } 369 368 … … 394 393 tny_olpc_platform_factory_get_instance ()); 395 394 395 priv->cache_dir = NULL; 396 396 priv->accounts = NULL; 397 397 priv->device = tny_platform_factory_new_device (platfact); … … 411 411 if (priv->cache_dir) 412 412 g_free (priv->cache_dir); 413 414 g_object_unref (priv->device); 413 415 414 416 (*parent_class->finalize) (object); trunk/libtinymailui-gtk/tny-gtk-account-list-model.c
r3304 r3592 214 214 215 215 if (gtk_tree_model_get_iter_first (model, &iter)) 216 while (gtk_tree_model_iter_next (model, &iter))216 do 217 217 { 218 218 219 GObject *citem; 219 220 … … 229 230 } 230 231 g_object_unref (citem); 231 } 232 } while (gtk_tree_model_iter_next (model, &iter)); 232 233 233 234 g_mutex_unlock (me->iterator_lock); trunk/libtinymailui-gtk/tny-gtk-attach-list-model.c
r3304 r3592 288 288 289 289 if (gtk_tree_model_get_iter_first (model, &iter)) 290 while (gtk_tree_model_iter_next (model, &iter))290 do 291 291 { 292 292 GObject *citem; … … 303 303 } 304 304 g_object_unref (citem); 305 } 306 305 } while (gtk_tree_model_iter_next (model, &iter)); 306 307 307 g_mutex_unlock (me->iterator_lock); 308 308 }
