improved debug messages
authorVladimir Nadvornik <nadvornik@suse.cz>
Tue, 31 Mar 2009 20:05:16 +0000 (20:05 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Tue, 31 Mar 2009 20:05:16 +0000 (20:05 +0000)
20 files changed:
src/bar_comment.c
src/bar_exif.c
src/bar_histogram.c
src/bar_keywords.c
src/cache_maint.c
src/collect-io.c
src/collect.c
src/dupe.c
src/filecache.c
src/filedata.c
src/histogram.c
src/image-load.c
src/image-overlay.c
src/image.c
src/img-view.c
src/layout_image.c
src/search.c
src/thumb.c
src/view_dir.c
src/view_file.c

index 0a65aa7..4aabdc5 100644 (file)
@@ -162,7 +162,12 @@ static void bar_pane_comment_write_config(GtkWidget *pane, GString *outstr, gint
 static void bar_pane_comment_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        PaneCommentData *pcd = data;
-       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pcd->fd) bar_pane_comment_update(pcd);
+       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pcd->fd) 
+               {
+               DEBUG_1("Notify pane_comment: %s %04x", fd->path, type);
+
+               bar_pane_comment_update(pcd);
+               }
 }
 
 static void bar_pane_comment_changed(GtkTextBuffer *buffer, gpointer data)
index 1f193e9..d185248 100644 (file)
@@ -314,7 +314,11 @@ gint bar_pane_exif_event(GtkWidget *bar, GdkEvent *event)
 static void bar_pane_exif_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        PaneExifData *ped = data;
-       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == ped->fd) bar_pane_exif_update(ped);
+       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == ped->fd) 
+               {
+               DEBUG_1("Notify pane_exif: %s %04x", fd->path, type);
+               bar_pane_exif_update(ped);
+               }
 }
 
 
index 240150d..04a001e 100644 (file)
@@ -130,7 +130,11 @@ static void bar_pane_histogram_write_config(GtkWidget *pane, GString *outstr, gi
 static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        PaneHistogramData *phd = data;
-       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd) bar_pane_histogram_update(phd);
+       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd) 
+               {
+               DEBUG_1("Notify pane_histogram: %s %04x", fd->path, type);
+               bar_pane_histogram_update(phd);
+               }
 }
 
 static gboolean bar_pane_histogram_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
index e087908..7f2b40b 100644 (file)
@@ -411,7 +411,11 @@ static void bar_pane_keywords_populate_popup_cb(GtkTextView *textview, GtkMenu *
 static void bar_pane_keywords_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        PaneKeywordsData *pkd = data;
-       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pkd->fd) bar_pane_keywords_update(pkd);
+       if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pkd->fd) 
+               {
+               DEBUG_1("Notify pane_keywords: %s %04x", fd->path, type);
+               bar_pane_keywords_update(pkd);
+               }
 }
 
 static gboolean bar_pane_keywords_changed_idle_cb(gpointer data)
index f7acd1d..edb659a 100644 (file)
@@ -623,6 +623,7 @@ void cache_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
        
+       DEBUG_1("Notify cache_maint: %s %04x", fd->path, type);
        switch (fd->change->type)
                {
                case FILEDATA_CHANGE_MOVE:
index f2a8d56..ee6626b 100644 (file)
@@ -936,6 +936,7 @@ void collect_manager_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
        
+       DEBUG_1("Notify collect_manager: %s %04x", fd->path, type);
        switch (fd->change->type)
                {
                case FILEDATA_CHANGE_MOVE:
index 9edca4e..6704845 100644 (file)
@@ -750,6 +750,8 @@ static void collection_notify_cb(FileData *fd, NotifyType type, gpointer data)
        CollectionData *cd = data;
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+       DEBUG_1("Notify collection: %s %04x", fd->path, type);
        
        switch (fd->change->type)
                {
index 2925c04..16e60a2 100644 (file)
@@ -3572,6 +3572,8 @@ static void dupe_notify_cb(FileData *fd, NotifyType type, gpointer data)
        DupeWindow *dw = data;
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+       DEBUG_1("Notify dupe: %s %04x", fd->path, type);
        
        switch (fd->change->type)
                {
index 33df6a4..8ceea0d 100644 (file)
@@ -60,10 +60,10 @@ gboolean file_cache_get(FileCacheData *fc, FileData *fd)
                if (fce->fd == fd)
                        {
                        /* entry exists */
-                       DEBUG_1("cache hit: fc=%p %s", fc, fd->path);
+                       DEBUG_2("cache hit: fc=%p %s", fc, fd->path);
                        if (work == fc->list) return TRUE; /* already at the beginning */
                        /* move it to the beginning */
-                       DEBUG_1("cache move to front: fc=%p %s", fc, fd->path);
+                       DEBUG_2("cache move to front: fc=%p %s", fc, fd->path);
                        fc->list = g_list_remove_link(fc->list, work);
                        fc->list = g_list_concat(work, fc->list);
                        
@@ -75,7 +75,7 @@ gboolean file_cache_get(FileCacheData *fc, FileData *fd)
                        }
                work = work->next;
                }
-       DEBUG_1("cache miss: fc=%p %s", fc, fd->path);
+       DEBUG_2("cache miss: fc=%p %s", fc, fd->path);
        return FALSE;
 }
 
@@ -95,7 +95,7 @@ void file_cache_set_size(FileCacheData *fc, gulong size)
                fc->list = g_list_delete_link(fc->list, work);
                work = prev;
                
-               DEBUG_1("file changed - cache remove: fc=%p %s", fc, last_fe->fd->path);
+               DEBUG_2("file changed - cache remove: fc=%p %s", fc, last_fe->fd->path);
                fc->size -= last_fe->size;
                fc->release(last_fe->fd);
                file_data_unref(last_fe->fd);
@@ -109,7 +109,7 @@ void file_cache_put(FileCacheData *fc, FileData *fd, gulong size)
 
        if (file_cache_get(fc, fd)) return;
        
-       DEBUG_1("cache add: fc=%p %s", fc, fd->path);
+       DEBUG_2("cache add: fc=%p %s", fc, fd->path);
        fe = g_new(FileCacheEntry, 1);
        fe->fd = file_data_ref(fd);
        fe->size = size;
@@ -183,6 +183,7 @@ static void file_cache_notify_cb(FileData *fd, NotifyType type, gpointer data)
 
        if (type & (NOTIFY_REREAD | NOTIFY_CHANGE)) /* invalidate the entry on each file change */
                {
+               DEBUG_1("Notify cache: %s %04x", fd->path, type);
                file_cache_remove_fd(fc, fd);
                }
 }
index 785b84f..12261a9 100644 (file)
@@ -2281,7 +2281,7 @@ gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data,
        nd->priority = priority;
 
        notify_func_list = g_list_insert_sorted(notify_func_list, nd, file_data_notify_sort);
-       DEBUG_1("Notify func registered: %p", nd);
+       DEBUG_2("Notify func registered: %p", nd);
        
        return TRUE;
 }
@@ -2298,7 +2298,7 @@ gboolean file_data_unregister_notify_func(FileDataNotifyFunc func, gpointer data
                        {
                        notify_func_list = g_list_delete_link(notify_func_list, work);
                        g_free(nd);
-                       DEBUG_1("Notify func unregistered: %p", nd);
+                       DEBUG_2("Notify func unregistered: %p", nd);
                        return TRUE;
                        }
                work = work->next;
@@ -2316,7 +2316,6 @@ void file_data_send_notification(FileData *fd, NotifyType type)
                {
                NotifyData *nd = (NotifyData *)work->data;
                
-               DEBUG_1("Notify func calling: %p %s", nd, fd->path);
                nd->func(fd, type, nd->data);
                work = work->next;
                }
index 242ddd6..ac7d8e8 100644 (file)
@@ -383,6 +383,7 @@ void histogram_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        if ((type & (NOTIFY_CHANGE | NOTIFY_REREAD)) && fd->histmap)
                {
+               DEBUG_1("Notify histogram: %s %04x", fd->path, type);
                histmap_free(fd->histmap);
                fd->histmap = NULL;
                }
index 801bf2c..ff92bb3 100644 (file)
@@ -163,7 +163,7 @@ static void image_loader_finalize(GObject *object)
 
        while (g_source_remove_by_user_data(il)) 
                {
-               DEBUG_1("pending signals detected");
+               DEBUG_2("pending signals detected");
                }
        
        while (il->area_param_list) 
index bea3c3f..06eafce 100644 (file)
@@ -970,6 +970,7 @@ static void image_osd_notify_cb(FileData *fd, NotifyType type, gpointer data)
 
        if ((type & (NOTIFY_HISTMAP)) && osd->imd && fd == osd->imd->image_fd)
                {
+               DEBUG_1("Notify osd: %s %04x", fd->path, type);
                osd->notify |= type;
                image_osd_update_schedule(osd, FALSE);
                }
index d84988c..3adb697 100644 (file)
@@ -528,7 +528,7 @@ static gint image_cache_get(ImageWindow *imd)
                image_change_pixbuf(imd, imd->image_fd->pixbuf, image_zoom_get(imd), FALSE);
                }
        
-       file_cache_dump(image_get_cache());
+//     file_cache_dump(image_get_cache());
        return success;
 }
 
@@ -1394,6 +1394,7 @@ static void image_notify_cb(FileData *fd, NotifyType type, gpointer data)
 
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE)) && fd == imd->image_fd)
                {
+               DEBUG_1("Notify image: %s %04x", fd->path, type);
                image_reload(imd);
                }
 }
index bba5f30..75fa74d 100644 (file)
@@ -1704,6 +1704,8 @@ static void view_window_notify_cb(FileData *fd, NotifyType type, gpointer data)
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
        
+       DEBUG_1("Notify view_window: %s %04x", fd->path, type);
+
        switch (fd->change->type)
                {
                case FILEDATA_CHANGE_MOVE:
index 9922dc8..7c9110c 100644 (file)
@@ -1894,6 +1894,8 @@ void layout_image_notify_cb(FileData *fd, NotifyType type, gpointer data)
        LayoutWindow *lw = data;
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+       DEBUG_1("Notify layout_image: %s %04x", fd->path, type);
        
        switch (fd->change->type)
                {
index 69b4fd7..1e457c9 100644 (file)
@@ -2946,6 +2946,8 @@ static void search_notify_cb(FileData *fd, NotifyType type, gpointer data)
        SearchData *sd = data;
 
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+       DEBUG_1("Notify search: %s %04x", fd->path, type);
        
        switch (fd->change->type)
                {
index 9d177f8..cc3bb5c 100644 (file)
@@ -536,6 +536,7 @@ void thumb_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE)) && fd->thumb_pixbuf)
                {
+               DEBUG_1("Notify thumb: %s %04x", fd->path, type);
                g_object_unref(fd->thumb_pixbuf);
                fd->thumb_pixbuf = NULL;
                }
index 1fd3611..331e0c3 100644 (file)
@@ -1027,6 +1027,8 @@ static void vd_notify_cb(FileData *fd, NotifyType type, gpointer data)
 
        if (!S_ISDIR(fd->mode)) return; /* this gives correct results even on recently deleted files/directories */
 
+       DEBUG_1("Notify vd: %s %04x", fd->path, type);
+
        base = remove_level_from_path(fd->path);
 
        if (vd->type == DIRVIEW_LIST)
index 0d345d9..b653bfc 100644 (file)
@@ -872,6 +872,7 @@ void vf_notify_cb(FileData *fd, NotifyType type, gpointer data)
        
        if (refresh)
                {
+               DEBUG_1("Notify vf: %s %04x", fd->path, type);
                vf_refresh_idle(vf);
                }
 }