[KPhotoAlbum] Associating multiple tags with one area?

Tobias Leupold tobias.leupold at web.de
Sun Oct 5 21:09:00 BST 2014


> The context-menu on an area would only need minor rephrasing:
> 1. Add [last added tag] to area
> 2. Add tag to area -> [Submenu with not-associated tags]
> 3. Remove tag from area -> [Submenu with associated tags]
> 4. Remove area from image
You're right. We know the selected tags and we also know the associated 
tag(s), so we can simply continue to show the "Add tag to area" context menu 
entry. If only one tag is associated, we can simply display a "Remove tag from 
area" entry, when there are multiple tags, we need a sub-menu. But I don't see 
a workflow problem with this; essentially, everything continues to be as-is. 
Perhaps, a "Remove all tags" entry would also be meaningful then.

> The replace operation should be a seldomly used one, and isn't currently
> implemented, either. Thus, the workflow "add new tag, then remove old tag"
> should work sufficiently enough.
Right.

> Database-wise, I don't really know how much this will affect efficient
> handling of areas. As Hugues suggested, the easiest way to implement
> multiple tags per area would be to store duplicate areas in the database,
> and deal with them in the UI code.
I think it actually would be no problem to simply add multiple tags with the 
same coordinates. We won't get collisions, even better: the "raw" coordinates 
string is the ID we need to know if we have different areas or some tags 
belong to the same one.

> I'm not sure about stacking areas. It seems to add more complexity for
> little gain.
I would load all positioned tags along with their "ID", the raw coordinates 
string. This way, we don't need to stack multiple areas. We can simply create 
a new area if we have none with these coordinates or add the tag to an 
existing one. A QMap<QString, *ResizableFrame> with all areas would be all we 
need. If the coordinate string exists, we get the pointer to the area that has 
to take the additional tag. If not, we create a new area and add it to the 
map.

> > I've got a copy of the git repo now, so I'll be taking a look at the
> > relevant code sometime later. Hopefully I'll be able to at least try some
> > of these, and see for sure if they would actually work.
Let us know where to get your code :-)

After all, it does not seem to be too hard ...



More information about the Kphotoalbum mailing list