[Digikam-devel] extragear/graphics/digikam/digikam
Gilles Caulier
caulier.gilles at free.fr
Wed Apr 26 17:41:19 BST 2006
SVN commit 534226 by cgilles:
digikam from trunk : bugfix about batch tagging image :
- Using tags settings not Rating settings to set tags in IPTC keywords.
- Storing tag paths not tag names in IPTC keywords.
CCMAIL: digikam-devel at kde.org
M +20 -6 albumiconview.cpp
--- trunk/extragear/graphics/digikam/digikam/albumiconview.cpp #534225:534226
@@ -1690,17 +1690,24 @@
{
AlbumIconItem *albumItem = static_cast<AlbumIconItem *>(it);
ImageInfo* info = albumItem->imageInfo();
- QStringList oldKeywords = info->tagNames();
+ QStringList oldKeywords = info->tagPaths();
+ for (QStringList::iterator it = oldKeywords.begin(); it != oldKeywords.end(); ++it)
+ (*it).remove(0, 1);
+
info->setTag(tagID);
// Store Image Tags like Iptc keywords tag.
if (AlbumSettings::instance())
{
- if (AlbumSettings::instance()->getSaveIptcRating())
+ if (AlbumSettings::instance()->getSaveIptcTags())
{
+ QStringList tagPaths = info->tagPaths();
+ for (QStringList::iterator it = tagPaths.begin(); it != tagPaths.end(); ++it)
+ (*it).remove(0, 1);
+
DMetadata metadata(info->filePath());
- metadata.setImageKeywords(oldKeywords, info->tagNames());
+ metadata.setImageKeywords(oldKeywords, tagPaths);
metadata.applyChanges();
}
}
@@ -1718,17 +1725,24 @@
{
AlbumIconItem *albumItem = static_cast<AlbumIconItem *>(it);
ImageInfo* info = albumItem->imageInfo();
- QStringList oldKeywords = info->tagNames();
+ QStringList oldKeywords = info->tagPaths();
+ for (QStringList::iterator it = oldKeywords.begin(); it != oldKeywords.end(); ++it)
+ (*it).remove(0, 1);
+
info->removeTag(tagID);
// Update Image Tags like Iptc keywords tags.
if (AlbumSettings::instance())
{
- if (AlbumSettings::instance()->getSaveIptcRating())
+ if (AlbumSettings::instance()->getSaveIptcTags())
{
+ QStringList tagPaths = info->tagPaths();
+ for (QStringList::iterator it = tagPaths.begin(); it != tagPaths.end(); ++it)
+ (*it).remove(0, 1);
+
DMetadata metadata(info->filePath());
- metadata.setImageKeywords(oldKeywords, info->tagNames());
+ metadata.setImageKeywords(oldKeywords, tagPaths);
metadata.applyChanges();
}
}
More information about the Digikam-devel
mailing list