Parent epic: #664
Depends on: Slice A (#665).
Goal
On a Linux install (deb or snap), file managers (Nautilus, Dolphin, Nemo) and xdg-open route the supported 3D formats to QtMeshEditor.
Scope
Shared assets (referenced by both deb and snap)
-
packaging/linux/qtmesheditor.desktop (canonical file, copied into both deb and snap at build time):
[Desktop Entry]
Name=QtMeshEditor
GenericName=3D Model Editor
Comment=Free 3D asset tool — FBX/glTF/materials/MCP CLI
Keywords=3D;mesh;FBX;glTF;model;material;animation;Ogre;editor;
Exec=qtmesheditor %F
TryExec=qtmesheditor
Icon=qtmesheditor
Terminal=false
Type=Application
Categories=Graphics;3DGraphics;Development;
MimeType=model/gltf-binary;model/gltf+json;application/vnd.autodesk.fbx;model/obj;model/stl;application/vnd.ms-collada+xml;application/sla;model/x-ply;application/x-3ds;application/x-ogre-mesh;application/x-ogre-material;application/x-ps1-rsd;application/x-ps1-tmd;
StartupWMClass=QtMeshEditor
Note Exec=qtmesheditor %F (capital F = supports multi-file selection from "Open With" multi-select; deferred to Slice A's multi-file handling).
-
packaging/linux/qtmesheditor.xml — XDG shared-mime-info entries declaring custom MIME types for formats without a registered IANA type:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-ogre-mesh">
<comment>Ogre 3D Mesh</comment>
<glob pattern="*.mesh"/>
<icon name="qtmesheditor-mesh"/>
</mime-type>
<mime-type type="application/x-ogre-material">
<comment>Ogre 3D Material Script</comment>
<glob pattern="*.material"/>
<icon name="qtmesheditor-material"/>
</mime-type>
<mime-type type="application/x-ps1-rsd">
<comment>PlayStation Resource Database</comment>
<glob pattern="*.rsd"/>
<icon name="qtmesheditor-mesh"/>
</mime-type>
<mime-type type="application/x-ps1-tmd">
<comment>PlayStation TMD Model</comment>
<glob pattern="*.tmd"/>
<icon name="qtmesheditor-mesh"/>
</mime-type>
<mime-type type="model/x-ply">
<comment>Stanford Polygon Format</comment>
<glob pattern="*.ply"/>
<icon name="qtmesheditor-static"/>
</mime-type>
<!-- Other formats use their IANA-registered types so no entries needed here -->
</mime-info>
.deb
DEBIAN-control.in updated to declare:
Provides: 3d-model-viewer
- New install-time files in the .deb:
/usr/share/applications/qtmesheditor.desktop (from the shared asset).
/usr/share/mime/packages/qtmesheditor.xml (from the shared asset).
/usr/share/icons/hicolor/<sizes>/apps/qtmesheditor.png — the app icon (probably already exists; verify).
/usr/share/icons/hicolor/<sizes>/mimetypes/qtmesheditor-mesh.png, qtmesheditor-material.png, qtmesheditor-static.png, qtmesheditor-animatable.png — the per-family icons mirroring Slices B and C.
DEBIAN-postinst (new — currently the project has no postinst):
#!/bin/sh
set -e
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database -q /usr/share/applications || true
fi
if command -v update-mime-database >/dev/null 2>&1; then
update-mime-database /usr/share/mime || true
fi
if command -v gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache --quiet /usr/share/icons/hicolor || true
fi
exit 0
DEBIAN-postrm mirrors postinst for clean uninstall.
- These need wiring through the existing CMake / packaging path that produces the
.deb. Verify the project's current packaging step (the workflow at .github/workflows/deploy.yml mentions deb) and extend it to copy the new files.
Snap
snap/gui/qtmesheditor.desktop updated to add the MimeType= line (currently absent — see the existing file). Replace it with the canonical packaging/linux/qtmesheditor.desktop minus the ${SNAP}/meta/gui/icon.png rewrite that the snap toolchain currently does.
snap/snapcraft.yaml updated to register the XDG MIME XML:
apps:
qtmesheditor:
command: bin/qtmesheditor
common-id: io.github.fernandotonon.QtMeshEditor
desktop: meta/gui/qtmesheditor.desktop
plugs:
- home
- removable-media
- desktop
- desktop-legacy
- wayland
- x11
- opengl
parts:
qtmesheditor:
# ... existing part definition ...
override-prime: |
snapcraftctl prime
mkdir -p $SNAPCRAFT_PRIME/meta/mime
cp $SNAPCRAFT_PROJECT_DIR/packaging/linux/qtmesheditor.xml $SNAPCRAFT_PRIME/meta/mime/qtmesheditor.xml
Note: snap's MIME registration story is weaker than deb's — file managers may not pick up custom MIME types from a snap-confined app unless the snap is installed classic or with extra plugs. Document the limitation; for users who care, recommend the deb.
Verification
A new scripts/verify-linux-association.sh that uses xdg-mime query default model/gltf-binary and asserts QtMeshEditor is listed in the alternatives (xdg-mime query default returns one app; gio mime model/gltf-binary lists alternatives — use both).
Acceptance Criteria
Effort
~5 days. Snap's MIME-registration quirks under confinement are the schedule risk.
Parent epic: #664
Depends on: Slice A (#665).
Goal
On a Linux install (deb or snap), file managers (Nautilus, Dolphin, Nemo) and
xdg-openroute the supported 3D formats to QtMeshEditor.Scope
Shared assets (referenced by both deb and snap)
packaging/linux/qtmesheditor.desktop(canonical file, copied into both deb and snap at build time):Note
Exec=qtmesheditor %F(capital F = supports multi-file selection from "Open With" multi-select; deferred to Slice A's multi-file handling).packaging/linux/qtmesheditor.xml— XDG shared-mime-info entries declaring custom MIME types for formats without a registered IANA type:.deb
DEBIAN-control.inupdated to declare:/usr/share/applications/qtmesheditor.desktop(from the shared asset)./usr/share/mime/packages/qtmesheditor.xml(from the shared asset)./usr/share/icons/hicolor/<sizes>/apps/qtmesheditor.png— the app icon (probably already exists; verify)./usr/share/icons/hicolor/<sizes>/mimetypes/qtmesheditor-mesh.png,qtmesheditor-material.png,qtmesheditor-static.png,qtmesheditor-animatable.png— the per-family icons mirroring Slices B and C.DEBIAN-postinst(new — currently the project has no postinst):DEBIAN-postrmmirrors postinst for clean uninstall..deb. Verify the project's current packaging step (the workflow at.github/workflows/deploy.ymlmentions deb) and extend it to copy the new files.Snap
snap/gui/qtmesheditor.desktopupdated to add theMimeType=line (currently absent — see the existing file). Replace it with the canonicalpackaging/linux/qtmesheditor.desktopminus the${SNAP}/meta/gui/icon.pngrewrite that the snap toolchain currently does.snap/snapcraft.yamlupdated to register the XDG MIME XML:Verification
A new
scripts/verify-linux-association.shthat usesxdg-mime query default model/gltf-binaryand asserts QtMeshEditor is listed in the alternatives (xdg-mime query defaultreturns one app;gio mime model/gltf-binarylists alternatives — use both).Acceptance Criteria
apt install qtmesheditor*.deb,xdg-open model.fbxopens QtMeshEditor..mesh,.rsd,.tmd,.material) get the right icon in file managers.update-mime-database,update-desktop-database,gtk-update-icon-cacherun cleanly on postinst with no errors.verify-linux-association.shpost-uninstall).scan-assets-dockerjob (or a newverify-linux-associationjob) runs the verification script and fails the build if the registration is missing.Effort
~5 days. Snap's MIME-registration quirks under confinement are the schedule risk.