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

List:       kde-commits
Subject:    extragear/libs/kipi-plugins/common/exiv2iface
From:       Gilles Caulier <caulier.gilles () free ! fr>
Date:       2006-12-07 12:33:52
Message-ID: 1165494832.619047.31964.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 611248 by cgilles:

kipi-plugins from trunk : Don't touch read-only file when metadata need to be updated.
CCBUG: 137770

 M  +11 -3     exiv2iface.cpp  


--- trunk/extragear/libs/kipi-plugins/common/exiv2iface/exiv2iface.cpp #611247:611248
@@ -279,11 +279,19 @@
 
 bool Exiv2Iface::save(const QString& filePath)
 {
+    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())
+    {
+        kdDebug() << "File '" << info.fileName() << "' is read-only. Metadata not saved." << endl;
+        return false;
+    }
+
     try
     {    
-        if (filePath.isEmpty())
-            return false;
-
         Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
                                       (QFile::encodeName(filePath)));
         
[prev in list] [next in list] [prev in thread] [next in thread] 

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