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.
Summary: Failed to download file DCP_4321.jpg. Do you want to continue? and when conti...
Status: CLOSED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Import-Gphoto2 (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-06 04:29 UTC by ron
Modified: 2017-08-16 06:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ron 2006-11-06 04:29:47 UTC
Version:           0.8.2-rc1 (using KDE 3.5.3, Kubuntu Package 4:3.5.3-0ubuntu0.1 dapper)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-26-386

hello, i am running different versions of digikam on different machines under different versions of mepis (3.3  3.4  6.0) and kubuntu (6.06).they all have the same thing in common: they will not download the pictures to my hard drive in the folder created with/by the program: /home/ron/Pictures/2006, November, 5. it does show thumbnails though.

warning message from digikam:
Failed to download file DCP_4321.jpg. Do you want to continue?

the latest version of digikam that i use is 0.8.2. i can't find the solution in other threads. there was one thread with a similar question (with an olympus camera xl 800, i think, forgot the thread number) but the questioner did not respond anymore so it was a dead end for me.

thanks
ron
Comment 1 Marcel Wiesweg 2006-11-06 18:19:54 UTC
What camera do you have? Does it work in USB mass storage mode (can be mounted just like a USB stick) or does it require libgphoto2?

I recommend you to test 0.9.0-beta3. There is a chance your problem is already solved, and if it still exists we will try to solve it, but expect no bug fixes for the 0.8 series.
Comment 2 ron 2006-11-08 05:45:54 UTC
thanks for your reply,

I will expect no bugfixes, i am very happy with all things linux and take things the way they come but I would like to say this (don't know if it's helpful) but yesterday I started kubuntu edgy eft in live mode and i gave digikam a try and it worked (be it all in a virtual ramdisk, but anyway) and i think that was the 0.8.2 version aswell. 

when i clicked on the camera icon i was able to actually browse the contents of it, this is still in kubuntu edgy live, but when i do the same on one of the other linux's that i have installed on hd it will not let me do this. 

i will check to see if libgphoto2 is installed on any of the systems and if not i will install it and see how it goes then.

regards
ronald brouwer
Comment 3 ron 2006-11-08 05:51:33 UTC
sorry forgot to tell you which camera i use, it is a kodak DX3500 and is autodetected no problems, it also appears in the (long) list of supported camera's.

regards
ronald brouwer
Comment 4 Marcel Wiesweg 2006-11-09 16:46:03 UTC
It's a PTP camera, you need libgphoto2 for this. Check if you have the latest gphoto2 version installed, and you can test it using the "gphoto2" command line utility.

Btw: You can very well expect bug fixes, as your right as a user of a well-maintained application ;-) but focus is on the 0.9 series, so only for this.
Comment 5 Mikolaj Machowski 2007-08-31 00:56:26 UTC
Old bug, old software versions, didn't come across this behaviour myself. OK to close?
Comment 6 caulier.gilles 2007-08-31 06:15:54 UTC
Mik, 

Not sure. I will try to reproduce here before

Gilles
Comment 7 caulier.gilles 2007-08-31 07:46:33 UTC
Ron,

The only condition to reproduce this message is in case of your album library path is full. There is no test is Camera interface to check if pictures selection to download from camera is bigger than the space available in digiKam repository.

It's your case ?

Gilles Caulier
Comment 8 Paweł Marciniak 2007-08-31 12:57:10 UTC
Just for the record:
I get similar problem ("failed to download" & "do you want to continue?" for each photo) when I download images into sub-albums based on file extension.

In my case the problem is that I store my images on a FAT partition. DigiKam first creates the subdirectory with ::mkdir("[...]/PNG", 0777) and then tries to download images to that subdirectory, but the directory actually created by mkdir(2) is "png" (lowercase). In this particular case the problem comes probably from wrong mount options (case sensitiveness) and is not DigiKam's fault, but just to let you know that full disk is not the only possible reason :)

Best,
Pawel
Comment 9 caulier.gilles 2007-08-31 13:01:53 UTC
Thanks for the report Pawel,

Note : i currently finalize a version of Camera GUI which check the space available from Album Library Path before to download. Estimated free space requires is computed, especially to auto-rotate and convert JPEG

Gilles
Comment 10 caulier.gilles 2007-08-31 16:48:03 UTC
SVN commit 706910 by cgilles:

digiKam from KDE3 branch : Camera GUI improvements.
- Add a new bargraph to report free space available on Album library path before and after to download pictures from camera.
- If free space available is not enough, display a error message if user try to download.
CCBUGS: 139519
CCBUGS: 136927


 M  +1 -1      Makefile.am  
 M  +39 -1     cameraiconview.cpp  
 M  +2 -0      cameraiconview.h  
 M  +59 -23    cameraui.cpp  
 M  +3 -1      cameraui.h  
 A             freespacewidget.cpp   [License: GPL]
 A             freespacewidget.h   [License: GPL]


--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/Makefile.am #706909:706910
@@ -11,7 +11,7 @@
 	                  animwidget.cpp renamecustomizer.cpp  \
 	                  dkcamera.cpp umscamera.cpp gpiteminfo.cpp \
 	                  camerainfodialog.cpp albumselectdialog.cpp \
-	                  camerafolderdialog.cpp  
+	                  camerafolderdialog.cpp freespacewidget.cpp 
 
 libcameragui_la_LDFLAGS = $(all_libraries) $(KDE_RPATH)
 
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraiconview.cpp #706909:706910
@@ -709,5 +709,43 @@
     return downloaded;
 }
 
+void CameraIconView::itemsSelectionSizeInfo(unsigned long& fSize, unsigned long& dSize)
+{
+    fSize = 0;  // Files size
+    dSize = 0;  // Estimated space requires to download and process files.
+    for (IconItem* item = firstItem(); item; item = item->nextItem())
+    {
+        if (item->isSelected())
+        {
+            CameraIconViewItem* iconItem = static_cast<CameraIconViewItem*>(item);
+            fSize += iconItem->itemInfo()->size;
+            
+            if (iconItem->itemInfo()->mime == QString("image/jpeg"))
+            {
+                if (d->cameraUI->convertLosslessJpegFiles())
+                {
+                    // Estimated size is aroud 5 x original size when JPEG=>PNG.
+                    dSize += iconItem->itemInfo()->size*5;
+                }
+                else if (d->cameraUI->autoRotateJpegFiles())
+                {
+                    // We need a double size to perform rotation.
+                    dSize += iconItem->itemInfo()->size*2;
+                }
+                else
+                {
+                    // Real file size is added.
+                    dSize += iconItem->itemInfo()->size;
+                }
+            }
+            else
+                dSize += iconItem->itemInfo()->size;
+
+        }
+    }
+    
+    fSize /= 1024;
+    dSize /= 1024;
+}
+
 }  // namespace Digikam
-
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraiconview.h #706909:706910
@@ -84,6 +84,8 @@
     virtual QRect itemRect() const;
 
     QString defaultDownloadName(CameraIconViewItem *item);
+
+    void itemsSelectionSizeInfo(unsigned long& fSize, unsigned long& dSize);
     
 signals:
 
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraui.cpp #706909:706910
@@ -102,6 +102,7 @@
 #include "albumselectdialog.h"
 #include "renamecustomizer.h"
 #include "animwidget.h"
+#include "freespacewidget.h"
 #include "camerafolderdialog.h"
 #include "camerainfodialog.h"
 #include "cameraiconview.h"
@@ -219,6 +220,8 @@
     AnimWidget                   *anim;
 
     ImagePropertiesSideBarCamGui *rightSidebar;
+
+    FreeSpaceWidget              *freeSpaceWidget;
 };
 
 CameraUI::CameraUI(QWidget* /*parent*/, const QString& cameraTitle, 
@@ -233,19 +236,13 @@
                       i18n("&Images"))
 {
     d = new CameraUIPriv;
-    d->lastAccess  = lastAccess;
-    d->cameraTitle = cameraTitle;
+    d->lastAccess     = lastAccess;
+    d->cameraTitle    = cameraTitle;
     setHelp("camerainterface.anchor", "digikam");
 
     // -------------------------------------------------------------------------
     
-    QGridLayout* viewBoxLayout = new QGridLayout(plainPage(), 2, 5);
-    viewBoxLayout->setColStretch( 0, 0 );
-    viewBoxLayout->setColStretch( 1, 0 );
-    viewBoxLayout->setColStretch( 2, 3 );
-    viewBoxLayout->setColStretch( 3, 1 );
-    viewBoxLayout->setColStretch( 4, 0 );
-    viewBoxLayout->setColStretch( 5, 0 );
+    QGridLayout* viewBoxLayout = new QGridLayout(plainPage(), 2, 7);
 
     QHBox* widget = new QHBox(plainPage());
     d->splitter   = new QSplitter(widget);
@@ -352,11 +349,6 @@
                           i18n("On the Fly Operations (JPEG only)"));
                                                
     d->rightSidebar->appendTab(d->advBox, SmallIcon("configure"), i18n("Settings"));
-    
-    // -------------------------------------------------------------------------
-    
-    viewBoxLayout->addMultiCellWidget(widget, 0, 0, 0, 5);
-    viewBoxLayout->setRowSpacing(1, spacingHint());
     d->rightSidebar->loadViewState();
         
     // -------------------------------------------------------------------------
@@ -384,20 +376,35 @@
     QString directory = KGlobal::dirs()->findResourceDir("logo-digikam", "logo-digikam.png");
     pixmapLogo->setPixmap( QPixmap( directory + "logo-digikam.png" ) );
     pixmapLogo->setFocusPolicy(QWidget::NoFocus);
-    
+
     d->anim = new AnimWidget(frame, pixmapLogo->height()-2);
-    
+
     layout->setMargin(0);
     layout->setSpacing(0);
     layout->addWidget( pixmapLogo );
     layout->addWidget( d->anim );
 
+    d->freeSpaceWidget = new FreeSpaceWidget(plainPage(), 100,
+                         KURL(AlbumSettings::instance()->getAlbumLibraryPath()));
+
+    viewBoxLayout->addMultiCellWidget(widget, 0, 0, 0, 7);
     viewBoxLayout->addMultiCellWidget(d->cancelBtn, 2, 2, 0, 0);
     viewBoxLayout->addMultiCellWidget(d->status, 2, 2, 2, 2);
     viewBoxLayout->addMultiCellWidget(d->progress, 2, 2, 3, 3);
-    viewBoxLayout->addMultiCellWidget(frame, 2, 2, 5, 5);
+    viewBoxLayout->addMultiCellWidget(d->freeSpaceWidget, 2, 2, 5, 5);
+    viewBoxLayout->addMultiCellWidget(frame, 2, 2, 7, 7);
+    viewBoxLayout->setRowSpacing(1, spacingHint());
     viewBoxLayout->setColSpacing(1, spacingHint());
     viewBoxLayout->setColSpacing(4, spacingHint());
+    viewBoxLayout->setColSpacing(6, spacingHint());
+    viewBoxLayout->setColStretch( 0, 0 );
+    viewBoxLayout->setColStretch( 1, 0 );
+    viewBoxLayout->setColStretch( 2, 3 );
+    viewBoxLayout->setColStretch( 3, 1 );
+    viewBoxLayout->setColStretch( 4, 0 );
+    viewBoxLayout->setColStretch( 5, 0 );
+    viewBoxLayout->setColStretch( 6, 0 );
+    viewBoxLayout->setColStretch( 7, 0 );
 
     // -------------------------------------------------------------------------
     
@@ -512,12 +519,17 @@
     connect(d->rightSidebar, SIGNAL(signalLastItem()),
             this, SLOT(slotLastItem()));                
 
-    // -- Read settings --------------------------------------------------
+    // -------------------------------------------------------------------------
+    
+    connect(d->cancelBtn, SIGNAL(clicked()),
+            this, SLOT(slotCancelButton()));
 
+    // -- Read settings & Check free space availability on album root path -----
+
     readSettings();
+       
+    // -- camera controller ----------------------------------------------------
     
-    // -- camera controller -----------------------------------------------
-    
     d->controller = new CameraController(this, d->cameraTitle, model, port, path);
 
     connect(d->controller, SIGNAL(signalConnected(bool)),
@@ -565,8 +577,7 @@
     connect(d->controller, SIGNAL(signalUploaded(const GPItemInfo&)),
             this, SLOT(slotUploaded(const GPItemInfo&)));
 
-    connect(d->cancelBtn, SIGNAL(clicked()),
-            this, SLOT(slotCancelButton()));
+    // -------------------------------------------------------------------------
 
     d->view->setFocus();
     QTimer::singleShot(0, d->controller, SLOT(slotConnect()));
@@ -650,6 +661,11 @@
     return d->convertJpegCheck->isChecked();
 }
 
+bool CameraUI::autoRotateJpegFiles() const
+{
+    return d->autoRotateCheck->isChecked();
+}
+
 QString CameraUI::losslessFormat()
 {
     return d->losslessFormat->currentText();
@@ -1086,6 +1102,22 @@
     if (!onlySelected)
         d->view->slotSelectAll();
 
+    // See B.K.O #139519: Always check free space available before to
+    // download items selection from camera.
+    unsigned long fSize = 0;
+    unsigned long dSize = 0;
+    d->view->itemsSelectionSizeInfo(fSize, dSize);
+    if (d->freeSpaceWidget->isValid() && (dSize >= d->freeSpaceWidget->kBAvail()))
+    {
+        KMessageBox::error(this, i18n("There is no enough free space on Album Library Path "
+                                      "to download and process selected pictures from camera.\n\n"
+                                      "Estimated space require: %1\n"
+                                      "Available free space: %2")
+                                      .arg(KIO::convertSizeFromKB(dSize))
+                                      .arg(KIO::convertSizeFromKB(d->freeSpaceWidget->kBAvail())));
+        return;
+    }
+
     QString   newDirName;
     IconItem* firstItem = d->view->firstItem();
     if (firstItem)
@@ -1552,6 +1584,11 @@
         d->downloadMenu->setItemEnabled(0, hasSelection);
         d->downloadMenu->setItemEnabled(2, hasSelection);
     }
+
+    unsigned long fSize = 0;
+    unsigned long dSize = 0;
+    d->view->itemsSelectionSizeInfo(fSize, dSize);
+    d->freeSpaceWidget->setEstimatedDSizeKb(dSize);
 }
 
 void CameraUI::slotItemsSelected(CameraIconViewItem* item, bool selected)
@@ -1706,4 +1743,3 @@
 }
 
 }  // namespace Digikam
-
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraui.h #706909:706910
@@ -61,7 +61,9 @@
     bool isBusy() const;
     bool isClosed() const;
 
-    // Get status of JPEG conversion files to lossless format during download.
+    bool autoRotateJpegFiles() const;
+    
+    /** Get status of JPEG conversion files to lossless format during download.*/
     bool convertLosslessJpegFiles() const;
     QString losslessFormat();
 
Comment 11 caulier.gilles 2007-09-01 17:02:44 UTC
SVN commit 707338 by cgilles:

digiKam from trunk (KDE4) : backport commits #706910 from KDE3 branch
BUG: 139519
CCBUGS: 136927


 M  +0 -4      animwidget.cpp  
 M  +39 -0     cameraiconview.cpp  
 M  +2 -0      cameraiconview.h  
 M  +35 -0     cameraui.cpp  
 M  +3 -1      cameraui.h  
 M  +3 -2      cameraui.rc  
 M  +9 -6      freespacewidget.cpp  


--- trunk/extragear/graphics/digikam/utilities/cameragui/animwidget.cpp #707337:707338
@@ -30,10 +30,6 @@
 #include <QColor>
 #include <QTimer>
 
-// KDE includes.
-
-#include <ktoolbar.h>
-
 // Local includes.
 
 #include "animwidget.h"
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.cpp #707337:707338
@@ -721,4 +721,43 @@
     return downloaded;
 }
 
+void CameraIconView::itemsSelectionSizeInfo(unsigned long& fSize, unsigned long& dSize)
+{
+    fSize = 0;  // Files size
+    dSize = 0;  // Estimated space requires to download and process files.
+    for (IconItem* item = firstItem(); item; item = item->nextItem())
+    {
+        if (item->isSelected())
+        {
+            CameraIconViewItem* iconItem = static_cast<CameraIconViewItem*>(item);
+            fSize += iconItem->itemInfo()->size;
+            
+            if (iconItem->itemInfo()->mime == QString("image/jpeg"))
+            {
+                if (d->cameraUI->convertLosslessJpegFiles())
+                {
+                    // Estimated size is aroud 5 x original size when JPEG=>PNG.
+                    dSize += iconItem->itemInfo()->size*5;
+                }
+                else if (d->cameraUI->autoRotateJpegFiles())
+                {
+                    // We need a double size to perform rotation.
+                    dSize += iconItem->itemInfo()->size*2;
+                }
+                else
+                {
+                    // Real file size is added.
+                    dSize += iconItem->itemInfo()->size;
+                }
+            }
+            else
+                dSize += iconItem->itemInfo()->size;
+
+        }
+    }
+    
+    fSize /= 1024;
+    dSize /= 1024;
+}
+
 }  // namespace Digikam
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.h #707337:707338
@@ -88,6 +88,8 @@
 
     QString defaultDownloadName(CameraIconViewItem *item);
 
+    void itemsSelectionSizeInfo(unsigned long& fSize, unsigned long& dSize);
+
 signals:
 
     void signalSelected(CameraIconViewItem*, bool);
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #707337:707338
@@ -106,6 +106,7 @@
 #include "albumselectdialog.h"
 #include "renamecustomizer.h"
 #include "animwidget.h"
+#include "freespacewidget.h"
 #include "collectionscanner.h"
 #include "collectionmanager.h"
 #include "camerafolderdialog.h"
@@ -187,6 +188,7 @@
         donateMoneyAction         = 0;
         cameraCancelAction        = 0;
         imageViewAction           = 0;
+        freeSpaceWidget           = 0;
     }
 
     bool                          busy;
@@ -261,6 +263,8 @@
     StatusZoomBar                *statusZoomBar;
     StatusProgressBar            *statusProgressBar;
     StatusNavigateBar            *statusNavigateBar;
+
+    FreeSpaceWidget              *freeSpaceWidget;
 };
 
 CameraUI::CameraUI(QWidget* parent, const QString& cameraTitle, 
@@ -562,6 +566,11 @@
 
     // ---------------------------------------------------------------------------------
 
+    d->freeSpaceWidget             = new FreeSpaceWidget(this, 100);
+    QWidgetAction *freeSpaceAction = new QWidgetAction(this);
+    freeSpaceAction->setDefaultWidget(d->freeSpaceWidget);
+    actionCollection()->addAction("freespace_action", freeSpaceAction);
+
     DLogoAction *logoAction = new DLogoAction(this);
     actionCollection()->addAction("logo_action", logoAction);
 
@@ -789,6 +798,11 @@
     return d->closed;
 }
 
+bool CameraUI::autoRotateJpegFiles() const
+{
+    return d->autoRotateCheck->isChecked();
+}
+
 bool CameraUI::convertLosslessJpegFiles() const
 {
     return d->convertJpegCheck->isChecked();
@@ -1209,6 +1223,22 @@
     if (!onlySelected)
         d->view->slotSelectAll();
 
+    // See B.K.O #139519: Always check free space available before to
+    // download items selection from camera.
+    unsigned long fSize = 0;
+    unsigned long dSize = 0;
+    d->view->itemsSelectionSizeInfo(fSize, dSize);
+    if (d->freeSpaceWidget->isValid() && (dSize >= d->freeSpaceWidget->kBAvail()))
+    {
+        KMessageBox::error(this, i18n("There is no enough free space on Album Library Path "
+                                      "to download and process selected pictures from camera.\n\n"
+                                      "Estimated space require: %1\n"
+                                      "Available free space: %2",
+                                      KIO::convertSizeFromKiB(dSize)),
+                                      KIO::convertSizeFromKiB(d->freeSpaceWidget->kBAvail()));
+        return;
+    }
+
     QString   newDirName;
     IconItem* firstItem = d->view->firstItem();
     if (firstItem)
@@ -1687,6 +1717,11 @@
         d->deleteSelectedAction->setEnabled(hasSelection);
         d->imageViewAction->setEnabled(hasSelection);
     }
+
+    unsigned long fSize = 0;
+    unsigned long dSize = 0;
+    d->view->itemsSelectionSizeInfo(fSize, dSize);
+    d->freeSpaceWidget->setEstimatedDSizeKb(dSize);
 }
 
 void CameraUI::slotItemsSelected(CameraIconViewItem* item, bool selected)
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.h #707337:707338
@@ -64,7 +64,9 @@
     bool isBusy() const;
     bool isClosed() const;
 
-    // Get status of JPEG conversion files to lossless format during download.
+    bool autoRotateJpegFiles() const;
+
+    /** Get status of JPEG conversion files to lossless format during download.*/
     bool convertLosslessJpegFiles() const;
     QString losslessFormat();
 
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.rc #707337:707338
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui version="8" name="cameraui" >
+<gui version="9" name="cameraui" >
 
 <MenuBar>
 
@@ -67,7 +67,8 @@
      <Action name="cameraui_imageupload" />
      <Action name="cameraui_imagelock" />
      <Merge />
-     <WeakSeparator/>
+     <WeakSeparator/>     
+     <Action name="freespace_action" />        
      <Action name="logo_action" />	      
      <Action name="anim_action" />        
 </ToolBar>
--- trunk/extragear/graphics/digikam/utilities/cameragui/freespacewidget.cpp #707337:707338
@@ -194,12 +194,15 @@
 
 void FreeSpaceWidget::slotTimeout()
 {
-    KMountPoint::Ptr mp = KMountPoint::currentMountPoints().
-                          findByPath(AlbumSettings::componentData()->getAlbumLibraryPath());
-    KDiskFreeSpace *job   = new KDiskFreeSpace;
-    connect(job, SIGNAL(foundMountPoint(QString, quint64, quint64, quint64)),
-            this, SLOT(slotAvailableFreeSpace(QString, quint64, quint64, quint64)));
-    job->readDF(mp->mountPoint());
+    QString path        = AlbumSettings::componentData()->getAlbumLibraryPath();
+    KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(path);
+    if (mp)
+    {
+        KDiskFreeSpace *job = new KDiskFreeSpace;
+        connect(job, SIGNAL(foundMountPoint(QString, quint64, quint64, quint64)),
+                this, SLOT(slotAvailableFreeSpace(QString, quint64, quint64, quint64)));
+        job->readDF(mp->mountPoint());
+    }
 }
 
 void FreeSpaceWidget::slotAvailableFreeSpace(QString mountPoint, quint64 kBSize, 
Comment 12 caulier.gilles 2007-09-01 17:04:45 UTC
Ron,

Can i have more feedback about this report. Thanks in advance

Gilles Caulier
Comment 13 caulier.gilles 2007-09-04 11:00:22 UTC
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();
Comment 14 caulier.gilles 2007-09-04 11:03:43 UTC
SVN commit 708236 by cgilles:

digiKam from trunk (KDE4) : backport commits # 708234 from KDE3 branch
BUG: 136927


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


--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #708235:708236
@@ -23,17 +23,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 <QMenu>
@@ -1351,6 +1340,9 @@
                     break;
             }
 
+            // See B.K.O #136927 : we need to support file system which do not
+            // handle upper case properly.
+            dirName = dirName.toLower();
             if (!createAutoAlbum(url, dirName, dateTime.date(), errMsg))
             {
                 KMessageBox::error(this, errMsg);
@@ -1379,6 +1371,9 @@
                 fi.suffix().toUpper() == 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.toLower();
             if (!createAutoAlbum(u, subAlbum, dateTime.date(), errMsg))
             {
                 KMessageBox::error(this, errMsg);
@@ -1751,23 +1746,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",
-                          name, parentURL.path());
+                          sub, parentURL.path());
             return false;
         }
     }
@@ -1783,7 +1778,7 @@
     }
     QString albumRootPath = CollectionManager::instance()->albumRootPath(parentURL);
 
-    return aman->createPAlbum(parent, albumRootPath, name, QString(""), date, QString(""), errMsg);
+    return aman->createPAlbum(parent, albumRootPath, sub, QString(""), date, QString(""), errMsg);
 }
 
 void CameraUI::addFileExtension(const QString& ext)
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.h #708235:708236
@@ -96,7 +96,7 @@
 
     void readSettings();
     void saveSettings();
-    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);
 
Comment 15 Paweł Marciniak 2007-09-06 14:51:59 UTC
Gilles,

I confirm that the VFAT problem I mentioned is now fixed.
Comment 16 caulier.gilles 2007-09-06 15:01:57 UTC
Thanks Ron

Gilles