diff options
author | Ghostkeeper <rubend@tutanota.com> | 2018-09-27 14:58:06 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2018-09-27 14:58:06 +0300 |
commit | 0ce9bf61beb1ed6bf72319b42330cd69251b959e (patch) | |
tree | f79304a384e1adcbf9fd01ff15c83d59ab8b38ae /plugins/GCodeReader | |
parent | 88ba2ac3451834db5a11169214d410c8aa3f726d (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-x | plugins/GCodeReader/GCodeReader.py | 16 |
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) |