summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2016-03-15 13:36:50 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2016-03-15 14:35:08 +0000
commit09cdd1c4a5627df7d7876f3d8e42d50ba46b483d (patch)
tree16bda8607129d8c15e46a6aea35a474547e27b24
parent1287b727287db06758219fb9b66c5ab103c68da7 (diff)
downloadqt-creator-09cdd1c4a5627df7d7876f3d8e42d50ba46b483d.tar.gz
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: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r--src/plugins/cppeditor/CppEditor.mimetypes.xml7
-rw-r--r--src/plugins/cppeditor/cppeditorplugin.cpp1
-rw-r--r--src/plugins/cpptools/cpptoolsconstants.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/CppEditor.mimetypes.xml b/src/plugins/cppeditor/CppEditor.mimetypes.xml
index be572a7bf1..c7e2dcaa76 100644
--- a/src/plugins/cppeditor/CppEditor.mimetypes.xml
+++ b/src/plugins/cppeditor/CppEditor.mimetypes.xml
@@ -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>
diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp
index a6873208d4..a9586e65f7 100644
--- a/src/plugins/cppeditor/cppeditorplugin.cpp
+++ b/src/plugins/cppeditor/cppeditorplugin.cpp
@@ -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; });
diff --git a/src/plugins/cpptools/cpptoolsconstants.h b/src/plugins/cpptools/cpptoolsconstants.h
index 90a62b8f71..5d2d06201c 100644
--- a/src/plugins/cpptools/cpptoolsconstants.h
+++ b/src/plugins/cpptools/cpptoolsconstants.h
@@ -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";