eric6/IconEditor/IconEditorWindow.py

changeset 8222
5994b80b8760
parent 8218
7c09585bd960
child 8240
93b8a353c4bf
--- a/eric6/IconEditor/IconEditorWindow.py	Sun Apr 11 16:53:48 2021 +0200
+++ b/eric6/IconEditor/IconEditorWindow.py	Sun Apr 11 18:45:10 2021 +0200
@@ -1066,9 +1066,12 @@
         Private slot to open an icon file.
         """
         if self.__maybeSave():
-            if not self.__lastOpenPath:
-                if self.__project and self.__project.isOpen():
-                    self.__lastOpenPath = self.__project.getProjectPath()
+            if (
+                not self.__lastOpenPath and
+                self.__project is not None and
+                self.__project.isOpen()
+            ):
+                self.__lastOpenPath = self.__project.getProjectPath()
             
             fileName = E5FileDialog.getOpenFileNameAndFilter(
                 self,
@@ -1098,9 +1101,12 @@
         
         @return flag indicating success (boolean)
         """
-        if not self.__lastSavePath:
-            if self.__project and self.__project.isOpen():
-                self.__lastSavePath = self.__project.getProjectPath()
+        if (
+            not self.__lastSavePath and
+            self.__project is not None and
+            self.__project.isOpen()
+        ):
+            self.__lastSavePath = self.__project.getProjectPath()
         if not self.__lastSavePath and self.__lastOpenPath:
             self.__lastSavePath = self.__lastOpenPath
         

eric ide

mercurial