TemplatePreview - cleanup needed!

Miha Čančula miha at noughmad.eu
Wed Oct 31 16:22:15 UTC 2012


2012/10/31 Andreas Pakulat <apaku at gmx.de>

> 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
>
Unfortunately, the context here are not installed files, but rather a
development project (or folder) containing a .desktop file and some
template files. In order to provide a context menu action, it is really
necessary to figure out whether a file could be a template without reading
and rendering it.

Regarding the rest, I got rid of the temporary file altogether, focused
only on text documents, and added a message widget for reporting
errors/information. I'll post a review request tomorrow.

>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121031/29577aa5/attachment.html>


More information about the KDevelop-devel mailing list