forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -15,5 +15,21 @@
|
||||
\"Category\" : \"Other Languages\",
|
||||
\"Description\" : \"Editor and file creation wizards for Python. Example plugin for QtCreator API demonstration.\",
|
||||
\"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=\'text/x-python-gui\'>
|
||||
<sub-class-of type=\'text/x-python\'/>
|
||||
<comment>Python source file without console</comment>
|
||||
<glob pattern=\'*.pyw\'/>
|
||||
</mime-type>
|
||||
<mime-type type=\'text/x-python-project\'>
|
||||
<sub-class-of type=\'text/x-python\'/>
|
||||
<comment>Qt Creator Python project file</comment>
|
||||
<glob pattern=\'*.pyqtc\'/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
\"
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
|
||||
<mime-type type="text/x-python-gui">
|
||||
<sub-class-of type="text/x-python"/>
|
||||
<comment>Python source file without console</comment>
|
||||
<glob pattern="*.pyw"/>
|
||||
</mime-type>
|
||||
<mime-type type="text/x-python-project">
|
||||
<sub-class-of type="text/x-python"/>
|
||||
<comment>Qt Creator Python project file</comment>
|
||||
<glob pattern="*.pyqtc"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
@@ -3,9 +3,6 @@ include(../../qtcreatorplugin.pri)
|
||||
DEFINES += \
|
||||
PYTHONEDITOR_LIBRARY
|
||||
|
||||
RESOURCES += \
|
||||
pythoneditorplugin.qrc
|
||||
|
||||
HEADERS += \
|
||||
pythoneditorplugin.h \
|
||||
pythoneditor.h \
|
||||
|
||||
@@ -17,7 +17,6 @@ QtcPlugin {
|
||||
"pythoneditor.cpp", "pythoneditor.h",
|
||||
"pythoneditorconstants.h",
|
||||
"pythoneditorplugin.cpp", "pythoneditorplugin.h",
|
||||
"pythoneditorplugin.qrc",
|
||||
"pythonhighlighter.h", "pythonhighlighter.cpp",
|
||||
"pythonindenter.cpp", "pythonindenter.h",
|
||||
"pythonformattoken.h",
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/utilsicons.h>
|
||||
@@ -885,8 +884,6 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorMessage)
|
||||
|
||||
MimeDatabase::addMimeTypes(":/pythoneditor/PythonEditor.mimetypes.xml");
|
||||
|
||||
addAutoReleasedObject(new PythonProjectManager);
|
||||
addAutoReleasedObject(new PythonEditorFactory);
|
||||
addAutoReleasedObject(new PythonRunConfigurationFactory);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/pythoneditor">
|
||||
<file>PythonEditor.mimetypes.xml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
Reference in New Issue
Block a user