Implement MIME type support on UNIX systems #1980
Merged
+12
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem description
This PR addresses issue #491 regarding the inability to open ImHex project files (
.hexproj
) directly from various UNIX Desktop Environments.NB: This PR's scope is limited to UNIX systems, as I have no access to MacOS systems and could not find a way to automatically create file associations on Windows.
Implementation description
In order for project files to be recognised as such, we need to create a new MIME type. According to RFC 6838 section 3.2, additional application MIME types should be defined with a vendor prefix.
NB: This is preferred over the deprecated
x-
prefix, although RFC 6838 states that the vendor should be "a well known producer"This PR proposes a new mime type for ImHex project files:
application/vnd.imhex.proj
, and associates it with the file format*.hexproj
.It also implements small changes in the Arch Linux and RPM builds, in order to correctly ship the MIME XML file during installation.
Additional things
The implemented change has been manually tested in the following UNIX systems and graphical environments:
Which tests the functionality of the following build types:
.zst
packages.deb
packagesFor Arch Linux and RPM packages, this has been tested to ensure that post-installation hooks (such as regeneration of the MIME database) is correctly executed (which it is). No further changes than those implemented in the PR are needed.