From f60780881bdfcdcc705655cdcff3ab93b098866f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 22 Apr 2015 13:42:20 +0200 Subject: MimeDatabase: Avoid parsing the mime xml files multiple times At the moment we need to throw the parsed information away and reparse everything if we add another mime xml file (*), so make sure that we do not use mime information (which triggers a first parse) before we added all mime xml files. (*) we do that because the data for a mime type is distributed through a whole range of classes which do not easily allow to remove an already registered mime type, but we must be able to overwrite mime types from freedesktop.org.xml. Change-Id: I5e532875cc750af1da3e0139397279d7be203c27 Reviewed-by: David Schulz --- src/plugins/glsleditor/glsleditorplugin.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugins/glsleditor/glsleditorplugin.cpp b/src/plugins/glsleditor/glsleditorplugin.cpp index 3695c0ef83..75b4b8d162 100644 --- a/src/plugins/glsleditor/glsleditorplugin.cpp +++ b/src/plugins/glsleditor/glsleditorplugin.cpp @@ -147,17 +147,16 @@ bool GlslEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er errorMessage->clear(); - FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE); - FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT); - FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG); - FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT_ES); - FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG_ES); - return true; } void GlslEditorPlugin::extensionsInitialized() { + FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE); + FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT); + FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG); + FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT_ES); + FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG_ES); } ExtensionSystem::IPlugin::ShutdownFlag GlslEditorPlugin::aboutToShutdown() -- cgit v1.2.1