forked from qt-creator/qt-creator
Use new mime database
Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
14
src/plugins/debugger/Debugger.mimetypes.xml
Normal file
14
src/plugins/debugger/Debugger.mimetypes.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
|
||||
<mime-type type="text/x-asm">
|
||||
<sub-class-of type="text/plain"/>
|
||||
<comment>Assembler</comment>
|
||||
<glob pattern="*.asm"/>
|
||||
</mime-type>
|
||||
<!-- Catch-all for assemblers -->
|
||||
<mime-type type="text/x-qtcreator-generic-asm">
|
||||
<sub-class-of type="text/x-asm"/>
|
||||
<comment>Qt Creator Generic Assembler</comment>
|
||||
<glob pattern="*.asm"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
@@ -38,5 +38,6 @@
|
||||
<file>images/qml/apply-on-save.png</file>
|
||||
<file>images/debugger_restart.png</file>
|
||||
<file>images/debugger_restart_small.png</file>
|
||||
<file>Debugger.mimetypes.xml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/proxyaction.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
@@ -1269,6 +1270,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
|
||||
QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(errorMessage);
|
||||
Utils::MimeDatabase::addMimeTypes(QLatin1String(":/debugger/Debugger.mimetypes.xml"));
|
||||
|
||||
m_arguments = arguments;
|
||||
if (!m_arguments.isEmpty())
|
||||
connect(KitManager::instance(), &KitManager::kitsLoaded,
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QTextBlock>
|
||||
@@ -237,8 +237,9 @@ void DisassemblerAgentPrivate::configureMimeType()
|
||||
|
||||
document->setMimeType(mimeType);
|
||||
|
||||
MimeType mtype = MimeDatabase::findByType(mimeType);
|
||||
if (mtype) {
|
||||
Utils::MimeDatabase mdb;
|
||||
Utils::MimeType mtype = mdb.mimeTypeForName(mimeType);
|
||||
if (mtype.isValid()) {
|
||||
foreach (IEditor *editor, DocumentModel::editorsForDocument(document))
|
||||
if (TextEditorWidget *widget = qobject_cast<TextEditorWidget *>(editor->widget()))
|
||||
widget->configureGenericHighlighter();
|
||||
|
||||
Reference in New Issue
Block a user