On 27 February 2016 at 19:26, Dirk Hohndel <[email protected]> wrote: > On Sat, Feb 27, 2016 at 02:22:34PM -0300, Tomaz Canabrava wrote: >> I think I'll add it with a warning message to change to the new behavior >> when the user uses it the old way. > > I really don't like breaking user visible behavior like this, Tomaz. > > Can we pre-process the HTML files and replace the old syntax with the new > one? >
looking at the Grantlee API this might require more effort than adding the extra DiveObjectHelper.h meta properties. we are currently using Grantlee's Engine class to load the files directly via loadByName(). subsurface/desktop-widgets/templatelayout.cpp -> TemplateLayout::generate() http://www.grantlee.org/apidox/classGrantlee_1_1Engine.html#ac09320491850cd400b49778e9933da8e the alternative to construct a Template object seems to be loading the files manually (e.g. via QFile) and then calling Engine::newTemplate(), where the input can be processed with some QString::replace() calls (e.g. dive.weight1 -> dive.weights.1") to solve the variable breakage. this is prone to unexpected errors as we enter untested territory of the Grantlee API, at least by me. but the benefits of this are quite good as we add a pre-processing stage over the HTML template and don't inflate the DiveObjectHelper with the extra overhead. still, i would go with the DiveObjectHelper.h meta properties to be on the safe side. lubomir -- _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
