[Digikam-devel] [Bug 136927] Failed to download file DCP_4321.jpg. Do you want to continue? and when continue is clicked the same warning comes for the next image and so on. tnx.

Gilles Caulier caulier.gilles at gmail.com
Tue Sep 4 10:00:23 BST 2007


------- 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=136927         




------- Additional Comments From caulier.gilles gmail com  2007-09-04 11:00 -------
SVN commit 708234 by cgilles:

digiKam from KDE3 branch : Camera GUI : do not force to upper case sub album creation in all
case to support file systems which do not take a care about that (like dumy FAT32 for ex.)
CCBUGS: 136927


 M  +13 -17    cameraui.cpp  
 M  +1 -1      cameraui.h  


--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraui.cpp #708233:708234
 @ -24,15 +24,6  @
 
 #define CAMERA_INFO_MENU_ID 255
 
-// C Ansi includes.
-
-extern "C"
-{
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-}
-
 // Qt includes.
 
 #include <qvgroupbox.h>
 @ -1230,7 +1221,9  @
                     dirName = dateTime.date().toString(Qt::ISODate);
                     break;
             }
-
+            // See B.K.O #136927 : we need to support file system which do not
+            // handle upper case properly.
+            dirName = dirName.lower();
             if (!createAutoAlbum(url, dirName, dateTime.date(), errMsg))
             {
                 KMessageBox::error(this, errMsg);
 @ -1259,6 +1252,9  @
                 fi.extension(false).upper() == QString("MPO"))
                 subAlbum = QString("MPG");
 
+            // See B.K.O #136927 : we need to support file system which do not
+            // handle upper case properly.
+            subAlbum = subAlbum.lower();
             if (!createAutoAlbum(u, subAlbum, dateTime.date(), errMsg))
             {
                 KMessageBox::error(this, errMsg);
 @ -1616,23 +1612,23  @
         d->rightSidebar->slotNoCurrentItem();
 }
 
-bool CameraUI::createAutoAlbum(const KURL& parentURL, const QString& name,
+bool CameraUI::createAutoAlbum(const KURL& parentURL, const QString& sub,
                                const QDate& date, QString& errMsg)
 {
     KURL u(parentURL);
-    u.addPath(name);
+    u.addPath(sub);
 
     // first stat to see if the album exists
-    struct stat buf;
-    if (::stat(QFile::encodeName(u.path()), &buf) == 0)
+    QFileInfo info(u.path());
+    if (info.exists())
     {
         // now check if its really a directory
-        if (S_ISDIR(buf.st_mode))
+        if (info.isDir())
             return true;
         else
         {
             errMsg = i18n("A file with same name (%1) exists in folder %2")
-                     .arg(name)
+                     .arg(sub)
                      .arg(parentURL.path());
             return false;
         }
 @ -1649,7 +1645,7  @
         return false;
     }
 
-    return aman->createPAlbum(parent, name, QString(""), date, QString(""), errMsg);
+    return aman->createPAlbum(parent, sub, QString(""), date, QString(""), errMsg);
 }
 
 void CameraUI::addFileExtension(const QString& ext)
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraui.h #708233:708234
 @ -88,7 +88,7  @
     void readSettings();
     void saveSettings();
     bool dialogClosed();
-    bool createAutoAlbum(const KURL& parentURL, const QString& name,
+    bool createAutoAlbum(const KURL& parentURL, const QString& sub,
                          const QDate& date, QString& errMsg);
     void addFileExtension(const QString& ext);
     void finishDialog();



More information about the Digikam-devel mailing list