After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 583833 - Tags not updated in display
Tags not updated in display
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks: 583464
 
 
Reported: 2009-05-25 20:10 UTC by Marc Pavot
Modified: 2009-05-30 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix display on multiple edition of tags (92.27 KB, patch)
2009-05-25 20:12 UTC, Marc Pavot
committed Details | Review
Avoid useless read of tags/comment (8.31 KB, patch)
2009-05-25 20:15 UTC, Marc Pavot
committed Details | Review
Avoid useless read of tags/comments event if tags/comments are empty (1.01 KB, patch)
2009-05-25 20:16 UTC, Marc Pavot
committed Details | Review
Fix removal of last tag (1.13 KB, patch)
2009-05-27 21:15 UTC, Marc Pavot
committed Details | Review

Description Marc Pavot 2009-05-25 20:10:40 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:
Comment 1 Marc Pavot 2009-05-25 20:12:50 UTC
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.
Comment 2 Marc Pavot 2009-05-25 20:15:09 UTC
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.
Comment 3 Marc Pavot 2009-05-25 20:16:06 UTC
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.
Comment 4 Michael Chudobiak 2009-05-26 13:06:33 UTC
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
Comment 5 Marc Pavot 2009-05-27 19:22:41 UTC
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
Comment 6 Michael Chudobiak 2009-05-27 19:46:56 UTC
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
Comment 7 Marc Pavot 2009-05-27 21:15:05 UTC
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
Comment 8 Michael Chudobiak 2009-05-28 12:01:34 UTC
Thanks, that fixes it. Committed.

I still see non-repeatable monitor issues. I will have to investigate further.

- Mike
Comment 9 Michael Chudobiak 2009-05-29 19:47:32 UTC
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
Comment 10 Michael Chudobiak 2009-05-29 19:49:42 UTC
I spoke too soon. Sigh. More debugging...

- Mike
Comment 11 Michael Chudobiak 2009-05-30 12:03:06 UTC
I think it is fixed now. 

- Mike