Some program (e.g., Shotwell) puts categories as tags into each photo,
because apparently they have hierarchical tags and they don't have
a concept of separate categories which are not tags.
Fixes #219
Signed-off-by: Matěj Cepl <
mc...@redhat.com>
---
jbrout/jbrout/winshow.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/jbrout/jbrout/winshow.py b/jbrout/jbrout/winshow.py
index ae43f2d..9ac15f1 100755
--- a/jbrout/jbrout/winshow.py
+++ b/jbrout/jbrout/winshow.py
@@ -31,6 +31,7 @@ class TagList(gtk.VBox):
#self.b.set_label("Test bouton")
gtk.VBox.__init__(self)
self.__callbackRemove = callbackRemove
+ # getAllTags returns list of tuples (tag, parent catg)
self.__tags = dict(JBrout.tags.getAllTags())
def fill(self, ll):
@@ -40,12 +41,17 @@ class TagList(gtk.VBox):
def __refresh(self):
l = self.get_children()
+ valid_tags = self.__tags.keys()
+
for a in l:
a.destroy()
del a
for i in self.__ll:
-
+ # we should filter out Categories ... some other programs, e.g.
+ # Shotwell, add these among Tags of the photo
+ if i not in valid_tags:
+ continue
hb = gtk.HBox()
lbl = gtk.Label()
lbl.set_label("%s (%s)" % (i, self.__tags[i]))
--
1.8.4.rc4