Commit 832bd481 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

mimeTypesSupportedByBuiltInStyles: remove text/x-objchdr

Whenever the user opens Configure KDevelop... or Configure Project
dialog, KDevelop prints to stderr one of the following two warnings for
each formatting style (except for Python styles): formatter plugin "kdevastyle" supports unknown mimetype entry "text/x-objchdr" formatter plugin "kdevcustomscript" supports unknown mimetype entry "text/x-objchdr"

This change eliminates such unknown-mimetype-entry warnings for
predefined formatting styles. The MIME type is not automatically removed
from user-defined styles. So in order to completely eliminate the
text/x-objchdr warnings, the strings ",text/x-objchdr|Objective-C" have
to be replaced with "" (empty strings) in ~/.config/kdeveloprc.

The removed text/x-objchdr MIME type is very rarely used. There is no
mention of it in Qt Creator's code. KSyntaxHighlighting refers to
text/x-c-hdr in data/syntax/objectivec[pp].xml. This KCoreAddons commit
removed it as useless. Indeed, it shares the extension *.h with C. Not
even C++ competes for this file extension in the MIME type database,
even though a large proportion of *.h files are C++ headers. So the MIME
type DB maintainers probably won't agree to risk issues and slow down C
header detection to accommodate this rare case. Theoretically,
Objective-C headers could be detected with #import magic, but that
wouldn't be reliable, because Objective-C headers can start with a
comment or with #include, which share C's syntax.

This MIME type is currently useless in KDevelop anyway, because it is
only included in MIME type lists and never appears in conditions.

Apparently even macOS does not have a notion of Objective-C header file
type. The Compiled Programming Language Sources section of Apple's
System Declared UTI documentation contains cHeader, cSource,
cPlusPlusHeader, cPlusPlusSource, objectiveCPlusPlusSource and
objectiveCSource, but no objectiveC[PlusPlus]Header:

R.J.V. Bertin added this MIME type to KDevelop code in
a0992d31. He agreed to remove it during
a recent discussion in comments under
parent 9ae6ac2b
Pipeline #224109 passed with stage
in 16 minutes and 28 seconds
......@@ -208,7 +208,6 @@ SourceFormatterStyle::MimeList ISourceFormatter::mimeTypesSupportedByBuiltInStyl
{QStringLiteral("text/x-csharp"), QStringLiteral("C#")},
{QStringLiteral("text/x-objcsrc"), QStringLiteral("Objective-C")},
{QStringLiteral("text/x-objc++src"), QStringLiteral("Objective-C++")},
{QStringLiteral("text/x-objchdr"), QStringLiteral("Objective-C")},
return list;
Supports Markdown
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