<div class="im" style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font><div style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif">Hi, David!</span></div><div style="font-family:arial;line-height:normal"><span style="color:rgb(34,34,34);font-family:arial,sans-serif"><br></span></div><div style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif">></span><span style="color:rgb(34,34,34);font-family:arial,sans-serif"> </span>> > > Do you think this could be done? Or am I overlooking some difficulty here?<br>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif">> </span>> ><br><span style="color:rgb(34,34,34);font-family:arial,sans-serif">> </span>> > It could easily be done by adding one more function which will group the<br>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif">> </span>> > results from<br><span style="color:rgb(34,34,34);font-family:arial,sans-serif">> </span>> > different groups ("Default Associations", "Added associations", etc).<br>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif">> </span>> > By the way, this functionality is implemented in example in online<br><span style="color:rgb(34,34,34);font-family:arial,sans-serif">> </span>> > documentation.<br>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif">> </span>> </div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">I'm not asking for more functions, but for a different layout in the on-disk</span><br style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">cache :-)</span><br style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><br style="font-family:arial;line-height:normal"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">But yes, this goes together. The most common use case for this library should</span><br style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">require a single function (plus iteration loop) rather than three (plus</span><br style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">iteration loop), and the on-disk cache should be optimized for this use case.</span><br style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><br style="font-family:arial;line-height:normal"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">If the user-preferences-handling code needs to explicitely access "added" and</span><br style="font-family:arial;line-height:normal">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">"removed" lists, it can just use the mimeapps.list files, as it does already.</span></font></div>
<div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><span style="color:rgb(34,34,34);font-family:arial,sans-serif">></span><span style="color:rgb(34,34,34);font-family:arial,sans-serif"> </span><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">So if you want to keep this API in the library, it could just read these files</span></div>
<div><font><span style="color:rgb(34,34,34)">></span><span style="color:rgb(34,34,34)"> </span><span style="font-family:arial">> </span><span style="font-family:arial">directly. Or don't provide it.</span><br style="font-family:arial">
<span style="color:rgb(34,34,34)">> </span><span style="font-family:arial">> </span><span style="font-family:arial">But the goal of the on-disk cache is really to pre-process the data in order</span><br style="font-family:arial">
<span style="color:rgb(34,34,34)">> </span><span style="font-family:arial">> </span><span style="font-family:arial">to make the "which app(s) handle this mimetype" lookup as fast as possible,</span><br style="font-family:arial">
<span style="color:rgb(34,34,34)">> </span><span style="font-family:arial">> </span><span style="font-family:arial">and as simple as possible for developers.</span><br style="font-family:arial"><div style="font-family:arial">
</div></font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font><span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:normal">> </span></font></div>
</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div>> Yes, it definitely is. I will merge trees representing associations of mime types with</div><div>
> "added", "default", "all other" and "removed" lists in the next release (within couple</div><div>> weeks).</div><div><br></div><div><div>Done. I have removed AVL tree responsible for groups in ".list" files. Also, algorithm of</div>
<div>parsing of ".list" files is updated: now it forms an AVL tree ready to lookup a single list</div><div>of applications able to handle given mime type. Of course, format of the binary cache</div><div>became a bit simpler because it lost one AVL tree.</div>
</div><div><br></div><div>repo: <a href="https://github.com/vilkov/libxdg">https://github.com/vilkov/libxdg</a></div><div>tag: <a href="https://github.com/vilkov/libxdg/zipball/rc-0.2.1">https://github.com/vilkov/libxdg/zipball/rc-0.2.1</a></div>
<div>doc: <a href="http://vilkov.github.com/libxdg/">http://vilkov.github.com/libxdg</a></div><div><br></div></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px;background-color:rgb(255,255,255)">
<h3 style="font-family:inherit;font-style:inherit;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;outline-width:0px;outline-style:initial;outline-color:initial;font-weight:inherit;vertical-align:baseline;color:rgb(51,51,51)">
<font>--------------------------------</font></h3></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px;background-color:rgb(255,255,255)"><h3 style="font-family:inherit;font-style:inherit;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;outline-width:0px;outline-style:initial;outline-color:initial;font-weight:inherit;vertical-align:baseline;color:rgb(51,51,51)">
<font>Best regards, Dmitriy.</font></h3></div><br>
<br><br><div class="gmail_quote">2012/7/3 DAV <span dir="ltr"><<a href="mailto:dav.daemon@gmail.com" target="_blank">dav.daemon@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font><div style="font-family:arial;line-height:normal">> > > Do you think this could be done? Or am I overlooking some difficulty here?<br>
> ><br>> > It could easily be done by adding one more function which will group the<br>
> > results from<br>> > different groups ("Default Associations", "Added associations", etc).<br>> > By the way, this functionality is implemented in example in online<br>> > documentation.<br>

> </div><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">I'm not asking for more functions, but for a different layout in the on-disk</span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">cache :-)</span><br style="font-family:arial;line-height:normal"><span style="font-family:arial;line-height:normal">> </span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">But yes, this goes together. The most common use case for this library should</span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">require a single function (plus iteration loop) rather than three (plus</span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">iteration loop), and the on-disk cache should be optimized for this use case.</span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><br style="font-family:arial;line-height:normal"><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">If the user-preferences-handling code needs to explicitely access "added" and</span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">"removed" lists, it can just use the mimeapps.list files, as it does already.</span></font></div>

<div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">So if you want to keep this API in the library, it could just read these files</span></div>

<div><font><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">directly. Or don't provide it.</span><br style="font-family:arial;line-height:normal"><span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">But the goal of the on-disk cache is really to pre-process the data in order</span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">to make the "which app(s) handle this mimetype" lookup as fast as possible,</span><br style="font-family:arial;line-height:normal">

<span style="font-family:arial;line-height:normal">> </span><span style="font-family:arial;line-height:normal">and as simple as possible for developers.</span><br style="font-family:arial;line-height:normal"><div style="font-family:arial;line-height:normal">

</div></font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font><span style="line-height:normal;font-size:small;font-family:arial"><br></span></font></div>
</div><div><div>Yes, it definitely is. I will merge trees representing associations of mime types with</div><div>"added", "default", "all other" and "removed" lists in the next release (within couple</div>

<div>weeks).</div></div><div></div></blockquote></div><br>