<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 17, 2014 at 12:24 AM, Milian Wolff <span dir="ltr"><<a href="mailto:mail@milianw.de" target="_blank">mail@milianw.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sunday 16 November 2014 23:52:25 Milian Wolff wrote:<br>
> Hello all!<br>
><br>
> KDevelop is currently bitten hard by a bug/limitation in desktoptojson. It<br>
> does not actually understand the .desktop files and custom properties get<br>
> converted to plain JSON strings. Looking at the sources it's also clear why,<br>
> only a selected list of .desktop properties is interpreted as lists.<br>
><br>
> We have a custom kdevelopplugin.desktop file that describes our custom<br>
> properties via something like:<br>
><br>
> [Desktop Entry]<br>
> Type=ServiceType<br>
> X-KDE-ServiceType=KDevelop/Plugin<br>
> X-KDE-Derived=KPluginInfo<br>
> Name=KDevelop Plugin<br>
> ...<br>
> [PropertyDef::X-KDevelop-Interfaces]<br>
> Type=QStringList<br>
> ...<br>
><br>
> To me it looks like I'll have to add support for such files to<br>
> desktoptojson. But I wonder: Where was/is the code for the above files (how<br>
> are they called?)?<br>
<br>
</span>Apparently these are KServiceType's and the code can be found in kservice. In<br>
kservice.cpp's KServicePrivate::property we see code like this:<br>
<br>
// No luck, let's ask KServiceTypeFactory what the type of this property<br>
// is supposed to be.<br>
// ######### this looks in all servicetypes, not just the ones this service<br>
// supports!<br>
KServiceTypeFactory::self()->findPropertyTypeByName(...)<br>
<br>
Fine, I could add similar code to desktoptojson, but:<br>
<span class=""><br>
> Since desktoptojson will be called for the plugins we ship in KDevplatform,<br>
> how would/could I make desktoptojson "know" about the kdevelopplugin.desktop<br>
> file without it being installed yet?<br>
<br>
</span>that would not work here as our service type is still unknown to kbuildsycoca!<br>
<span class=""><br>
> Or can we nowadays write the .json files directly, i.e. can scripty/ki18n<br>
> cope with them nowadays?<br>
<br>
</span>So, any chance we can use .json directly here?<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Hi,</div><div>I guess a solution would be to be able to provide the servicetype file as an argument to desktoptojson?</div><div>Also given how the plan is to move away from kbuildsycoca database for these files (no?) maybe it would make sense to have an alternative way to look them up by path?</div><div><br></div><div>Aleix</div></div></div></div>