[Digikam-devel] [Bug 152424] Workflow organizing : use Color Label Tags over icon view items

Marcel Wiesweg marcel.wiesweg at gmx.de
Thu Jan 27 13:07:30 GMT 2011


https://bugs.kde.org/show_bug.cgi?id=152424





--- Comment #37 from Marcel Wiesweg <marcel wiesweg gmx de>  2011-01-27 14:07:28 ---
Yes, something like this must be done.
If you want the tags to be hidden and only visible through specific GUI, define
the names in InternalTagName, and use getOrCreateInternalTag().
These calls must then be done at application startup.

If you want the tags to be publicly visible, the first approach would be to add
the common Color parent tag and the color tag's names to databaseconstants.h,
for example in a class ColorTagName, and call TagsCache's getOrCreateTags where
you need them.
There is a problem now: The tag names must be i18n'ed if they are visible. If
the system language changes, suddenly they cannot be found anymore.
So there is a better approach for this case: Create the tag with a property.
The property is the color, in English, and never changes. The user can rename
the tag, it is still identified.

To find the tags:
TagsCache::instance()->tagsWithProperty(TagPropertyName::colorTag()); // gets
all color tags. Can also request a specific value.
To create tags: 
TagsCache::instance()->getOrCreateTagWithProperty(colorTagsParentPath +
i18n("Red"), TagPropertyName::colorTag(), TagPropertyValue::redColor());

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list