[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-10-31 20:52:25
Message-ID: 1162327945.400429.14189.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 600788 by cgilles:

new method to check if a file is read only with Exiv2


 M  +12 -0     exiv2iface.cpp  
 M  +1 -0      exiv2iface.h  


--- trunk/extragear/libs/kipi-plugins/common/exiv2iface/exiv2iface.cpp #600787:600788
@@ -39,6 +39,7 @@
 #include <qimage.h>
 #include <qsize.h>
 #include <qtextcodec.h>
+#include <qfileinfo.h>
 
 // KDE includes.
 
@@ -313,6 +314,17 @@
     }
 }
 
+bool Exiv2Iface::isReadOnly(const QString& filePath)
+{
+    QFileInfo fi(filePath);
+    QString ext = fi.extension(false).upper();
+    
+    if (ext != QString("JPG") && ext != QString("JPEG") && ext != QString("JPE"))
+        return true;
+
+    return false;
+}
+
 bool Exiv2Iface::setImageProgramId(const QString& program, const QString& version)
 {
     try
--- trunk/extragear/libs/kipi-plugins/common/exiv2iface/exiv2iface.h #600787:600788
@@ -120,6 +120,7 @@
     Exiv2Iface::ImageOrientation getImageOrientation();
     QDateTime getImageDateTime() const;
 
+    static bool isReadOnly(const QString& filePath);
     static QString convertCommentValue(const Exiv2::Exifdatum &comment);
     static QString detectEncodingAndDecode(const std::string &value);
     static void convertToRational(double number, long int* numerator, 
[prev in list] [next in list] [prev in thread] [next in thread] 

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