Commit 09cdd1c4 authored by Tobias Hunger's avatar Tobias Hunger

CppEditor: Register qdoc as a separate mimetype from c++ sources

Add a new constant for qdoc mimetype to cpptoolsconstants.
Make the CppEditor handle qdoc mimetype.

This change has one user user visible effect:
Adding qdoc files to a qmake project will no longer put those files
into SOURCES where qmake will then try to compile them. They will show
up in "Other Files" instead.

Task-number: QTCREATORBUG-15872
Change-Id: Ibbf9af0a84fab59138f6b9ab41f1bba737b455c2
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 1287b727
......@@ -54,7 +54,6 @@
<!-- Additions to freedesktop: -->
<glob pattern="*.cp" weight="70"/>
<glob pattern="*.inl" weight="70"/>
<glob pattern="*.qdoc" weight="70"/>
<glob pattern="*.tcc" weight="70"/>
<glob pattern="*.tpp" weight="70"/>
<glob pattern="*.t++" weight="70"/>
......@@ -64,6 +63,12 @@
</magic>
</mime-type>
<mime-type type="text/x-qdoc">
<comment>Qt documentation file</comment>
<sub-class-of type="text/plain"/>
<glob pattern="*.qdoc" weight="70"/>
</mime-type>
<mime-type type="text/x-moc">
<comment>Qt MOC file</comment>
<acronym>Qt MOC</acronym>
......
......@@ -87,6 +87,7 @@ public:
addMimeType(CppTools::Constants::C_HEADER_MIMETYPE);
addMimeType(CppTools::Constants::CPP_SOURCE_MIMETYPE);
addMimeType(CppTools::Constants::CPP_HEADER_MIMETYPE);
addMimeType(CppTools::Constants::QDOC_MIMETYPE);
setDocumentCreator([]() { return new CppEditorDocument; });
setEditorWidgetCreator([]() { return new CppEditorWidget; });
......
......@@ -42,6 +42,7 @@ const char CPP_SOURCE_MIMETYPE[] = "text/x-c++src";
const char OBJECTIVE_C_SOURCE_MIMETYPE[] = "text/x-objcsrc";
const char OBJECTIVE_CPP_SOURCE_MIMETYPE[] = "text/x-objc++src";
const char CPP_HEADER_MIMETYPE[] = "text/x-c++hdr";
const char QDOC_MIMETYPE[] = "text/x-qdoc";
// QSettings keys for use by the "New Class" wizards.
const char CPPTOOLS_SETTINGSGROUP[] = "CppTools";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment