* improve the debug output a bit
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 8 Jan 2008 09:17:25 +0000 (09:17 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 8 Jan 2008 09:17:25 +0000 (09:17 +0000)
pmo-trunk-r3988

src/modest-mail-operation.c
src/modest-tny-account-store.c

index 7e95429..36b32f2 100644 (file)
@@ -3026,6 +3026,10 @@ modest_mail_operation_to_string (ModestMailOperation *self)
        g_return_val_if_fail (self, NULL);
 
        priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
+
+       /* new operations don't have anything interesting */
+       if (priv->op_type == MODEST_MAIL_OPERATION_TYPE_UNKNOWN)
+               return g_strdup_printf ("%p <new operation>", self);
        
        switch (priv->op_type) {
        case MODEST_MAIL_OPERATION_TYPE_SEND:    type= "SEND";    break;
@@ -3048,7 +3052,7 @@ modest_mail_operation_to_string (ModestMailOperation *self)
        } 
 
        account_id = priv->account ? tny_account_get_id (priv->account) : "";
-       
+
        return g_strdup_printf ("%p \"%s\" (%s) [%s] {%d/%d} '%s'", self, account_id,type, status,
                                priv->done, priv->total,
                                priv->error && priv->error->message ? priv->error->message : "");
index 4a4c4d1..54f7e17 100644 (file)
@@ -614,7 +614,7 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc
        g_return_val_if_fail (account, NULL);
        
        MODEST_DEBUG_BLOCK(
-               g_debug ("DEBUG: modest: %s: prompt (not shown) = %s\n", __FUNCTION__, prompt_not_used);
+               g_debug ("%s: prompt (not shown) = %s\n", __FUNCTION__, prompt_not_used);
        );
        
        /* Initialize the output parameter: */
@@ -647,7 +647,7 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc
                                                      NULL,
                                                      (gpointer*)&pwd_ptr);
        MODEST_DEBUG_BLOCK(
-               g_debug ("DEBUG: modest: %s: Already asked = %d\n", __FUNCTION__, already_asked);
+               g_debug ("%s: Already asked = %d\n", __FUNCTION__, already_asked);
        );
                
        /* If the password is not already there, try ModestConf */
@@ -666,7 +666,7 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc
                const gboolean settings_have_password = 
                        modest_account_mgr_get_server_account_has_password (priv->account_mgr, server_account_name);
                MODEST_DEBUG_BLOCK(
-                       printf ("DEBUG: modest: %s: settings_have_password=%d\n",
+                       printf ("%s: settings_have_password=%d\n",
                                __FUNCTION__, settings_have_password);
                );
                if (settings_have_password) {
@@ -763,7 +763,6 @@ modest_tny_account_store_forget_already_asked (ModestTnyAccountStore *self, TnyA
 static void
 forget_password (TnyAccount *account)
 {
-       printf ("DEBUG: %s\n", __FUNCTION__);
        ModestTnyAccountStore *self;
        ModestTnyAccountStorePrivate *priv;
        const TnyAccountStore *account_store;