<div dir="ltr">Hi Kevin. I'm glad to see KDE developer here because i'm KDE fan for many years :)<div>But this KDE MIME-support code hardly depend from other KDE stuff, isn't it?</div><div>I need "pure" Qt code - this is our software client requirement :/</div>
<div>So i'm wrote CMimeDatabase class. And just want to make it fully compliant with freedesktop standart.</div><div><br></div><div><div>(see <a href="http://api.kde.org/4.0-api/kdelibs-apidocs/kdecore/html/kmimetype_8h_source.html">http://api.kde.org/4.0-api/kdelibs-apidocs/kdecore/html/kmimetype_8h_source.html</a> - KUrl, KServiceType etc.)</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/14 Kevin Krammer <span dir="ltr"><<a href="mailto:krammer@kde.org" target="_blank">krammer@kde.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Friday, 2013-12-13, 20:11:34, Jerome Leclanche wrote:<br>
> There is a Qt 4 port of this.<br>
<br>
</div>And there should also be the original Qt4 based code in the kdelibs<br>
repository.<br>
<br>
Cheers,<br>
Kevin<br>
<div><div class="h5"><br>
> As for windows support... I've been down that road, trying to provide<br>
> it. Windows' feature set doesn't even sort of come close; it only<br>
> provides real mime types for a limited set of registered extensions,<br>
> and it doesn't provide any of the very useful features such as<br>
> subclassing, etc. In the end, I gave up and am only providing<br>
> xdg-based mime types. I think Qt made an excellent choice in providing<br>
> the xdg database itself. But if you choose against that, good luck.<br>
><br>
> Anyway you can have a look at my python-based mimetype lib. Magic<br>
> matches are implemented on line 192 onwards.<br>
><br>
> <a href="https://github.com/Adys/python-xdg/blob/master/xdg/mime.py" target="_blank">https://github.com/Adys/python-xdg/blob/master/xdg/mime.py</a><br>
><br>
> J. Leclanche<br>
><br>
><br>
> On Fri, Dec 13, 2013 at 7:56 PM, Alexander Kamyshnikov<br>
><br>
> <<a href="mailto:axill777@gmail.com">axill777@gmail.com</a>> wrote:<br>
> > Yes, i had. But i decided to write my own implementation because:<br>
> > a) my project is forced to use Qt4 only (clients have very old versions of<br>
> > modified Red Hat with XDG_DATA_DIRS undefined);<br>
> > b) Windows support (through reading registry HKCR/.ext keys) is required;<br>
> > c) I'm very curious :)<br>
> ><br>
> > You think i'm should look deeply at the qmimedatabase.cpp however?<br>
> ><br>
> ><br>
> > 2013/12/13 Jerome Leclanche <<a href="mailto:adys.wh@gmail.com">adys.wh@gmail.com</a>><br>
> ><br>
> >> Have you had a look at the Qt 5 mimetype module?<br>
> >><br>
> >> <a href="http://qt-project.org/doc/qt-5.0/qtcore/qmimedatabase.html" target="_blank">http://qt-project.org/doc/qt-5.0/qtcore/qmimedatabase.html</a><br>
> >> J. Leclanche<br>
> >><br>
> >><br>
> >> On Fri, Dec 13, 2013 at 7:35 PM, Alexander Kamyshnikov<br>
> >><br>
> >> <<a href="mailto:axill777@gmail.com">axill777@gmail.com</a>> wrote:<br>
> >> > Hi all!<br>
> >> > I'm developing the implementation of MIME database in C++/Qt for one<br>
> >> > commercial program (requirement managment tool, if one will be<br>
> >> > interested).<br>
> >> > So my question is: the format of magic values to compare file header<br>
> >> > data<br>
> >> > with is not specified exactly in the spec. I mean the magic/match/value<br>
> >> > attribute.<br>
> >> > What exactly mean those magic strings from<br>
> >> > /usr/share/mime/packages/freedesktop.org.xml from my Kubuntu?<br>
> >> > 1) "\1\9"<br>
> >> > 2) "\376\067\0\043"<br>
> >> > 3) "\x8AMNG\x0D\x0A\x1A\x0A"<br>
> >> > Second is looks like octal number in C notation, third - hexadecimal,<br>
> >> > but<br>
> >> > about first i'm not sure. It is just "usual" decimal value?<br>
> >> > What format exactly should use magic values?<br>
> >> > Thanks for your help. WBR, Alexander<br>
> >> ><br>
> >> > P.S. Spec i'm using living here:<br>
> >> ><br>
> >> > <a href="http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info" target="_blank">http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info</a><br>
</div></div>> >> > -spec-latest.html#id2661973 P.S. <match> items can be nested. But i<br>
<div class="HOEnZb"><div class="h5">> >> > can't find yet the clear way to implement their storage<br>
> >> > programmatically. Some kind of tree, or reverse polish notation should<br>
> >> > be used here? nevermind<br>
> >> ><br>
> >> > _______________________________________________<br>
> >> > xdg mailing list<br>
> >> > <a href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a><br>
> >> > <a href="http://lists.freedesktop.org/mailman/listinfo/xdg" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xdg</a><br>
><br>
> _______________________________________________<br>
> xdg mailing list<br>
> <a href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/xdg" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xdg</a><br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Kevin Krammer, KDE developer, xdg-utils developer<br>
KDE user support, developer mentoring<br>
</font></span><br>_______________________________________________<br>
xdg mailing list<br>
<a href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/xdg" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xdg</a><br>
<br></blockquote></div><br></div>