--- 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())); + } + } }