mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
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.
This commit is contained in:
parent
88ba2ac345
commit
0ce9bf61be
4 changed files with 27 additions and 25 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue