Review Request 123670: Less complicated look up of template locations, fix referencing templates in Author & Krita Sketch/Gemini

Friedrich W. H. Kossebau kossebau at kde.org
Wed May 13 21:45:43 BST 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123670/
-----------------------------------------------------------

(Updated May 13, 2015, 8:45 p.m.)


Status
------

This change has been marked as submitted.


Review request for Calligra, Camilla Boemann, Inge Wallin, Boudewijn Rempt, and Thorsten Zachmann.


Changes
-------

Submitted with commit 8e51b661d12064f9cd77cc30aaa908fecf4e0d97 by Friedrich W. H. Kossebau to branch calligra/2.9.


Repository: calligra


Description
-------

Template folders are currently found by a more complicated approach:

* part factory adds (and only to the factory's componentdata) a resource type with the respective resource path, e.g. "words_template" and "words/templates/"
* part itself sets a `templateType`, which actually is the resource type id for its templates
* code that wants to lookup matching templates first queries the part for the resource type id, only then queries the standard dirs for the templates (assuming that the maincomponent also is the one which has that resource type set)

Though two spots in `KoApplication` and `KoPart` (and their `Kis` counterparts) ignore that and calculate themselves the matching templates locations, using the appname. Which will fail at least with Author and Krita Gemini/Sketch.

Attached patch proposes to change that:
instead of noting the template locations for a document type to the standarddirs of the componentdata of the respecitve part factory, and setting a look-up id with the created parts, the template locations are set directly in the parts and queryable from them.

Advantages:

* Less complex and will also be better portable to Qt5/KF5.
* Also fixes the code broken with appnames not matching the prefix of the template locations.

Not perfectly happy with this yet, but possibly a step in direction of a better solution.


Diffs
-----

  flow/part/FlowFactory.cpp a3b4b14 
  flow/part/FlowPart.cpp 22f67f4 
  gemini/TemplatesModel.cpp c53a64d 
  karbon/ui/KarbonFactory.cpp be55d4c 
  karbon/ui/KarbonPart.cpp 6cfc9e3 
  krita/ui/KisApplication.cpp af59d90 
  krita/ui/KisOpenPane.h 7725227 
  krita/ui/KisOpenPane.cpp bf89caa 
  krita/ui/KisPart.h 77ccf5f 
  krita/ui/KisPart.cpp 5f7d625 
  krita/ui/KisTemplateCreateDia.h f6e2874 
  krita/ui/KisTemplateCreateDia.cpp 08fb546 
  krita/ui/KisTemplateTree.h 7aa7119 
  krita/ui/KisTemplateTree.cpp b658330 
  krita/ui/kis_factory2.cc 3a85bcf 
  libs/main/KoApplication.cpp 189cbe5 
  libs/main/KoOpenPane.h 009b38d 
  libs/main/KoOpenPane.cpp 752ea15 
  libs/main/KoPart.h 491da0a 
  libs/main/KoPart.cpp 59f8140 
  libs/main/KoTemplateCreateDia.h d20937f 
  libs/main/KoTemplateCreateDia.cpp e65a65b6 
  libs/main/KoTemplateTree.h 16f3957 
  libs/main/KoTemplateTree.cpp c2b1a4d 
  plan/kptfactory.cpp 58138b5 
  plan/kptpart.cpp fe285a9 
  plan/kptview.cpp ad18ccc 
  sheets/part/Factory.cpp dc448ac 
  sheets/part/Part.cpp 26dbb5e 
  sheets/part/View.cpp bf4b239 
  stage/part/KPrFactory.cpp be7b861 
  stage/part/KPrPart.cpp f8ae251 
  words/part/KWFactory.cpp cb1f131 
  words/part/KWPart.cpp 3d3013f 
  words/part/KWView.cpp 3628cae 
  words/part/author/CAuFactory.cpp 07c482a 
  words/part/author/CAuPart.cpp 5bd43fb 

Diff: https://git.reviewboard.kde.org/r/123670/diff/


Testing
-------


Thanks,

Friedrich W. H. Kossebau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20150513/aa00da15/attachment.htm>


More information about the calligra-devel mailing list