Remove console spew.
authorSrinivasa Ragavan <sragavan@novell.com>
Thu, 16 Oct 2008 09:23:25 +0000 (09:23 +0000)
committerSrinivasa Ragavan <sragavan@src.gnome.org>
Thu, 16 Oct 2008 09:23:25 +0000 (09:23 +0000)
2008-10-16  Srinivasa Ragavan  <sragavan@novell.com>

* camel/camel-db.c: Remove console spew.
* camel/camel-folder-search.c:
* camel/camel-store.c:
* camel/camel-vee-folder.c:
* camel/camel-vee-summary.c:

svn path=/trunk/; revision=9683

camel/ChangeLog
camel/camel-db.c
camel/camel-folder-search.c
camel/camel-store.c
camel/camel-vee-folder.c
camel/camel-vee-summary.c

index 2c2d24c..5a052d8 100644 (file)
@@ -1,5 +1,13 @@
 2008-10-16  Srinivasa Ragavan  <sragavan@novell.com>
 
+       * camel/camel-db.c: Remove console spew.
+       * camel/camel-folder-search.c:
+       * camel/camel-store.c:
+       * camel/camel-vee-folder.c:
+       * camel/camel-vee-summary.c:
+
+2008-10-16  Srinivasa Ragavan  <sragavan@novell.com>
+
        ** Fix for bug #556495
 
        * camel/camel-db.c:
index cdae059..177b765 100644 (file)
@@ -307,8 +307,9 @@ camel_db_count_message_info (CamelDB *cdb, const char *query, guint32 *count, Ca
        CAMEL_DB_RELEASE_SQLITE_MEMORY;
                
        if (ret != SQLITE_OK) {
-               g_print ("Error in SQL SELECT statement: %s [%s]\n", query, errmsg);
-               camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _(errmsg));
+               d(g_print ("Error in SQL SELECT statement: %s [%s]\n", query, errmsg));
+               if (ex)
+                       camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _(errmsg));
                sqlite3_free (errmsg);
                errmsg = NULL;
        }
@@ -473,7 +474,8 @@ camel_db_select (CamelDB *cdb, const char* stmt, CamelDBSelectCB callback, gpoin
                
        if (ret != SQLITE_OK) {
                d(g_warning ("Error in select statement '%s' [%s].\n", stmt, errmsg));
-               camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, errmsg);
+               if (ex)
+                       camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, errmsg);
                sqlite3_free (errmsg);
                errmsg = NULL;
        }
index 839f217..27b7df5 100644 (file)
@@ -489,7 +489,7 @@ camel_folder_search_count(CamelFolderSearch *search, const char *expr, CamelExce
                if (ex && camel_exception_is_set(ex)) {
                        const char *exception = camel_exception_get_description (ex);
                        if (strncmp(exception, "no such table", 13) == 0) {
-                               g_warning ("Error during searching %s: %s\n", tmp, exception);
+                               d(g_warning ("Error during searching %s: %s\n", tmp, exception));
                                camel_exception_clear (ex); /* Suppress no such table */
                        }
                }
@@ -629,7 +629,7 @@ camel_folder_search_search(CamelFolderSearch *search, const char *expr, GPtrArra
                if (ex && camel_exception_is_set(ex)) {
                        const char *exception = camel_exception_get_description (ex);
                        if (strncmp(exception, "no such table", 13) == 0) {
-                               g_warning ("Error during searching %s: %s\n", tmp, exception);
+                               d(g_warning ("Error during searching %s: %s\n", tmp, exception));
                                camel_exception_clear (ex); /* Suppress no such table */
                        }
                }
index 9a05756..1b33a40 100644 (file)
@@ -236,11 +236,13 @@ construct (CamelService *service, CamelSession *session,
 
        /* This is for reading from the store */
        store->cdb_r = camel_db_open (store_db_path, ex);
-       printf("store_db_path %s\n", store_db_path);
+       if (camel_debug("sqlite"))
+               printf("store_db_path %s\n", store_db_path);
        if (camel_exception_is_set (ex)) {
                char *store_path;
                
-               g_print ("Failure for store_db_path : [%s]\n", store_db_path);
+               if (camel_debug("sqlite"))
+                       g_print ("Failure for store_db_path : [%s]\n", store_db_path);
                g_free (store_db_path);         
 
                store_path =  camel_session_get_storage_path (session, service, ex);
index 431baeb..528f7e7 100644 (file)
@@ -704,6 +704,9 @@ vee_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep
                if (g_hash_table_lookup(searched, f) == NULL) {
                        camel_vee_folder_hash_folder(f, hash);
                        matches = camel_folder_search_by_expression(f, expr, ex);
+                       if (camel_exception_is_set(ex) && strncmp(camel_exception_get_description(ex), "no such table", 13)) {
+                               camel_exception_clear(ex);
+                       }
                        if (matches) {
                                for (i = 0; i < matches->len; i++) {
                                        char *uid = matches->pdata[i], *vuid;
index 2307875..fc39762 100644 (file)
@@ -429,7 +429,7 @@ camel_vee_summary_add(CamelVeeSummary *s, CamelFolderSummary *summary, const cha
 
        if (mi) {
                /* Possible that the entry is loaded, see if it has the summary */
-               g_message ("%s - already there\n", vuid);
+               d(g_message ("%s - already there\n", vuid));
                g_free (vuid);
                if (!mi->summary) {
                        mi->summary = summary;