[Development] Qml mime types
Mohamed Fawzi
Fawzi.Mohamed at digia.com
Mon Jan 7 11:21:38 CET 2013
I would like to close the discussion if possible.
Is the following hierarchy acceptable?
text/plain; charset=utf-8
text/vnd.qt.qml => a file adhering to the QML grammar/syntax .qml suffix
text/vnd.qt.qtquick1+qml => .qml suffix + magic 'import QtQuick 1.' within the first 256 chars
text/vnd.qt.qtquick2+qml => .qml suffix + magic 'import QtQuick 2.' within the first 256 chars
text/vnd.qt.qbs+qml => .qbs suffix
text/vnd.qt.meta-info+qml => .qmltypes suffix
text/vnd.qt.project+qml => .qmlproject suffix
It is not completely fool proof, but should work with the recommended matching algorithm, and as text/vnd.qt.qml come lexographically before text/vnd.qt.qtquick* it should be the default choice if no match happens (again in the normal case).
Different extensions can be easily added in the future, and the hierarchy seems sane.
Fawzi
________________________________________
From: Koehne Kai
Sent: Thursday, December 20, 2012 12:32 PM
To: Mohamed Fawzi; Alan Alpert
Cc: faure at kde.org; development at qt-project.org; Knoll Lars
Subject: RE: [Development] Qml mime types
> Subject: Re: [Development] Qml mime types
>
> Do I understand you correctly that you prefer my initial proposal with text/vnd.qt.qml at the top? or you want
> qml-base and qml as subtype?
> Assuming you meant the first option we get to
>
> text/plain; charset=utf-8
> text/vnd.qt.qml => a file written in the qml language
> text/vnd.qt.qtquick+qml => .qml file like now: qtquick
> text/vnd.qt.qbs+qml => .qbs files
> text/vnd.qt.meta-info+qml => .qmltypes files
> text/vnd.qt.project+qml => .qmlproject files
I like the hierachy in general,but would go for a split between text/vnd/qt.qtquick1.qml and text/vnd.qt.qtquick2.qml from the start - if you're interested in whether a file just confirms to the language grammar (text/vnd.qt.qml), or is actually a Qt Quick (GUI) file then you'll also be interested in knowing whether it's Qt Quick1 or Qt Quick 2. But I also agree with Lars and Alan that you shouldn't implicitly assume that a '.qml' file is qtquick. So here is my proposal:
text/plain; charset=utf-8
text/vnd.qt.qml => a file adhering to the QML grammar/syntax, .qml suffix
text/vnd.qt.qtquick1+qml => .qml suffix + heuristics, e.g. 'grep import QtQuick 1.'
text/vnd.qt.qtquick2+qml => .qml suffix + heuristics, e.g. 'grep import QtQuick 2.'
text/vnd.qt.qbs+qml => .qbs suffix
text/vnd.qt.meta-info+qml => .qmltypes suffix
text/vnd.qt.project+qml => .qmlproject suffix
But I'm not into mimetypes at all, so maybe I understand something wrong ...
(Btw, do .qbs files actually strictly adhere to the QML grammar? I remember discussions about having special syntax for it's use case, but don't know the outcome of it.)
Regards
Kai
More information about the Development
mailing list