Remove debug_printf usage.
authorQball <qball@s010375t.(none)>
Wed, 17 Feb 2010 08:43:07 +0000 (09:43 +0100)
committerQball <qball@s010375t.(none)>
Wed, 17 Feb 2010 08:43:07 +0000 (09:43 +0100)
12 files changed:
src/MetaData/metadata.c
src/browsers/playlist3-current-playlist-browser.c
src/browsers/playlist3-find2-browser.c
src/browsers/playlist3-playlist-editor.c
src/browsers/playlist3-tag2-browser.c
src/browsers/server-information.c
src/gmpc-meta-watcher.gob
src/gmpc-mpddata-model.gob
src/gmpc-mpddata-treeview.gob
src/gmpc-profiles.gob
src/main.c
src/main.h

index dc7d4d3..b665919 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "gmpc_easy_download.h"
 
+#define LOG_DOMAIN "MetaData"
 
 int meta_num_plugins=0;
 gmpcPluginParent **meta_plugins = NULL;
@@ -186,7 +187,7 @@ mpd_Song *rewrite_mpd_song(mpd_Song *tsong, MetaDataType type)
                        edited->artist = g_strdup_printf("%s %s", g_strstrip(str[1]), g_strstrip(str[0]));
                }
                g_strfreev(str);
-               debug_printf(DEBUG_INFO, "string converted to: '%s'", edited->artist);
+               g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "string converted to: '%s'", edited->artist);
        }
 
        /**
@@ -342,7 +343,7 @@ void meta_data_destroy(void)
                process_queue = NULL;
        }
 
-       debug_printf(DEBUG_INFO,"Done..");
+       g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG,"Done..");
        /* Close the cover database  */
        TOC("test")
        metadata_cache_destroy();
@@ -470,11 +471,11 @@ static void metadata_download_handler(const GEADAsyncHandler *handle, GEADStatus
 
                if(error){
                        /* Ok we failed to store it, now we cleanup, and try the next entry. */
-                       debug_printf(DEBUG_ERROR, "Failed to store file: %s: '%s'", filename, error->message);
+                       g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Failed to store file: %s: '%s'", filename, error->message);
                        g_error_free(error); error = NULL;
                }
                else
-                       debug_printf(DEBUG_ERROR, "Failed to store file: %s: '%li'", gmpc_easy_handler_get_uri(handle),length);
+                       g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Failed to store file: %s: '%i'", gmpc_easy_handler_get_uri(handle),(int)length);
                /* If we fail, clean up and try next one */
                g_free(filename);
        }
@@ -990,10 +991,10 @@ gchar * gmpc_get_metadata_filename(MetaDataType  type, mpd_Song *song, char *ext
                /*
                   if (g_get_charset (&charset))
                   {
-                  debug_printf(DEBUG_INFO, "Locale is utf-8, just copying");
+                  g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Locale is utf-8, just copying");
                   dirname = g_strdup(song->artist);
                   }else{
-                  debug_printf(DEBUG_INFO, "Locale is %s converting to UTF-8", charset);
+                  g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Locale is %s converting to UTF-8", charset);
                   dirname = g_convert_with_fallback (song->artist, -1,
                   charset, "UTF-8","-", NULL, NULL, &error);
                   }
@@ -1007,7 +1008,7 @@ gchar * gmpc_get_metadata_filename(MetaDataType  type, mpd_Song *song, char *ext
                }
                //dirname = g_filename_from_utf8(song->artist,-1,NULL,NULL,&error); 
                if(error) {
-                       debug_printf(DEBUG_ERROR, "Failed to convert %s to file encoding. '%s'", song->artist, error->message);
+                       g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Failed to convert %s to file encoding. '%s'", song->artist, error->message);
                        g_error_free(error);
                        if(dirname) g_free(dirname);
                        dirname = g_strdup("invalid");
index 44194d8..a9c22f9 100644 (file)
@@ -1147,7 +1147,6 @@ static void pl3_current_playlist_save_myself(GmpcPluginBase *obj)
         if(path)
         {
             gint *indices = gtk_tree_path_get_indices(path);
-            debug_printf(DEBUG_INFO,"Saving myself to position: %i\n", indices[0]);
             cfg_set_single_value_as_int(config, "current-playlist","position",indices[0]);
             gtk_tree_path_free(path);
         }
index e3b9309..a1c7586 100644 (file)
@@ -852,7 +852,6 @@ static void pl3_find2_save_myself(void)
                if(path)
                {
                        gint *indices = gtk_tree_path_get_indices(path);
-                       debug_printf(DEBUG_INFO,"Saving myself to position: %i\n", indices[0]);
                        cfg_set_single_value_as_int(config, "find2-browser","position",indices[0]);
                        gtk_tree_path_free(path);
                }
index 6bada8e..512e58c 100644 (file)
@@ -399,7 +399,6 @@ static void playlist_editor_list_delete_songs(GtkButton *button, GtkTreeView *tr
                                mpd_database_playlist_list_delete(connection, pl_path,pos[0]);
                        }
                }
-        debug_printf(DEBUG_INFO,"ping\n");
                g_list_foreach (list,(GFunc) gtk_tree_path_free, NULL);
                g_list_free (list);
 
@@ -1101,7 +1100,6 @@ static void playlist_editor_save_myself(void)
         if(path)
         {
             gint *indices = gtk_tree_path_get_indices(path);
-            debug_printf(DEBUG_INFO,"Saving myself to position: %i\n", indices[0]);
             cfg_set_single_value_as_int(config, "playlist-plugin","position",indices[0]);
             gtk_tree_path_free(path);
         }
index d114641..3297735 100644 (file)
@@ -30,7 +30,6 @@
 #include <string.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#include <libmpd/debug_printf.h>
 #include "main.h"
 #include "misc.h"
 #include "gmpc-mpddata-treeview.h"
@@ -43,6 +42,7 @@
 #include "playlist3-playlist-editor.h"
 #include "gmpc-extras.h"
 
+#define LOG_DOMAIN "TagBrowser"
 /**
  * dirty hack to workaround single parameter for now 
  */
@@ -1886,7 +1886,7 @@ static void tag2_save_myself(void)
                        {
                                gint *indices = gtk_tree_path_get_indices(path);
                                gchar *group = g_strdup_printf("tag2-plugin:%s",tb->key);
-                               debug_printf(DEBUG_INFO,"Saving myself to position: %i\n", indices[0]);
+                               g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG,"Saving myself to position: %i\n", indices[0]);
                                cfg_set_single_value_as_int(config, group,"position",indices[0]);
                                gtk_tree_path_free(path);
                                g_free(group);
index b5efa1b..665aea0 100644 (file)
@@ -485,7 +485,6 @@ static void serverinformation_popup_close(GtkWidget *dialog, gint response_id, g
     /* destroy dialog */
     gtk_widget_destroy(dialog);
     
-    debug_printf(DEBUG_INFO,"Close dialog: %i %i",width,height);
 }
 
 static void serverstats_connection_changed(MpdObj *mi, int connect,void *usedata)
index 3551536..cd31760 100644 (file)
@@ -21,7 +21,6 @@ requires 2.0.0
 %ht{
 #include <gtk/gtk.h>
 #include <libmpd/libmpd.h>
-#include <libmpd/debug_printf.h>
 #include "metadata.h"
 
 %}
index 67dd3a3..1b79b50 100644 (file)
@@ -71,6 +71,10 @@ requires 2.0.0
        } ;
 %}
 
+%{
+#define LOG_DOMAIN "MpdData.Model"
+%}
+
  class Gmpc:MpdData:Model from G:Object
           (interface Gtk:Tree:Sortable)
           (interface Gtk:Tree:Model)
@@ -820,7 +824,7 @@ end:
             self->_priv->data = NULL;
 
             if(self->num_rows != 0)
-                debug_printf(DEBUG_ERROR,"not every row cleared %i\n",self->num_rows);
+                g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING,"not every row cleared %i\n",self->num_rows);
             self->num_rows =0;
             /* Free possible stored images */
             if(self->_priv->images && self->_priv->use_images)
index 4370997..a34a55c 100644 (file)
@@ -132,6 +132,8 @@ static gint  col_position[NUM_COLS] = {
 };
 
 static GList *paste_queue = NULL;
+
+#define LOG_DOMAIN "MpdData.TreeView"
 %}
 
 class Gmpc:MpdData:Treeview from Gtk:Tree:View {
@@ -893,7 +895,7 @@ class Gmpc:MpdData:Treeview from Gtk:Tree:View {
                                                                MPDDATA_MODEL_ROW_TYPE,&type, 
                                                                MPDDATA_MODEL_COL_PATH, &path, 
                                                                -1);                    
-                                               debug_printf(DEBUG_INFO, "Copying song, into queue: %s\n", path);
+                                               g_log(LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Copying song, into queue: %s\n", path);
                                                if(type == MPD_DATA_TYPE_SONG) {
                                                        paste_queue = g_list_prepend(paste_queue, path);
                                                } else if (type == MPD_DATA_TYPE_DIRECTORY) {
index 66068ee..65eeb15 100644 (file)
@@ -419,7 +419,7 @@ class Gmpc:Profiles from G:Object
     Profile *prof =  self_get_profile(self, id);
     if(!prof)
     {
-        g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Trying to remove not-existing profile: %i\n", id);
+        g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Trying to remove not-existing profile: %s\n", id);
       return;
     }
     /* Generate removal message before the actual profile is destroyed */
index 6f4ae85..7099b01 100644 (file)
@@ -50,6 +50,7 @@
 #include "bug-information.h"
 
 #include "Widgets/pixbuf-cache.h"
+#include <libmpd/debug_printf.h>
 
 #define LOG_DOMAIN "Gmpc"
 /**
index 641b0a4..ca1ca8a 100644 (file)
@@ -31,7 +31,6 @@
 #include "config-defaults.h"
 #include <libmpd/libmpd.h>
 #include <libmpd/libmpdclient.h>
-#include <libmpd/debug_printf.h>
 #include "config1.h"
 #include "plugin.h"
 #include "plugin-internal.h"