[Qgis-developer] Keeping line breaks in QGIS expressions

Andreas Neumann a.neumann at carto.net
Wed Sep 24 23:53:25 PDT 2014


Hi,

It would be wonderful if someone could work on preserving formatting and
add comment support for the expressions in the QGIS 2.7 dev phase.

I can try and help to find some funding, if a dev is interested in
implementing this and can provide a quote.

Andreas

Am 24.09.2014 19:44, schrieb Matthias Kuhn:
> Hi Martin
> 
> On 24.09.2014 21:42, Martin Dobias wrote:
>>> I would propose the following:
>>>
>>>   - QgsExpression::dump() should always recreate the string from the
>>> data structure
>>>   - save the original expression string and return it with
>>> QgsExpression::expression()
>>>   - unless the expression is modified by other means, which will set the
>>> saved string to a NULL string in which case QgsExpression::expression()
>>> will be forwarded to QgsExpression::dump()
>> This logic makes sense to me. For the third item I would just suggest
>> that any modification would immediately regenerate the saved
>> expression string using dump() - so there would be no forwarding from
>> expression() to dump().
> 
> Or created on first request and then buffered for subsequent use. This
> might save some CPU cycles and memory once in a while :-)
> 
> Cheers,
> Matthias
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 



More information about the Qgis-developer mailing list