Use the official IANA MIME-type and extension

This commit is contained in:
Martin Tůma 2019-02-26 22:20:12 +01:00
parent c3df78a455
commit 5ccb93bd59
3 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ {
"Keys": [ "pbf" ], "Keys": [ "mvt" ],
"MimeTypes": [ "image/pbf" ] "MimeTypes": [ "application/vnd.mapbox-vector-tile" ]
} }

9
pkg/pbfplugin.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.mapbox-vector-tile">
<comment>Mapbox Vector Tile</comment>
<sub-class-of type="application/octet-stream"/>
<generic-icon name="application/octet-stream"/>
<glob pattern="*.mvt"/>
</mime-type>
</mime-info>

View File

@ -21,7 +21,7 @@ QImageIOPlugin::Capabilities PBFPlugin::capabilities(QIODevice *device,
const QByteArray &format) const const QByteArray &format) const
{ {
if (device == 0) if (device == 0)
return (format == "pbf") ? Capabilities(CanRead) : Capabilities(); return (format == "mvt") ? Capabilities(CanRead) : Capabilities();
else else
return (device->isReadable() && PBFHandler::canRead(device)) return (device->isReadable() && PBFHandler::canRead(device))
? Capabilities(CanRead) : Capabilities(); ? Capabilities(CanRead) : Capabilities();