Use new mime database

Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-02-04 09:32:46 +01:00
parent 365c1ddb90
commit 5a3a940ad3
112 changed files with 609 additions and 3226 deletions

View File

@@ -1,10 +1,8 @@
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-python">
<sub-class-of type="text/plain"/>
<comment>Python Source File</comment>
<glob pattern="*.py"/>
<mime-type type="text/x-python-gui">
<sub-class-of type="text/x-python"/>
<comment>Python source file without console</comment>
<glob pattern="*.pyw"/>
<glob pattern="*.wsgi"/>
</mime-type>
</mime-info>

View File

@@ -44,7 +44,6 @@ const char C_EDITOR_DISPLAY_NAME[] =
* MIME type
******************************************************************************/
const char C_PY_MIMETYPE[] = "text/x-python";
const char RC_PY_MIME_XML[] = ":/pythoneditor/PythonEditor.mimetypes.xml";
const char C_PY_MIME_ICON[] = "text-x-python";
} // namespace Constants

View File

@@ -35,12 +35,12 @@
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/id.h>
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/texteditorconstants.h>
#include <utils/mimetypes/mimedatabase.h>
#include <QtPlugin>
#include <QCoreApplication>
@@ -209,9 +209,9 @@ PythonEditorPlugin::~PythonEditorPlugin()
bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
Q_UNUSED(errorMessage)
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(RC_PY_MIME_XML), errorMessage))
return false;
Utils::MimeDatabase::addMimeTypes(QLatin1String(":/pythoneditor/PythonEditor.mimetypes.xml"));
addAutoReleasedObject(new PythonEditorFactory);