Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2018-09-27 14:58:06 +0300
committerGhostkeeper <rubend@tutanota.com>2018-09-27 14:58:06 +0300
commit0ce9bf61beb1ed6bf72319b42330cd69251b959e (patch)
treef79304a384e1adcbf9fd01ff15c83d59ab8b38ae /plugins/GCodeReader
parent88ba2ac3451834db5a11169214d410c8aa3f726d (diff)
Move MIME type declarations into constructors of readers
So that if you disable the plug-in, the MIME type declaration is also not added. Fixes #4151.
Diffstat (limited to 'plugins/GCodeReader')
-rwxr-xr-xplugins/GCodeReader/GCodeReader.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/GCodeReader/GCodeReader.py b/plugins/GCodeReader/GCodeReader.py
index 498c425f68..1bc22a3e62 100755
--- a/plugins/GCodeReader/GCodeReader.py
+++ b/plugins/GCodeReader/GCodeReader.py
@@ -12,13 +12,7 @@ catalog = i18nCatalog("cura")
from . import MarlinFlavorParser, RepRapFlavorParser
-MimeTypeDatabase.addMimeType(
- MimeType(
- name = "application/x-cura-gcode-file",
- comment = "Cura GCode File",
- suffixes = ["gcode"]
- )
-)
+
# Class for loading and parsing G-code files
@@ -30,7 +24,15 @@ class GCodeReader(MeshReader):
def __init__(self) -> None:
super().__init__()
+ MimeTypeDatabase.addMimeType(
+ MimeType(
+ name = "application/x-cura-gcode-file",
+ comment = "Cura GCode File",
+ suffixes = ["gcode"]
+ )
+ )
self._supported_extensions = [".gcode", ".g"]
+
self._flavor_reader = None
Application.getInstance().getPreferences().addPreference("gcodereader/show_caution", True)