From d64e17ad55f155951fc76e4c2f04299aa9c7a912 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 8 Feb 2017 14:31:55 +0100 Subject: Move mimetype definitions to plugin specs - Avoids the hassle of QRC files and manually registering mime types - Avoids performance regressions because of mime types that are registered after mime database has been used - Makes it technically possible to detect that a disabled plugin could handle a mime type if it was enabled Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9 Reviewed-by: Christian Stenger Reviewed-by: hjk --- src/plugins/glsleditor/GLSLEditor.json.in | 47 ++++++++++++++++++++++++- src/plugins/glsleditor/GLSLEditor.mimetypes.xml | 42 ---------------------- src/plugins/glsleditor/glsleditor.qrc | 1 - src/plugins/glsleditor/glsleditorplugin.cpp | 3 -- 4 files changed, 46 insertions(+), 47 deletions(-) delete mode 100644 src/plugins/glsleditor/GLSLEditor.mimetypes.xml (limited to 'src/plugins/glsleditor') diff --git a/src/plugins/glsleditor/GLSLEditor.json.in b/src/plugins/glsleditor/GLSLEditor.json.in index 3e5ff3831c7..915ae7ae029 100644 --- a/src/plugins/glsleditor/GLSLEditor.json.in +++ b/src/plugins/glsleditor/GLSLEditor.json.in @@ -15,5 +15,50 @@ \"Category\" : \"Other Languages\", \"Description\" : \"Editor for GLSL.\", \"Url\" : \"http://www.qt.io\", - $$dependencyList + $$dependencyList, + + \"Mimetypes\" : \" + + + + + + + GLSL Shader file + + + + + + + GLSL Fragment Shader file + + + + + + GLSL/ES Fragment Shader file + + + + + + GLSL Vertex Shader file + + + + + + GLSL/ES Vertex Shader file + + + + + + GLSL/ES Geometry Shader file + + + + + \" } diff --git a/src/plugins/glsleditor/GLSLEditor.mimetypes.xml b/src/plugins/glsleditor/GLSLEditor.mimetypes.xml deleted file mode 100644 index 8f4570980a4..00000000000 --- a/src/plugins/glsleditor/GLSLEditor.mimetypes.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - GLSL Shader file - - - - - - - GLSL Fragment Shader file - - - - - - GLSL/ES Fragment Shader file - - - - - - GLSL Vertex Shader file - - - - - - GLSL/ES Vertex Shader file - - - - - - GLSL/ES Geometry Shader file - - - - diff --git a/src/plugins/glsleditor/glsleditor.qrc b/src/plugins/glsleditor/glsleditor.qrc index cb1c737c9a1..88d7aea098b 100644 --- a/src/plugins/glsleditor/glsleditor.qrc +++ b/src/plugins/glsleditor/glsleditor.qrc @@ -1,6 +1,5 @@ - GLSLEditor.mimetypes.xml images/glslfile.png diff --git a/src/plugins/glsleditor/glsleditorplugin.cpp b/src/plugins/glsleditor/glsleditorplugin.cpp index 78455da651a..945e94f03b9 100644 --- a/src/plugins/glsleditor/glsleditorplugin.cpp +++ b/src/plugins/glsleditor/glsleditorplugin.cpp @@ -46,7 +46,6 @@ #include -#include #include #include @@ -117,8 +116,6 @@ GlslEditorPlugin::~GlslEditorPlugin() bool GlslEditorPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage) { - Utils::MimeDatabase::addMimeTypes(QLatin1String(":/glsleditor/GLSLEditor.mimetypes.xml")); - addAutoReleasedObject(new GlslEditorFactory); addAutoReleasedObject(new GlslCompletionAssistProvider); -- cgit v1.2.3