Skip to content
Permalink
Browse files
include geopackage and kml in .desktop
  • Loading branch information
jef-n committed Jul 3, 2021
1 parent ec374d5 commit ce3ee598e505cd2f7e9b5a857919caf332ca5439
Showing with 6 additions and 3 deletions.
  1. +5 −2 debian/qgis.mime
  2. +1 −1 linux/org.qgis.qgis.desktop.in
@@ -1,11 +1,14 @@
image/tif; qgis '%s'; description="TIFF Image"; test=test -n "$DISPLAY"; nametemplate=%s.tif; priority=2
image/jpg; qgis '%s'; description="JPEG Image"; test=test -n "$DISPLAY"; nametemplate=%s.jpg; priority=2
image/tiff; qgis '%s'; description="TIFF Image"; test=test -n "$DISPLAY"; nametemplate=%s.tif; priority=2
image/jpeg; qgis '%s'; description="JPEG Image"; test=test -n "$DISPLAY"; nametemplate=%s.jpg; priority=2
image/jp2; qgis '%s'; description="JPEG 2000 Image"; test=test -n "$DISPLAY"; nametemplate=%s.jp2; priority=2
application/x-raster-aig; qgis '%s'; description="AIG raster data"; test=test -n "$DISPLAY"; nametemplate=%s.aig; priority=2
application/x-raster-ecw; qgis '%s'; description="ECW raster data"; test=test -n "$DISPLAY"; nametemplate=%s.ecw; priority=2
application/x-raster-mrsid; qgis '%s'; description="MrSID raster data"; test=test -n "$DISPLAY"; nametemplate=%s.sid; priority=2
application/x-raster-mif; qgis '%s'; description="MapInfo file"; test=test -n "$DISPLAY"; nametemplate=%s.mif; priority=2
application/x-esri-shape; qgis '%s'; description="ESRI shape file"; test=test -n "$DISPLAY"; nametemplate=%s.shp; priority=2
application/vnd.google-earth.kml+xml; qgis '%s'; description="Google Earth KML"; test=test -n "$DISPLAY"; nametemplate=%s.kml; priority=2
application/vnd.google-earth.kmz; qgis '%s'; description="Google Earth KMZ"; test=test -n "$DISPLAY"; nametemplate=%s.kmz; priority=2
application/geopackage+sqlite3; qgis '%s'; description="OGC GeoPackage"; test=test -n "$DISPLAY"; nametemplate=%s.gpkg; priority=2
application/x-qgis-project; qgis '%s'; description="QGIS Project"; test=test -n "$DISPLAY"; nametemplate=%s.qgs
application/x-qgis-project-container; qgis '%s'; description="QGIS Project"; test=test -n "$DISPLAY"; nametemplate=%s.qgz
application/x-qgis-layer-settings; qgis '%s'; description="QGIS Layer Settings"; test=test -n "$DISPLAY"; nametemplate=%s.qml
@@ -8,6 +8,6 @@ Exec=qgis %F
Terminal=false
StartupNotify=false
Categories=Qt;Education;Science;Geography;
MimeType=application/x-qgis-project;application/x-qgis-project-container;application/x-qgis-layer-settings;application/x-qgis-layer-definition;application/x-qgis-composer-template;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-raster-ecw;application/x-raster-mrsid;application/x-mapinfo-mif;application/x-esri-shape;
MimeType=application/x-qgis-project;application/x-qgis-project-container;application/x-qgis-layer-settings;application/x-qgis-layer-definition;application/x-qgis-composer-template;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-raster-ecw;application/x-raster-mrsid;application/x-mapinfo-mif;application/x-esri-shape;application/vnd.google-earth.kml+xml;application/vnd.google-earth.kmz;application/geopackage+sqlite3;
Keywords=map;globe;postgis;wms;wfs;ogc;osgeo;
StartupWMClass=QGIS3

4 comments on commit ce3ee59

@sebastic

This comment has been minimized.

Copy link
Contributor

@sebastic sebastic replied Jul 4, 2021

The mime-types should also be added to the shared-mime-info data in debian/qgis.xml.

Something like this may suffice:

diff --git a/debian/qgis.xml b/debian/qgis.xml
index c68a938603..733e4e9023 100644
--- a/debian/qgis.xml
+++ b/debian/qgis.xml
@@ -200,4 +200,22 @@
     <glob weight="51" pattern="*.mif"/>
   </mime-type>
 
+  <mime-type type="application/vnd.google-earth.kml+xml">
+    <comment>Keyhole Markup Language data</comment>
+    <icon name="qgis-mime"/>
+    <glob pattern="*.kml"/>
+  </mime-type>
+
+  <mime-type type="application/vnd.google-earth.kmz">
+    <comment>Zipped Keyhole Markup Language data</comment>
+    <icon name="qgis-mime"/>
+    <glob pattern="*.kmz"/>
+  </mime-type>
+
+  <mime-type type="application/geopackage+sqlite3">
+    <comment>GeoPackage data</comment>
+    <icon name="qgis-mime"/>
+    <glob pattern="*.gpkg"/>
+  </mime-type>
+
 </mime-info>
@petterreinholdtsen

This comment has been minimized.

Copy link

@petterreinholdtsen petterreinholdtsen replied Jul 4, 2021

I suspect the mime-type entries should also include sub-class-of, kmz could use <sub-class-of type="application/zip"/>, while kml could use <sub-class-of type="text/xml"/> or <sub-class-of type="application/xml"/> (not sure which).

@sebastic

This comment has been minimized.

Copy link
Contributor

@sebastic sebastic replied Jul 4, 2021

Shouldn't the GeoPackage entry then not also use <sub-class-of type="application/vnd.sqlite3"/>?

Note that several of the mime-types defined in qgis.xml are already present in /usr/share/mime/packages/freedesktop.org.xml:

  <mime-type type="image/tiff">
    <comment>TIFF image</comment>
    <acronym>TIFF</acronym>
    <expanded-acronym>Tagged Image File Format</expanded-acronym>
    <magic priority="50">
      <match type="string" value="MM\x00\x2a" offset="0"/>
      <match type="string" value="II\x2a\x00" offset="0"/>
    </magic>
    <glob pattern="*.tif"/>
    <glob pattern="*.tiff"/>
  </mime-type>
  <mime-type type="image/jpeg">
    <comment>JPEG image</comment>
    <magic priority="50">
      <match type="string" value="\377\330\377" offset="0"/>
      <match type="big16" value="0xffd8" offset="0"/>
    </magic>
    <glob pattern="*.jpg"/>
    <glob pattern="*.jpeg"/>
    <glob pattern="*.jpe"/>
    <alias type="image/pjpeg"/>
  </mime-type>
  <mime-type type="image/jp2">
    <comment>JPEG-2000 JP2 image</comment>
    <acronym>JP2</acronym>
    <expanded-acronym>JPEG-2000</expanded-acronym>
    <alias type="image/jpeg2000"/>
    <alias type="image/jpeg2000-image"/>
    <alias type="image/x-jpeg2000-image"/>
    <magic priority="50">
      <match type="string" mask="0xffffffffffffffffffffffff0000000000000000ffffffff" value="\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a        jp2\x20" offset="0"/>
    </magic>
    <glob pattern="*.jp2"/>
    <glob pattern="*.jpg2"/>
  </mime-type>
  <mime-type type="application/vnd.google-earth.kml+xml">
    <comment>KML geographic data</comment>
    <acronym>KML</acronym>
    <expanded-acronym>Keyhole Markup Language</expanded-acronym>
    <sub-class-of type="application/xml"/>
    <glob pattern="*.kml"/>
    <root-XML namespaceURI="http://www.opengis.net/kml/2.2" localName="kml"/>
  </mime-type>
  <mime-type type="application/vnd.google-earth.kmz">
    <comment>KML geographic compressed data</comment>
    <acronym>KML</acronym>
    <expanded-acronym>Keyhole Markup Language</expanded-acronym>
    <sub-class-of type="application/zip"/>
    <glob pattern="*.kmz"/>
  </mime-type>
@petterreinholdtsen

This comment has been minimized.

Copy link

@petterreinholdtsen petterreinholdtsen replied Jul 4, 2021

Please sign in to comment.