[Digikam-devel] extragear/graphics/digikam/libs/widgets/metadata

Gilles Caulier caulier.gilles at free.fr
Thu Apr 6 13:22:18 BST 2006


SVN commit 526980 by cgilles:

digikam from trunk : Some IPTC tags like "Keywords" can be redontant. display these values like ExifTool, separated by a comma.

CCMAIL: digikam-devel at kde.org

 M  +14 -3     iptcwidget.cpp  


--- trunk/extragear/graphics/digikam/libs/widgets/metadata/iptcwidget.cpp #526979:526980
@@ -60,7 +60,7 @@
      "Copyright",
      "Program",
      "Keywords",
-     "FixtureId",
+     "Urgency",
      "-1"
 };
 
@@ -125,13 +125,24 @@
         for (Exiv2::IptcData::iterator md = iptcData.begin(); md != iptcData.end(); ++md)
         {
             QString key = QString::fromLocal8Bit(md->key().c_str());
-
+            
             // Decode the tag value with a user friendly output.
             std::ostringstream os;
             os << *md;
             QString value = QString::fromLocal8Bit(os.str().c_str());
 
-            metaDataMap.insert(key, value);
+            // Some IPTC key are redondancy. check if already one exist...
+            MetaDataMap::iterator it = metaDataMap.find(key);
+            
+            if (it == metaDataMap.end())
+                metaDataMap.insert(key, value);
+            else
+            {
+                QString v = *it;
+                v.append(", ");
+                v.append(value);
+                metaDataMap.replace(key, v);
+            }                
         }
 
         // Update all metadata contents.        



More information about the Digikam-devel mailing list