Changeset 3592

Show
Ignore:
Timestamp:
04/15/08 18:34:21
Author:
pvanhoof
Message:
        • Various bugfixes
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3589 r3592  
    44        not set to NULL 
    55        * Moved the POP's get-msg-qasync queue to its normal interactive queue 
     6        * Various bugfixes 
    67 
    782008-04-14  Philip Van Hoof <pvanhoof@gnome.org> 
  • trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c

    r3559 r3592  
    970970        dir = g_build_filename (session->storage_path, ".camel_certs", NULL); 
    971971 
    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) { 
    973973                g_warning ("Could not create cert directory '%s': %s", dir, strerror (errno)); 
    974974                g_free (dir); 
  • trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c

    r3304 r3592  
    358358        TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 
    359359 
    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) { 
    375361                gchar *cache_dir = gconf_client_get_string (priv->client,  
    376362                        "/apps/tinymail/cache_dir", NULL); 
     
    394380                load_accounts (self); 
    395381 
    396         if (priv->accounts) 
    397         { 
     382        if (priv->accounts) { 
    398383                GList *copy = priv->accounts; 
    399                 while (copy) 
    400                 { 
     384                while (copy) { 
    401385                        TnyAccount *account = copy->data; 
    402386 
    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) { 
    405388                                if (TNY_IS_STORE_ACCOUNT (account)) 
    406389                                        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) { 
    409391                                if (TNY_IS_TRANSPORT_ACCOUNT (account)) 
    410392                                        tny_list_prepend (list, (GObject*)account); 
    411393                        } 
    412  
    413394                        copy = g_list_next (copy); 
    414395                } 
     
    448429 
    449430*/ 
    450 #if 0 
    451 static void 
    452 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 #endif 
    487431 
    488432 
     
    523467        TnyPlatformFactory *platfact; 
    524468 
     469        priv->cache_dir = NULL; 
    525470        priv->accounts = NULL; 
    526471        priv->client = gconf_client_get_default (); 
     
    549494        kill_stored_accounts (priv); 
    550495 
    551         if (G_LIKELY (priv->cache_dir)
     496        if (priv->cache_dir
    552497                g_free (priv->cache_dir); 
    553498 
     
    570515{ 
    571516        TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 
    572      
    573517        return priv->session; 
    574518} 
  • trunk/libtinymail-gpe/tny-gpe-account-store.c

    r3304 r3592  
    334334                load_accounts (self); 
    335335 
    336         if (priv->accounts) 
    337         { 
     336        if (priv->accounts) { 
    338337                GList *copy = priv->accounts; 
    339                 while (copy) 
    340                 { 
     338                while (copy) { 
    341339                        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)) { 
    345341                                found = TNY_ACCOUNT (g_object_ref (G_OBJECT (account))); 
    346342                                break; 
    347343                        } 
    348  
    349344                        copy = g_list_next (copy); 
    350345                } 
     
    360355        TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 
    361356 
    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) { 
    377358                gchar *cache_dir = gconf_client_get_string (priv->client,  
    378359                        "/apps/tinymail/cache_dir", NULL); 
     
    399380        { 
    400381                GList *copy = priv->accounts; 
    401                 while (copy) 
    402                 { 
     382                while (copy) { 
    403383                        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) { 
    407385                                if (TNY_IS_STORE_ACCOUNT (account)) 
    408386                                        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) { 
    411388                                if (TNY_IS_TRANSPORT_ACCOUNT (account)) 
    412389                                        tny_list_prepend (list, (GObject*)account); 
    413390                        } 
    414  
    415391                        copy = g_list_next (copy); 
    416392                } 
     
    452428 
    453429*/ 
    454  
    455 static void 
    456 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 } 
    490430 
    491431 
     
    524464        TnyPlatformFactory *platfact; 
    525465 
     466        priv->cache_dir = NULL; 
    526467        priv->accounts = NULL; 
    527468        priv->client = gconf_client_get_default (); 
     
    543484tny_gpe_account_store_finalize (GObject *object) 
    544485{ 
    545         TnyGpeAccountStore *self = (TnyGpeAccountStore *)object;        
     486        TnyGpeAccountStore *self = (TnyGpeAccountStore *) object; 
    546487        TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 
    547488 
     
    551492        kill_stored_accounts (priv); 
    552493 
    553         if (G_LIKELY (priv->cache_dir)
     494        if (priv->cache_dir
    554495                g_free (priv->cache_dir); 
    555496 
  • trunk/libtinymail-maemo/tny-maemo-account-store.c

    r3433 r3592  
    341341                load_accounts (self); 
    342342 
    343         if (priv->accounts) 
    344         { 
     343        if (priv->accounts) { 
    345344                GList *copy = priv->accounts; 
    346                 while (copy) 
    347                 { 
     345                while (copy) { 
    348346                        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)) { 
    352348                                found = TNY_ACCOUNT (g_object_ref (G_OBJECT (account))); 
    353349                                break; 
    354350                        } 
    355  
    356351                        copy = g_list_next (copy); 
    357352                } 
     
    367362        TnyMaemoAccountStorePriv *priv = TNY_MAEMO_ACCOUNT_STORE_GET_PRIVATE (self); 
    368363 
    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) { 
    384365                gchar *cache_dir = gconf_client_get_string (priv->client,  
    385366                        "/apps/tinymail/cache_dir", NULL); 
     
    406387        { 
    407388                GList *copy = priv->accounts; 
    408                 while (copy) 
    409                 { 
     389                while (copy) { 
    410390                        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) { 
    414392                                if (TNY_IS_STORE_ACCOUNT (account)) 
    415393                                        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) { 
    418395                                if (TNY_IS_TRANSPORT_ACCOUNT (account)) 
    419396                                        tny_list_prepend (list, (GObject*)account); 
    420397                        } 
    421  
    422398                        copy = g_list_next (copy); 
    423399                } 
     
    460436*/ 
    461437 
    462 #if 0 /* Not used. */ 
    463 static void 
    464 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 #endif 
    499  
    500  
    501438 
    502439static TnyDevice* 
     
    504441{ 
    505442        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); 
    508444} 
    509445 
     
    534470        TnyPlatformFactory *platfact; 
    535471 
     472        priv->cache_dir = NULL; 
    536473        priv->accounts = NULL; 
    537474        priv->client = gconf_client_get_default (); 
     
    562499        kill_stored_accounts (priv); 
    563500 
    564         if (G_LIKELY (priv->cache_dir)
     501        if (priv->cache_dir
    565502                g_free (priv->cache_dir); 
    566503 
  • trunk/libtinymail-olpc/tny-olpc-account-store.c

    r3304 r3592  
    6767 
    6868static gchar*  
    69  
    7069per_account_get_pass(TnyAccount *account, const gchar *prompt, gboolean *cancel) 
    7170{ 
     
    7776        retval = (gchar*) tny_password_getter_get_password (pwdgetter,  
    7877                tny_account_get_id (account), prompt, cancel); 
    79         g_object_unref (G_OBJECT (pwdgetter)); 
     78        g_object_unref (pwdgetter); 
    8079 
    8180        return retval; 
     
    9190        pwdgetter = tny_platform_factory_new_password_getter (platfact); 
    9291        tny_password_getter_forget_password (pwdgetter, tny_account_get_id (account)); 
    93         g_object_unref (G_OBJECT (pwdgetter)); 
     92        g_object_unref (pwdgetter); 
    9493 
    9594        return; 
     
    166165                TnyAccount *account = NULL; gint port = 0; 
    167166                gchar *fullfilen = g_build_filename (g_get_home_dir(),  
    168                         ".tinymail", "accounts", filen); 
     167                        ".tinymail", "accounts", filen, NULL); 
    169168                keyfile = g_key_file_new (); 
    170169 
     
    365364        TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 
    366365 
    367         return g_object_ref (G_OBJECT (priv->device)); 
     366        return g_object_ref (priv->device); 
    368367} 
    369368 
     
    394393                tny_olpc_platform_factory_get_instance ()); 
    395394 
     395        priv->cache_dir = NULL; 
    396396        priv->accounts = NULL; 
    397397        priv->device = tny_platform_factory_new_device (platfact); 
     
    411411        if (priv->cache_dir) 
    412412                g_free (priv->cache_dir); 
     413 
     414        g_object_unref (priv->device); 
    413415 
    414416        (*parent_class->finalize) (object); 
  • trunk/libtinymailui-gtk/tny-gtk-account-list-model.c

    r3304 r3592  
    214214 
    215215        if (gtk_tree_model_get_iter_first (model, &iter)) 
    216           while (gtk_tree_model_iter_next (model, &iter)) 
     216          do  
    217217          { 
     218 
    218219                GObject *citem; 
    219220 
     
    229230                } 
    230231                g_object_unref (citem); 
    231           } 
     232          } while (gtk_tree_model_iter_next (model, &iter)); 
    232233 
    233234        g_mutex_unlock (me->iterator_lock); 
  • trunk/libtinymailui-gtk/tny-gtk-attach-list-model.c

    r3304 r3592  
    288288 
    289289        if (gtk_tree_model_get_iter_first (model, &iter)) 
    290           while (gtk_tree_model_iter_next (model, &iter)) 
     290          do 
    291291          { 
    292292                GObject *citem; 
     
    303303                } 
    304304                g_object_unref (citem); 
    305           } 
    306      
     305          } while (gtk_tree_model_iter_next (model, &iter)); 
     306 
    307307        g_mutex_unlock (me->iterator_lock); 
    308308}