Skip to content

Commit

Permalink
include geopackage and kml in .desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 3, 2021
1 parent ec374d5 commit ce3ee59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions debian/qgis.mime
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion linux/org.qgis.qgis.desktop.in
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

@sebastic sebastic commented on ce3ee59 Jul 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

@petterreinholdtsen petterreinholdtsen commented on ce3ee59 Jul 4, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.