Browse Source

Remove some code duplication in DF image filtering

CURA-8233
Jaime van Kessel 3 years ago
parent
commit
45f8f3ba3c
1 changed files with 4 additions and 12 deletions
  1. 4 12
      plugins/DigitalLibrary/src/DigitalFactoryController.py

+ 4 - 12
plugins/DigitalLibrary/src/DigitalFactoryController.py

@@ -385,18 +385,10 @@ class DigitalFactoryController(QObject):
     def _applicationInitializationFinished(self) -> None:
         self._supported_file_types = self._application.getInstance().getMeshFileHandler().getSupportedFileTypesRead()
 
-        # Although cura supports these, it's super confusing in this context to show them.
-        if "jpg" in self._supported_file_types:
-            del self._supported_file_types["jpg"]
-        if "jpeg" in self._supported_file_types:
-            del self._supported_file_types["jpeg"]
-        if "png" in self._supported_file_types:
-            del self._supported_file_types["png"]
-        if "bmp" in self._supported_file_types:
-            del self._supported_file_types["bmp"]
-        if "gif" in self._supported_file_types:
-            del self._supported_file_types["gif"]
-
+        # Although Cura supports these, it's super confusing in this context to show them.
+        for extension in ["jpg", "jpeg", "png", "bmp", "gif"]:
+            if extension in self._supported_file_types:
+                del self._supported_file_types[extension]
 
     @pyqtSlot()
     def openSelectedFiles(self) -> None: