diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-02-08 14:31:55 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-02-27 13:54:59 +0000 |
commit | d64e17ad55f155951fc76e4c2f04299aa9c7a912 (patch) | |
tree | 16890479318c917c88392035a461e9edbcf76621 /src/plugins/resourceeditor | |
parent | ca1d1dfbe2c2b046b5661de20da9e20d4b511680 (diff) | |
download | qt-creator-d64e17ad55f155951fc76e4c2f04299aa9c7a912.tar.gz |
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 <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/resourceeditor')
6 files changed, 12 insertions, 19 deletions
diff --git a/src/plugins/resourceeditor/ResourceEditor.json.in b/src/plugins/resourceeditor/ResourceEditor.json.in index a870b79b8a..6bf2776a0c 100644 --- a/src/plugins/resourceeditor/ResourceEditor.json.in +++ b/src/plugins/resourceeditor/ResourceEditor.json.in @@ -15,5 +15,16 @@ \"Category\" : \"Qt Creator\", \"Description\" : \"Editor for qrc files.\", \"Url\" : \"http://www.qt.io\", - $$dependencyList + $$dependencyList, + + \"Mimetypes\" : \" + <?xml version=\'1.0\'?> + <mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'> + <mime-type type=\'application/vnd.qt.xml.resource\'> + <sub-class-of type=\'text/xml\'/> + <comment>Qt Resource file</comment> + <glob pattern=\'*.qrc\'/> + </mime-type> + </mime-info> + \" } diff --git a/src/plugins/resourceeditor/ResourceEditor.mimetypes.xml b/src/plugins/resourceeditor/ResourceEditor.mimetypes.xml deleted file mode 100644 index d22052251d..0000000000 --- a/src/plugins/resourceeditor/ResourceEditor.mimetypes.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0"?> -<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> - <mime-type type="application/vnd.qt.xml.resource"> - <sub-class-of type="text/xml"/> - <comment>Qt Resource file</comment> - <glob pattern="*.qrc"/> - </mime-type> -</mime-info> diff --git a/src/plugins/resourceeditor/resourceeditor.pro b/src/plugins/resourceeditor/resourceeditor.pro index 4a948ac274..d16f728847 100644 --- a/src/plugins/resourceeditor/resourceeditor.pro +++ b/src/plugins/resourceeditor/resourceeditor.pro @@ -13,6 +13,4 @@ resourceeditorplugin.cpp \ resourceeditorw.cpp \ resourcenode.cpp -RESOURCES += resourceeditor.qrc - DEFINES += RESOURCE_LIBRARY diff --git a/src/plugins/resourceeditor/resourceeditor.qbs b/src/plugins/resourceeditor/resourceeditor.qbs index cce3876106..e1a37545e7 100644 --- a/src/plugins/resourceeditor/resourceeditor.qbs +++ b/src/plugins/resourceeditor/resourceeditor.qbs @@ -18,7 +18,6 @@ Project { Group { name: "General" files: [ - "resourceeditor.qrc", "resourceeditorconstants.h", "resourceeditorfactory.cpp", "resourceeditorfactory.h", "resourceeditorplugin.cpp", "resourceeditorplugin.h", diff --git a/src/plugins/resourceeditor/resourceeditor.qrc b/src/plugins/resourceeditor/resourceeditor.qrc deleted file mode 100644 index 9d6b792e03..0000000000 --- a/src/plugins/resourceeditor/resourceeditor.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/resourceeditor"> - <file>ResourceEditor.mimetypes.xml</file> - </qresource> -</RCC> diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 5dc8f83c54..21060c6ae7 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -44,7 +44,6 @@ #include <projectexplorer/projectnodes.h> #include <extensionsystem/pluginmanager.h> -#include <utils/mimetypes/mimedatabase.h> #include <utils/parameteraction.h> #include <utils/qtcassert.h> @@ -121,7 +120,6 @@ bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *err { Q_UNUSED(arguments) Q_UNUSED(errorMessage) - Utils::MimeDatabase::addMimeTypes(QLatin1String(":/resourceeditor/ResourceEditor.mimetypes.xml")); ResourceEditorFactory *editor = new ResourceEditorFactory(this); addAutoReleasedObject(editor); |