~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to debian/patches/10_lp201053_fix_download_rename_race.diff

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.2.15 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080717202539-6n7dtirbkoo7qvhd
Tags: 2:0.9.4-1
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- a/digikam/utilities/cameragui/cameracontroller.cpp
2
 
+++ b/digikam/utilities/cameragui/cameracontroller.cpp
3
 
@@ -370,7 +370,7 @@
4
 
 
5
 
                 KURL tempURL(dest);
6
 
                 tempURL = tempURL.upURL();
7
 
-                tempURL.addPath( QString(".digikam-camera-tmp1-%1").arg(getpid()));
8
 
+                tempURL.addPath( QString(".digikam-camera-tmp1-%1").arg(getpid()).prepend(file));
9
 
                 QString temp = tempURL.path();
10
 
     
11
 
                 bool result = d->camera->downloadItem(folder, file, tempURL.path());
12
 
@@ -410,7 +410,7 @@
13
 
 
14
 
                         KURL tempURL2(dest);
15
 
                         tempURL2 = tempURL2.upURL();
16
 
-                        tempURL2.addPath( QString(".digikam-camera-tmp2-%1").arg(getpid()));
17
 
+                        tempURL2.addPath( QString(".digikam-camera-tmp2-%1").arg(getpid()).prepend(file));
18
 
                         temp = tempURL2.path();
19
 
 
20
 
                         if (!jpegConvert(tempURL.path(), tempURL2.path(), file, losslessFormat))
21
 
@@ -420,6 +420,12 @@
22
 
                             unlink(QFile::encodeName(tempURL2.path()));
23
 
                             result = false;
24
 
                         }
25
 
+                        else
26
 
+                        {
27
 
+                            // Else remove only the first temp file.
28
 
+                            unlink(QFile::encodeName(tempURL.path()));
29
 
+                        }
30
 
+
31
 
                     }
32
 
                 }
33