[Digikam-devel] [Bug 138540] Pictures files are updated (but not modified) when setting new metadatas albeit they are unset

Gilles Caulier caulier.gilles at kdemail.net
Tue Dec 12 14:39:03 GMT 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=138540         




------- Additional Comments From caulier.gilles kdemail net  2006-12-12 15:39 -------
SVN commit 612755 by cgilles:

kipi-plugins from trunk : if file dir-path is read-only, do not try to save metadata on pictures.
CCBUGS: 138540

 M  +10 -4     exiv2iface.cpp  


--- trunk/extragear/libs/kipi-plugins/common/exiv2iface/exiv2iface.cpp #612754:612755
 @ -282,13 +282,19  @
     if (filePath.isEmpty())
         return false;
 
-    // NOTE: see B.K.O #137770 : never touch the file if is read only.
-    QFileInfo info(filePath); 
-    if (!info.isWritable())
+    // NOTE: see B.K.O #137770 & #138540 : never touch the file if is read only.
+    QFileInfo finfo(filePath); 
+    QFileInfo dinfo(finfo.dirPath()); 
+    if (!finfo.isWritable())
     {
-        kdDebug() << "File '" << info.fileName() << "' is read-only. Metadata not saved." << endl;
+        kdDebug() << "File '" << finfo.fileName() << "' is read-only. Metadata not saved." << endl;
         return false;
     }
+    if (!dinfo.isWritable())
+    {
+        kdDebug() << "Dir '" << dinfo.filePath() << "' is read-only. Metadata not saved." << endl;
+        return false;
+    }
 
     try
     {



More information about the Digikam-devel mailing list