TemplatePreview - cleanup needed!

Milian Wolff mail at milianw.de
Thu Nov 1 15:23:51 UTC 2012


On Wednesday 31 October 2012 17:22:15 Miha Čančula wrote:
> 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.

You can look for a .desktop file that references this file, and based on that 
figure out what it is - no?

> 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.

Jup, commented already. Nice work, but try to improve it a bit more still.
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121101/e94fa19d/attachment.sig>


More information about the KDevelop-devel mailing list