TemplatePreview - cleanup needed!

Andreas Pakulat apaku at gmx.de
Wed Oct 31 14:56:17 UTC 2012


Hi,

On Wed, Oct 31, 2012 at 2:14 PM, Miha Čančula <miha at noughmad.eu> wrote:
> 2012/10/30 Milian Wolff <mail at milianw.de>
>> I just had to fix https://bugs.kde.org/show_bug.cgi?id=309271 and stumbled
>> upon that file the first time. This needs some serious cleanup imo:
>>
>> a) figure out whether the file is a template or not, before trying to read
>> its
>> contents and rendering it. couldn#t you look for a .desktop file?
>> b) analogous to b, automatically deduce whether we look at a project or
>> file
>> template
>
> Hello, I've just started fixing this. I agree the plugin is in a sad state.
> However, I'm not sure if searching for a .desktop file is easier than
> rendering a document. Then we have to read the desktop file to determine if
> it's a template or not.

I don't know too much of the context here, but for .desktop files
covered by the system-cache (i.e. stuff in the share/services and
share/apps directories (IIRC)) KDE gives you a query-language to
efficiently find all desktop files matching some criteria. This is how
KDevPlatform finds its plugins by just saying "All desktop files which
have KDevelop/Plugin in the type field" or something like that.

Andreas




More information about the KDevelop-devel mailing list