Skip to content

Commit

Permalink
Merge pull request #4557 from m-kuhn/expressionModulaizing
Browse files Browse the repository at this point in the history
Modularizing the expression engine file structure and some cleanup
  • Loading branch information
m-kuhn committed May 19, 2017
2 parents d7b952b + 24b16c5 commit fe2350c
Show file tree
Hide file tree
Showing 118 changed files with 11,111 additions and 10,448 deletions.
2 changes: 2 additions & 0 deletions doc/api_break.dox
Expand Up @@ -1066,6 +1066,8 @@ version instead.
- acceptVisitor() has been removed
- QgsExpression::referencedColumns() returns QSet<QString> instead of QStringList
- QgsExpression::Node::referencedColumns() returns QSet<QString> instead of QStringList
- `QgsExpression::Node` was renamed to `QgsExpressionNode`
- `QgsExpression::Function` was renamed to `QgsExpressionFunction`


QgsExpression::Function {#qgis_api_break_3_0_QgsExpression_Function}
Expand Down
63 changes: 31 additions & 32 deletions python/CMakeLists.txt
Expand Up @@ -93,38 +93,37 @@ INCLUDE_DIRECTORIES(SYSTEM
${SQLITE3_INCLUDE_DIR}
)
INCLUDE_DIRECTORIES(
../src/core
../src/core/annotations
../src/core/auth
../src/core/pal
../src/core/composer
../src/core/diagram
../src/core/effects
../src/core/fieldformatter
../src/core/dxf
../src/core/geometry
../src/core/gps
../src/core/layertree
../src/core/metadata
../src/core/processing
../src/core/providers
../src/core/providers/memory
../src/core/raster
../src/core/scalebar
../src/core/symbology-ng

../src/gui
../src/gui/symbology-ng
../src/gui/raster
../src/gui/attributetable
../src/gui/auth
../src/gui/editorwidgets
../src/gui/editorwidgets/core
../src/gui/effects
../src/gui/layertree
../src/gui/locator

../src/plugins
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/annotations
${CMAKE_SOURCE_DIR}/src/core/auth
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/pal
${CMAKE_SOURCE_DIR}/src/core/composer
${CMAKE_SOURCE_DIR}/src/core/diagram
${CMAKE_SOURCE_DIR}/src/core/effects
${CMAKE_SOURCE_DIR}/src/core/fieldformatter
${CMAKE_SOURCE_DIR}/src/core/dxf
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/gps
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/processing
${CMAKE_SOURCE_DIR}/src/core/providers
${CMAKE_SOURCE_DIR}/src/core/providers/memory
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui/raster
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
${CMAKE_SOURCE_DIR}/src/gui/effects
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/gui/locator
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${CMAKE_BINARY_DIR}/src/core
Expand Down
6 changes: 3 additions & 3 deletions python/core/__init__.py
Expand Up @@ -71,10 +71,10 @@ def myfunc(values, *args):
:param usesgeometry:
:return:
"""
class QgsExpressionFunction(QgsExpression.Function):
class QgsPyExpressionFunction(QgsExpressionFunction):

def __init__(self, func, name, args, group, helptext='', usesGeometry=True, referencedColumns=QgsFeatureRequest.ALL_ATTRIBUTES, expandargs=False):
QgsExpression.Function.__init__(self, name, args, group, helptext)
QgsExpressionFunction.__init__(self, name, args, group, helptext)
self.function = func
self.expandargs = expandargs
self.uses_geometry = usesGeometry
Expand Down Expand Up @@ -132,7 +132,7 @@ def referencedColumns(self, node):

function.__name__ = name
helptext = helptemplate.safe_substitute(name=name, doc=helptext)
f = QgsExpressionFunction(function, name, arg_count, group, helptext, usesgeometry, referenced_columns, expandargs)
f = QgsPyExpressionFunction(function, name, arg_count, group, helptext, usesgeometry, referenced_columns, expandargs)

# This doesn't really make any sense here but does when used from a decorator context
# so it can stay.
Expand Down
6 changes: 5 additions & 1 deletion python/core/core.sip
Expand Up @@ -49,7 +49,6 @@
%Include qgseditorwidgetsetup.sip
%Include qgsellipsoidutils.sip
%Include qgserror.sip
%Include qgsexpression.sip
%Include qgsexpressioncontext.sip
%Include qgsexpressioncontextgenerator.sip
%Include qgsfeature.sip
Expand Down Expand Up @@ -403,3 +402,8 @@
%Include geometry/qgstriangle.sip
%Include geometry/qgswkbtypes.sip
%Include geometry/qgswkbptr.sip

%Include expression/qgsexpression.sip
%Include expression/qgsexpressionnodeimpl.sip
%Include expression/qgsexpressionnode.sip
%Include expression/qgsexpressionfunction.sip

0 comments on commit fe2350c

Please sign in to comment.