GNOME Bugzilla – Bug 583833
Tags not updated in display
Last modified: 2009-05-30 12:03:06 UTC
Please describe the problem: Hello, Tags are not updated in Gthumb display if you edit multiple files. Steps to reproduce: 1. Select more than one image 2. Change the tags of these images Actual results: Tags are updated in the files but only the display of one image is updated. Expected results: The display of all images should be updated. Does this happen every time? Yes Other information:
Created attachment 135342 [details] [review] Fix display on multiple edition of tags This patch fixes the described bug by using gth-monitor. It also improves gth-monitor using a singleton in gth-monitor.c. I have used this to remove the dependency from main.c/h on gth-monitor.
Created attachment 135344 [details] [review] Avoid useless read of tags/comment This additional patch fixe a less visible bug: Each time you select a file, comments/tags are read in xml file and in metadata. With this patch they are read only once and kept in FileData structure.
Created attachment 135345 [details] [review] Avoid useless read of tags/comments event if tags/comments are empty This third patch improves the second one to avoid useless read of tags/comments event if tags/comments are empty.
Marc, I've committed the patches, but I still think there's a bug lurking somewhere. If I select 4 images and tag them, sometimes only the last image is updated in the browser view. I have to hit Ctrl+R to refresh the view and show the tags under all of the affected thumbnails. On a separate note: Is there something in the build files that prevents the unused-function detection in "cppcheck -q -a -f -j2 --style --unused-functions ." from working properly? - Mike
Tags are always updated when I try to update them. Can you try to identify in which case you have this bug? I don't really know cppcheck but the project site says that --unused-functions can be used to detect "Unused private function 'classname::funcname'". Are you sure that it can work in C too? Anyway gcc should give a warning for unused static methods defined in .c files but it cannot detect unused methods defined in .h files for libgthumb. (I guess linker could detect it for files in src/) Marc
Should the update metadata calls (like gth_window_update_current_image_metadata in src/dlg-tags.c) be wrapped with gth_monitor_pause/gth_monitor_resume? Maybe a race with the gfile monitor is occurring. Also, here's a repeatable bug: 1) Select four images with no tags. 2) Click the tags button and apply a tag (say "GNOME") to all four. Click OK to close the dialog. 3) Click the tags button again and de-select this tag on all four. Click OK to close the dialog. 4) Click the tags button a third time. The dialog will show the tag as being enabled - it shouldn't be. - Mike
Created attachment 135467 [details] [review] Fix removal of last tag Thanks for the bug description. The problem is in gth-exiv2-utils.cpp: It was impossible to remove the last Tag of a file. This patch should fix it. Marc
Thanks, that fixes it. Committed. I still see non-repeatable monitor issues. I will have to investigate further. - Mike
I believe that the monitor issues have been fixed now, by removing the path and name fields from the FileData struct, and using only utf8_path and utf8_name now. - Mike
I spoke too soon. Sigh. More debugging... - Mike
I think it is fixed now. - Mike