TemplatePreview - cleanup needed!

Milian Wolff mail at milianw.de
Tue Oct 30 22:11:12 UTC 2012


Hey Miha!

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
c) only use one temporary file (create it on the stack in the class) and don't 
recreate new ones all the time
d) only operate on text documents, i.e. make m_currentDocument a KTextEditor 
Document
e) rename m_document to m_preview or similar to make clearer what it does
f) use a stacked widget or similar to show a static error message and also 
include a link to the template/project documentation instead of using the text 
preview for that
g) use TrimEmptyLines as default which is afaik also used for the templates, 
no?
h) add a context menu action for template files "preview template" that shows 
this toolview, otherwise its just not findable
i) add the preview to the config dialog somehow

and probably more
-- 
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/20121030/663ce4ed/attachment.sig>


More information about the KDevelop-devel mailing list