Fix race condition in image rotation introduced in e2bc73e4b0a0
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 24 Jul 2007 15:22:35 +0000 (17:22 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 24 Jul 2007 15:22:35 +0000 (17:22 +0200)
src/packages/kofoto/gkofoto/duplicateandopenimagedialog.py
src/packages/kofoto/gkofoto/imageversionslist.py
src/packages/kofoto/gkofoto/objectcollection.py

index 98df55f..9b2eb21 100644 (file)
@@ -49,8 +49,10 @@ class DuplicateAndOpenImageDialog:
                 duplicateLocation)
             command = env.openCommand % {"locations": duplicateLocation}
             try:
-                subprocess.Popen(command, shell=True)
+                result = subprocess.call(command, shell=True)
             except OSError:
+                result = 1
+            if result != 0:
                 dialog = gtk.MessageDialog(
                     self._dialog,
                     gtk.DIALOG_MODAL,
index 7f92a83..5261b4a 100644 (file)
@@ -286,8 +286,10 @@ class ImageVersionsList(gtk.ScrolledWindow):
             for x in self.__getSelectedImageVersionsInOrder()]
         command = env.openCommand % {"locations": " ".join(locations)}
         try:
-            subprocess.Popen(command, shell=True)
+            result = subprocess.call(command, shell=True)
         except OSError:
+            result = 1
+        if result != 0:
             dialog = gtk.MessageDialog(
                 type=gtk.MESSAGE_ERROR,
                 buttons=gtk.BUTTONS_OK,
@@ -371,8 +373,10 @@ class ImageVersionsList(gtk.ScrolledWindow):
             env.pixbufLoader.unload_all(location)
             command = rotateCommand % {"location": location}
             try:
-                subprocess.Popen(command, shell=True)
+                result = subprocess.call(command, shell=True)
             except OSError:
+                result = 1
+            if result != 0:
                 dialog = gtk.MessageDialog(
                     type=gtk.MESSAGE_ERROR,
                     buttons=gtk.BUTTONS_OK,
index b10e3c6..c1d26e1 100644 (file)
@@ -532,8 +532,10 @@ class ObjectCollection(object):
                     commandString = env.rotateLeftCommand
                 command = commandString % { "location":location }
                 try:
-                    subprocess.Popen(command, shell=True)
+                    result = subprocess.call(command, shell=True)
                 except OSError:
+                    result = 1
+                if result != 0:
                     dialog = gtk.MessageDialog(
                         type=gtk.MESSAGE_ERROR,
                         buttons=gtk.BUTTONS_OK,
@@ -565,8 +567,10 @@ class ObjectCollection(object):
         if locations != "":
             command = env.openCommand % { "locations":locations }
             try:
-                subprocess.Popen(command, shell=True)
+                result = subprocess.call(command, shell=True)
             except OSError:
+                result = 1
+            if result != 0:
                 dialog = gtk.MessageDialog(
                     type=gtk.MESSAGE_ERROR,
                     buttons=gtk.BUTTONS_OK,