Skip to content

mimeTypesSupportedByBuiltInStyles: remove text/x-objchdr

Igor Kushnir requested to merge igorkushnir/kdevelop:rm-objchdr-mimetype into master

This change eliminates the following warnings from KDevelop's output:

kdevplatform.shell: formatter plugin "kdevastyle" supports unknown mimetype entry "text/x-objchdr"
kdevplatform.shell: formatter plugin "kdevcustomscript" supports unknown mimetype entry "text/x-objchdr"

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 I doubt the MIME type DB maintainers would 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

Merge request reports