<font color="#000000"><font><font face="trebuchet ms,sans-serif">Hi, all!</font></font></font><div><font face="'trebuchet ms', sans-serif">Third release candidate of libxdg is out.</font></div><div><font face="'trebuchet ms', sans-serif"><br>
</font></div><div><font face="'trebuchet ms', sans-serif"><div>Here is the change list:</div><div> - got rid of "int" in cache (replaced by "xdg_uint32_t");</div><div> - added possibility to build the cache for a given directory;</div>
<div> - binary "update-applications-cache" updated according to the previous point;</div><div> - added function "xdg_app_refresh()" for updating loaded data (after initialization</div><div>of the library);</div>
<div> - few bug fixes were made;</div><div> - documentation updated;</div></font></div><div><font face="'trebuchet ms', sans-serif"><br></font></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">22 февраля 2012 г. 14:54 пользователь DAV <span dir="ltr"><<a href="mailto:dav.daemon@gmail.com">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>> I thought the previous discussions led to the conclusion of rather making this<br>> a separate library from xdgmime? I.e. calling it xdgappcache or something, and<br>> removing all the xdg-mime stuff from it?<br>
> I don't mind either way personnally, though.<div><font color="#000000"><font><br></font></font></div></div></div><div><font color="#000000"><font>Yes, you are right. I was working on such feature at the moment of my previous</font></font></div>
<div><font color="#000000"><font>letter. But now it's done. Also I have renamed the library to xdg (libxdg), because</font></font></div><div><font color="#000000"><font>I think this name better reflects the functional of the library.</font></font></div>
<div><font color="#000000"><font><br></font></font></div><div><font color="#000000"><font>So, here is the changes ("</font></font><a href="https://github.com/ZeR0God/libxdg" style="color:rgb(17,85,204)" target="_blank">https://github.com/ZeR0God/libxdg</a>", tag "rc-0.1.2"):</div>
<div><font color="#000000"><font> - first of all, now CMake project</font></font> contains 3 targets (xdg, doc and</div><div>update-applications-cache);</div><div> - CMake flag: BUILD_MIME_SPEC (Build library with "Shared MIME-info</div>
<div><font color="#000000"><font><div>Database");</div><div> - CMake flag: BUILD_DESKTOP_SPEC (Build library with "Desktop Entry</div><div>Specification");</div><div> - CMake flag: BUILD_THEMES_SPEC (Build library with "Icon Theme</div>
<div>Specification");</div><div><div> - CMake flag: BUILD_UPDATE_APPLICATIONS_CACHE (Build executable for</div><div>rebuilding the cache). Note: there won't be target "update-applications-cache" if this</div>
<div>flag is set to false;</div><div> - I've created "FindXDG.cmake" script (it will help to find the library with native</div><div>CMake tools, i.e. "find_package");</div><div><font color="#000000"><font></font></font></div>
- target "install" is working properly.</div><div><br></div><div>You can choose flags to get the library with exact functional you need.</div></font></font></div><div class="im"><div><div><font color="#000000"><font><br>
</font></font></div><div>> I checked out the code, but for easier thinking, do you have a documentation<br>> of the binary cache data format? This is important for the future anyway<br>> because, just like with mime.cache, there will be other implementations<br>
> reading directly from the cache (rather than linking to libxdgappcache).</div><div><font><font color="#222222" face="arial, sans-serif"><br></font></font></div></div></div><div><font color="#222222" face="arial, sans-serif"><div>
I will document this format when I will be documenting internal parts of the library.</div><div>I think it will be third or fourth release candidate.</div></font></div><div><font><font color="#222222" face="arial, sans-serif"><br>
</font></font></div><div><div class="im"><div style="color:rgb(80,0,80)"><font>> One thing I noticed: all the data types in the binary cache should have fixed<br>> size. Using "int" or "long" is just recipe for trouble in the long run<br>
> (portability issues).<br></font></div></div><div><h3 style="line-height:12px;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><br></font></h3><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>Thanks, I will fix it in the next release candidate.</font></div><div class="im"><div style="color:rgb(80,0,80)">
<div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font> </font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>> The executable is all I need personnally. But shouldn't there also be a<br>
> library (for reading the cache), and unit tests using that library?<br>> <br>> This is the best way to ensure that the implementation is correct: a binary<br>> for writing the cache, a library and a unit test for reading from it and<br>
> checking that it's all as expected.<br>> <br>> For parallel with the mime stuff: update-mime-database in shared-mime-info is<br>> the first one, xdgmime is the library and the auto tests in shared-mime-info<br>
> use xdgmime to validate that everything works.<br>> <br>> If "xdgappscache" is made a separate package, it could provide all three,<br>> IMHO.<br></font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px">
<font><br></font></div></div></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>Yes, it is. As I mentioned above, now CMake project contains target "xdg".</font></div>
<div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>Unit tests will be added a little bit later.</font></div><div class="im"><div style="color:rgb(80,0,80)"><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px">
<font><br></font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>> That's cool - they are in the cache too?</font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px">
<font><br></font></div></div></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>Yes, cache contains all data from ".desktop" and ".list" files (and all this</font></div>
<div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>stuff </font>is indexed by using of AVL trees which means the fastest possible</div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px">
access to this data).</div><div class="im"><div style="color:rgb(80,0,80)"><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font><br></font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px">
<font>> Missing feature: taking a path on the command line, to generate the cache for<br>> that path (rather than for /usr/share/applications). Again, much like update-<br>> mime-info :-)<br></font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px">
<font><br></font></div></div></div><div><font color="#222222" face="arial, sans-serif">:) Yep, you're right again. I'm planning to do so for the next release candidate.</font></div><div class="im"><div style="color:rgb(80,0,80)">
<div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font><br></font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font>> This is necessary in order to allow local desktop files too (e.g.<br>
> ~/.local/share/applications). And the lib has to read from all xdg data dirs<br>> of course.</font></div><div style="font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif;line-height:12px"><font><br></font></div>
</div></div></div></div><div class="gmail_quote"><span>Yes, lib does and I will fix the cache for the next release candidate.</span></div><div class="gmail_quote"><br></div><div class="gmail_quote"><div style="line-height:12px;font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif">
<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="line-height:12px;font-family:Arial,Helvetica,'Nimbus Sans L',sans-serif"><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><font><br></font></div></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">
19 февраля 2012 г. 14:39 пользователь David Faure <span dir="ltr"><<a href="mailto:faure@kde.org" target="_blank">faure@kde.org</a>></span> написал:<div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Friday 17 February 2012 13:38:34 DAV wrote:<br>
> Hi all,<br>
> I'm glad to announce the first release candidate of "exdgmime" library.<br>
<br>
</div>I thought the previous discussions led to the conclusion of rather making this<br>
a separate library from xdgmime? I.e. calling it xdgappcache or something, and<br>
removing all the xdg-mime stuff from it?<br>
I don't mind either way personnally, though.<br>
<div><br>
> So, here is the changes:<br>
><br>
> - serialization/deserialization of content of ".desktop" and<br>
> ".list" files (with indexes) into a binary cache file which can be mmap'ed<br>
> without need to rescan whole system directories. Reading of this cache<br>
> file is done without a single allocation of memory (just update pointers<br>
> in mmap'ed memory);<br>
<br>
</div>I checked out the code, but for easier thinking, do you have a documentation<br>
of the binary cache data format? This is important for the future anyway<br>
because, just like with mime.cache, there will be other implementations<br>
reading directly from the cache (rather than linking to libxdgappcache).<br>
<br>
One thing I noticed: all the data types in the binary cache should have fixed<br>
size. Using "int" or "long" is just recipe for trouble in the long run<br>
(portability issues).<br>
<br>
int read_version(void **memory)<br>
{<br>
int version = (*(int *)(*memory));<br>
<br>
(*memory) += sizeof(int);<br>
<br>
return version;<br>
}<br>
<br>
The mime.cache format is all made from "card16", "card32" and strings.<br>
<div><br>
> - a cmake project configuration file which contains two targets:<br>
> "update-applications-cache" (it is executable which rebuilds the cache) and<br>
> "doc" (generates Doxygen documentation);<br>
<br>
</div>The executable is all I need personnally. But shouldn't there also be a<br>
library (for reading the cache), and unit tests using that library?<br>
<br>
This is the best way to ensure that the implementation is correct: a binary<br>
for writing the cache, a library and a unit test for reading from it and<br>
checking that it's all as expected.<br>
<br>
For parallel with the mime stuff: update-mime-database in shared-mime-info is<br>
the first one, xdgmime is the library and the auto tests in shared-mime-info<br>
use xdgmime to validate that everything works.<br>
<br>
If "xdgappscache" is made a separate package, it could provide all three,<br>
IMHO.<br>
<div><br>
> - a convinient access to localized values of entries of a ".desktop" files.<br>
<br>
</div>That's cool - they are in the cache too?<br>
<br>
That's something I really miss in mime.cache, for easier deployment (I'd like<br>
to only deploy the cache, on systems without shared-mime-info installed).<br>
<br>
Thinking about it, it's less important with desktop files. We can just open the<br>
desktop file to read the translated comment, the point of the app cache is<br>
really the querying by mimetype... but OK if it's available, that certainly<br>
makes things faster.<br>
<br>
<br>
Missing feature: taking a path on the command line, to generate the cache for<br>
that path (rather than for /usr/share/applications). Again, much like update-<br>
mime-info :-)<br>
This is necessary in order to allow local desktop files too (e.g.<br>
~/.local/share/applications). And the lib has to read from all xdg data dirs<br>
of course.<br>
<span><font color="#888888"><br>
--<br>
David Faure, <a href="mailto:faure@kde.org" target="_blank">faure@kde.org</a>, <a href="http://www.davidfaure.fr" target="_blank">http://www.davidfaure.fr</a><br>
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5<br>
<br>
</font></span></blockquote></div></div></div><br>
</blockquote></div><br>