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

List:       kde-commits
Subject:    koffice/krita/ui/kisexiv2
From:       Cyrille Berger <cyb () lepi ! org>
Date:       2009-01-19 20:21:17
Message-ID: 1232396477.965967.18093.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 913750 by berger:

check wether the prefix of a namespace is know to Exiv2 before using it

 M  +1 -1      kis_exiv2.cpp  
 M  +12 -2     kis_xmp_io.cpp  


--- trunk/koffice/krita/ui/kisexiv2/kis_exiv2.cpp #913749:913750
@@ -225,7 +225,7 @@
                 case QVariant::String:
                     return new Exiv2::StringValue(qPrintable(var.toString()));
                 default:
-                    qFatal("Unhandled type.");
+                    qFatal("Unhandled type. " + var.type() );
                     return 0;
             }
         }
--- trunk/koffice/krita/ui/kisexiv2/kis_xmp_io.cpp #913749:913750
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2008 Cyrille Berger <cberger@cberger.net>
+ *  Copyright (c) 2008-2009 Cyrille Berger <cberger@cberger.net>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU Lesser General Public License as published by
@@ -46,7 +46,17 @@
             it != store->end(); ++it)
     {
         const KisMetaData::Entry& entry = *it;
-//         xmpData_.add( Exiv2::XmpKey( entry.schema()->uri().ascii(), \
entry.name().ascii() ), kmdValueToExivValue( entry.value() ) ); +        
+        // Check wether the prefix and namespace are know to exiv2
+        std::string prefix = \
Exiv2::XmpProperties::prefix(entry.schema()->uri().ascii()); +        if( prefix == \
"") +        {
+            dbgFile << "Unknown namespace " << ppVar(entry.schema()->uri()) << \
ppVar(entry.schema()->prefix()); +            prefix = \
entry.schema()->prefix().ascii(); +            \
Exiv2::XmpProperties::registerNs(entry.schema()->uri().ascii(), prefix ); +        }
+        dbgFile << "Saving " << entry;
+        xmpData_.add(Exiv2::XmpKey(prefix, entry.name().ascii()), \
kmdValueToExivValue(entry.value()));  }
     // Serialize data
     std::string xmpPacket_;


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

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