[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/krita/image/metadata
From:       Cyrille Berger <cyb () lepi ! org>
Date:       2009-04-04 12:46:13
Message-ID: 1238849173.678500.13143.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 949052 by berger:

fix merging creating entries while they didn't exists in the two layers


 M  +10 -2     kis_meta_data_merge_strategy_p.cc  
 M  +1 -0      schemas/dc.schema  


--- trunk/koffice/krita/image/metadata/kis_meta_data_merge_strategy_p.cc \
#949051:949052 @@ -224,11 +224,19 @@
 
 void SmartMergeStrategy::mergeEntry(Store* dst, QList<const Store*> srcs, const \
KisMetaData::Schema* schema, const QString & identifier) const  {
+    bool foundOnce = false;
     Value v(QList<Value>(), Value::OrderedArray);
     foreach(const Store* store, srcs) {
-        v += store->getEntry(schema, identifier).value();
+        if( store->containsEntry(schema, identifier) )
+        {
+          v += store->getEntry(schema, identifier).value();
+          foundOnce = true;
+        }
     }
-    dst->getEntry(schema, identifier).value() = v;
+    if( foundOnce )
+    {
+        dst->getEntry(schema, identifier).value() = v;
+    }
 }
 
 void SmartMergeStrategy::merge(Store* dst, QList<const Store*> srcs, QList<double> \
                scores) const
--- trunk/koffice/krita/image/metadata/schemas/dc.schema #949051:949052
@@ -14,6 +14,7 @@
     <bag name="relation" type="text" />
     <lang name="rights" />
     <text name="source" />
+    <bag name="subject" type="text" />
     <lang name="title" />
     <bag name="type">
       <openedchoice type="text" />


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic