D10363: [KIO] Add support for XDG_TEMPLATES_DIR in KNewFileMenu

Marijo Mustac noreply at phabricator.kde.org
Thu Feb 8 08:20:18 UTC 2018


mmustac added a comment.


  @dfaure Thank you for your answer :-)
  As I am still at the beginnings I am really grateful for such constructive and valuable feedback like yours it helps me to become better and improve my code.
  
  Regarding your points:
  First of all I agree that a nice name istead of a simple file name is much better on the other side there could only be one template with this name and if this one is choosen very well then it's hard to guess that this template is for but I think this shouldn't be the case so often.
  When I started my journey with Linux it begin with Gnome2, over the time I moved to Gnome3 but had more and more issues and so I switched to KDE and Plasma then I read an article about the early 5.0 versions, ssaw some schreenshots and felt like: You have to use this, it's beautiful! (I never liked how oxygen looked like and as teen and linux noob in the past I didn't even know how to change the look and so never took a deeper look into the worlf od KDE ... what a shame) Du shorten the things a little bit ... I liked the way templates are handled in Gnome, you just put your custom files into the folder and they appear in the menu, even with the folder hirarchy if you had one und this is something I missed a lot in the beginning when I switched to Plasma. Until a few days I even don't know that a customazation was possible at all ^^
  I was thinking about a display name which gets the name for the mimetipe and adds the file name to it, if this is possible so get something like: "HTML FIle: StartPage.html"
  
  Then you have reservations about file support in KDE dirs and that's okay I think. This patch adds no support for "normal" files and I don't plan to add it to this revision. Maybe a second patch will follow which enables this feature again, but I didn't achive anything that worked correct until now. But lets move forward, should I be able to make this happen I could limit this support to the local template folder which does make a lot of sense for me too.
  
  The reason I added this to the installedTemplates was that I can then easiely use the KDirWatch and new files would be detected automatically which is important because otherwise the whole function does not make sense for me.
  At least I don't know any and was not able to find something. If there would be something it would be great to addapt it, because a great workflow would be:
  Drag'n Drop a file (or create a new one) to the template dir
  A dialog would open where the user can enter a nice name, maybe a comment also and after that the local file would be moved to an .source dir and the .desktop file would be greated on the fly like you said
  This would be awesome :)
  
  I will work on your improvements regarding the code. Most of them I didn't know I took a look and similar code, searched in the documentation of QT and just wanted to make it safe and clean but great if I can get rid of most of them which will make it even simpler ;-)
  Just one note for this point:
  
  > the 2nd arg isn't necessary, just do line.mid(19)
  
  I can't get rid of these because a normal entry in the user-dirs.dirs looks like: XDG_TEMPLATES_DIR="$HOME/Templates" so I have to remove the " before and at the end of the path.
  
  Sorry for the wall of text ^^

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10363

To: mmustac, #frameworks, dfaure
Cc: broulik, ngraham, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180208/21da2b74/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list