Skip to content
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):
kdevplatform.shell: formatter plugin "kdevastyle" supports unknown mimetype entry "text/x-objchdr"
kdevplatform.shell: 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
https://commits.kde.org/kcoreaddons/e5f09f84a945af4edf4f346aed409acf29905414
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:
https://developer.apple.com/documentation/uniformtypeidentifiers/system_declared_uniform_type_identifiers

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 https://phabricator.kde.org/D15532
parent 9ae6ac2b
Pipeline #224109 passed with stage
in 16 minutes and 28 seconds
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