Sophie

Sophie

distrib > Mandriva > 2008.0 > x86_64 > media > main-backports-src > by-pkgid > 8461b141ab7a2161b7518163d04e37da > files > 1

digikam-0.9.3-6mdv2008.0.src.rpm

--- utilities/cameragui/cameracontroller1.cpp
+++ utilities/cameragui/cameracontroller.cpp
@@ -370,7 +370,7 @@
 
                 KURL tempURL(dest);
                 tempURL = tempURL.upURL();
-                tempURL.addPath( QString(".digikam-camera-tmp1-%1").arg(getpid()));
+                tempURL.addPath( QString(".digikam-camera-tmp1-%1").arg(getpid()).prepend(file));
                 QString temp = tempURL.path();
     
                 bool result = d->camera->downloadItem(folder, file, tempURL.path());
@@ -410,7 +410,7 @@
 
                         KURL tempURL2(dest);
                         tempURL2 = tempURL2.upURL();
-                        tempURL2.addPath( QString(".digikam-camera-tmp2-%1").arg(getpid()));
+                        tempURL2.addPath( QString(".digikam-camera-tmp2-%1").arg(getpid()).prepend(file));
                         temp = tempURL2.path();
 
                         if (!jpegConvert(tempURL.path(), tempURL2.path(), file, losslessFormat))
@@ -420,6 +420,12 @@
                             unlink(QFile::encodeName(tempURL2.path()));
                             result = false;
                         }
+                        else
+                        {
+                            // Else remove only the first temp file.
+                            unlink(QFile::encodeName(tempURL.path()));
+                        }
+
                     }
                 }