Skip to content
Permalink
Browse files

Merge branch 'master' into fix_memleaks_qgsstyle

  • Loading branch information
rouault committed Jun 3, 2018
2 parents b21701b + bb2e15c commit d5afc71adf227f693237701bf7d36d3d3f655123
Showing with 427 additions and 236 deletions.
  1. +10 −1 python/CMakeLists.txt
  2. 0 python/analysis/{__init__.py → __init__.py.in}
  3. +4 −0 python/analysis/auto_additions/__init__.py
  4. +0 −35 python/core/{__init__.py → __init__.py.in}
  5. +4 −0 python/core/auto_additions/__init__.py
  6. +2 −0 python/core/auto_additions/qgsabstractgeometry.py
  7. +2 −0 python/core/auto_additions/qgsauthmanager.py
  8. +4 −0 python/core/auto_additions/qgsdataitem.py
  9. +2 −0 python/core/auto_additions/qgsdataprovider.py
  10. +2 −0 python/core/auto_additions/qgsdatasourceuri.py
  11. +2 −0 python/core/auto_additions/qgsdefaultvalue.py
  12. +3 −0 python/core/auto_additions/qgsfieldproxymodel.py
  13. +4 −0 python/core/auto_additions/qgsgeometry.py
  14. +3 −0 python/core/auto_additions/qgsmaplayerproxymodel.py
  15. +2 −0 python/core/auto_additions/qgsnetworkcontentfetcherregistry.py
  16. +2 −0 python/core/auto_additions/qgsrasterprojector.py
  17. +3 −0 python/core/auto_additions/qgssnappingconfig.py
  18. +2 −0 python/core/auto_additions/qgstolerance.py
  19. +6 −0 python/core/auto_additions/qgsunittypes.py
  20. +5 −0 python/core/auto_additions/qgsvectorsimplifymethod.py
  21. +3 −0 python/core/auto_generated/auth/qgsauthmanager.sip.in
  22. +0 −1 python/core/auto_generated/qgsdefaultvalue.sip.in
  23. +0 −49 python/gui/__init__.py
  24. +11 −6 python/{core/additions/qgsdefaultvalue.py → gui/__init__.py.in}
  25. +4 −0 python/gui/auto_additions/__init__.py
  26. +3 −0 python/gui/auto_additions/qgsadvanceddigitizingdockwidget.py
  27. +3 −0 python/gui/auto_additions/qgsattributetablefiltermodel.py
  28. +2 −0 python/gui/auto_additions/qgsauthsettingswidget.py
  29. +2 −0 python/gui/auto_additions/qgscolorbutton.py
  30. +2 −0 python/gui/auto_additions/qgscolorwidgets.py
  31. +2 −0 python/gui/auto_additions/qgsdualview.py
  32. +2 −0 python/gui/auto_additions/qgsfilterlineedit.py
  33. +2 −0 python/gui/auto_additions/qgsfloatingwidget.py
  34. +2 −0 python/gui/auto_additions/qgsfontbutton.py
  35. +5 −0 python/gui/auto_additions/qgsmaplayeractionregistry.py
  36. +4 −0 python/gui/auto_additions/qgsmaptoolidentify.py
  37. 0 python/server/{__init__.py → __init__.py.in}
  38. +4 −0 python/server/auto_additions/__init__.py
  39. +52 −29 scripts/sipify.pl
  40. +2 −1 scripts/sipify_all.sh
  41. +3 −0 src/core/auth/qgsauthmanager.h
  42. +6 −0 src/core/qgis_sip.h
  43. +5 −0 src/core/qgsapplication.cpp
  44. +1 −1 src/core/qgsdefaultvalue.h
  45. +51 −43 src/providers/ogr/qgsogrfeatureiterator.cpp
  46. +6 −5 src/providers/ogr/qgsogrfeatureiterator.h
  47. +61 −41 src/providers/ogr/qgsogrprovider.cpp
  48. +16 −7 src/providers/ogr/qgsogrprovider.h
  49. +7 −2 tests/code_layout/test_sipfiles_uptodate.sh
  50. +30 −0 tests/src/python/featuresourcetestbase.py
  51. +74 −15 tests/src/python/test_provider_ogr_sqlite.py
@@ -327,9 +327,18 @@ ENDFOREACH(pyfile)
FOREACH(module ${PY_MODULES})
ADD_CUSTOM_TARGET(py${module} ALL)
ADD_DEPENDENCIES(py${module} python_module_qgis__${module})

# concat auto_additions/*.py in _module_/__init__.py
FILE(GLOB PY_FILES_AUTO_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/auto_additions/*.py)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${module}/__init__.py.in ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py COPYONLY)
FOREACH(pyfile ${PY_FILES_AUTO_ADDITIONS})
file(READ ${pyfile} CONTENTS)
file(APPEND ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py "${CONTENTS}")
ENDFOREACH(pyfile)

FILE(GLOB PY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/*.py)
FILE(GLOB PY_FILES_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/additions/*.py)
INSTALL(FILES ${PY_FILES} DESTINATION "${QGIS_PYTHON_DIR}/${module}")
FILE(GLOB PY_FILES_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/additions/*.py)
INSTALL(FILES ${PY_FILES_ADDITIONS} DESTINATION "${QGIS_PYTHON_DIR}/${module}/additions")
SET(PY_FILES ${PY_FILES} ${PY_FILES_ADDITIONS})
FOREACH(pyfile ${PY_FILES})
File renamed without changes.
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""
@@ -31,7 +31,6 @@
from .additions.metaenum import metaEnumFromType, metaEnumFromValue
from .additions.processing import processing_output_layer_repr, processing_source_repr
from .additions.projectdirtyblocker import ProjectDirtyBlocker
from .additions.qgsdefaultvalue import _isValid
from .additions.qgsfeature import mapping_feature
from .additions.qgsfunction import register_function, qgsfunction
from .additions.qgsgeometry import _geometryNonZero, mapping_geometry
@@ -40,7 +39,6 @@
from .additions.readwritecontextentercategory import ReadWriteContextEnterCategory

# Injections into classes
QgsDefaultValue.__bool__ = _isValid
QgsFeature.__geo_interface__ = property(mapping_feature)
QgsGeometry.__bool__ = _geometryNonZero
QgsGeometry.__geo_interface__ = property(mapping_geometry)
@@ -52,36 +50,3 @@
QgsSettings.enumValue = _qgssettings_enum_value
QgsSettings.flagValue = _qgssettings_flag_value
QgsTask.fromFunction = fromFunction

# -----------------
# DO NOT EDIT BELOW
# These are automatically added by calling sipify.pl script

QgsAuthManager.MessageLevel.baseClass = QgsAuthManager
QgsDataItem.Type.baseClass = QgsDataItem
QgsDataItem.State.baseClass = QgsDataItem
QgsLayerItem.LayerType.baseClass = QgsLayerItem
QgsDataProvider.DataCapability.baseClass = QgsDataProvider
QgsDataSourceUri.SslMode.baseClass = QgsDataSourceUri
QgsFieldProxyModel.Filters.baseClass = QgsFieldProxyModel
Filters = QgsFieldProxyModel # dirty hack since SIP seems to introduce the flags in module
QgsMapLayerProxyModel.Filters.baseClass = QgsMapLayerProxyModel
Filters = QgsMapLayerProxyModel # dirty hack since SIP seems to introduce the flags in module
QgsNetworkContentFetcherRegistry.FetchingMode.baseClass = QgsNetworkContentFetcherRegistry
QgsSnappingConfig.SnappingMode.baseClass = QgsSnappingConfig
QgsSnappingConfig.SnappingType.baseClass = QgsSnappingConfig
QgsTolerance.UnitType.baseClass = QgsTolerance
QgsUnitTypes.DistanceUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AreaUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AngleUnit.baseClass = QgsUnitTypes
QgsUnitTypes.RenderUnit.baseClass = QgsUnitTypes
QgsUnitTypes.LayoutUnit.baseClass = QgsUnitTypes
QgsVectorSimplifyMethod.SimplifyHint.baseClass = QgsVectorSimplifyMethod
QgsVectorSimplifyMethod.SimplifyHints.baseClass = QgsVectorSimplifyMethod
SimplifyHints = QgsVectorSimplifyMethod # dirty hack since SIP seems to introduce the flags in module
QgsVectorSimplifyMethod.SimplifyAlgorithm.baseClass = QgsVectorSimplifyMethod
QgsRasterProjector.Precision.baseClass = QgsRasterProjector
QgsAbstractGeometry.SegmentationToleranceType.baseClass = QgsAbstractGeometry
QgsGeometry.BufferSide.baseClass = QgsGeometry
QgsGeometry.EndCapStyle.baseClass = QgsGeometry
QgsGeometry.JoinStyle.baseClass = QgsGeometry
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/geometry/qgsabstractgeometry.h
QgsAbstractGeometry.SegmentationToleranceType.baseClass = QgsAbstractGeometry
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/auth/qgsauthmanager.h
QgsAuthManager.MessageLevel.baseClass = QgsAuthManager
@@ -0,0 +1,4 @@
# The following has been generated automatically from src/core/qgsdataitem.h
QgsDataItem.Type.baseClass = QgsDataItem
QgsDataItem.State.baseClass = QgsDataItem
QgsLayerItem.LayerType.baseClass = QgsLayerItem
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsdataprovider.h
QgsDataProvider.DataCapability.baseClass = QgsDataProvider
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsdatasourceuri.h
QgsDataSourceUri.SslMode.baseClass = QgsDataSourceUri
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsdefaultvalue.h
QgsDefaultValue.__bool__ = lambda self: self.isValid()
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/core/qgsfieldproxymodel.h
QgsFieldProxyModel.Filters.baseClass = QgsFieldProxyModel
Filters = QgsFieldProxyModel # dirty hack since SIP seems to introduce the flags in module
@@ -0,0 +1,4 @@
# The following has been generated automatically from src/core/geometry/qgsgeometry.h
QgsGeometry.BufferSide.baseClass = QgsGeometry
QgsGeometry.EndCapStyle.baseClass = QgsGeometry
QgsGeometry.JoinStyle.baseClass = QgsGeometry
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/core/qgsmaplayerproxymodel.h
QgsMapLayerProxyModel.Filters.baseClass = QgsMapLayerProxyModel
Filters = QgsMapLayerProxyModel # dirty hack since SIP seems to introduce the flags in module
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsnetworkcontentfetcherregistry.h
QgsNetworkContentFetcherRegistry.FetchingMode.baseClass = QgsNetworkContentFetcherRegistry
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/raster/qgsrasterprojector.h
QgsRasterProjector.Precision.baseClass = QgsRasterProjector
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/core/qgssnappingconfig.h
QgsSnappingConfig.SnappingMode.baseClass = QgsSnappingConfig
QgsSnappingConfig.SnappingType.baseClass = QgsSnappingConfig
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgstolerance.h
QgsTolerance.UnitType.baseClass = QgsTolerance
@@ -0,0 +1,6 @@
# The following has been generated automatically from src/core/qgsunittypes.h
QgsUnitTypes.DistanceUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AreaUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AngleUnit.baseClass = QgsUnitTypes
QgsUnitTypes.RenderUnit.baseClass = QgsUnitTypes
QgsUnitTypes.LayoutUnit.baseClass = QgsUnitTypes
@@ -0,0 +1,5 @@
# The following has been generated automatically from src/core/qgsvectorsimplifymethod.h
QgsVectorSimplifyMethod.SimplifyHint.baseClass = QgsVectorSimplifyMethod
QgsVectorSimplifyMethod.SimplifyHints.baseClass = QgsVectorSimplifyMethod
SimplifyHints = QgsVectorSimplifyMethod # dirty hack since SIP seems to introduce the flags in module
QgsVectorSimplifyMethod.SimplifyAlgorithm.baseClass = QgsVectorSimplifyMethod
@@ -18,6 +18,9 @@ class QgsAuthManager : QObject
%Docstring
Singleton offering an interface to manage the authentication configuration database
and to utilize configurations through various authentication method plugins

QgsAuthManager should not usually be directly created, but rather accessed through
:py:func:`QgsApplication.authManager()`
%End

%TypeHeaderCode
@@ -77,7 +77,6 @@ Returns if this default value should be applied.
:return: false if the expression is a null string.
%End

operator bool() const;

};

This file was deleted.

@@ -2,11 +2,11 @@

"""
***************************************************************************
qgsdefaultvalue.py
__init__.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Denis Rouzaud
Email : denis@opengis.ch
Date : May 2014
Copyright : (C) 2014 by Nathan Woodrow
Email : woodrow dot nathan at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
@@ -17,6 +17,11 @@
***************************************************************************
"""

__author__ = 'Nathan Woodrow'
__date__ = 'May 2014'
__copyright__ = '(C) 2014, Nathan Woodrow'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

def _isValid(self):
return self.isValid()
from qgis.PyQt import QtCore
from qgis._gui import *
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/gui/qgsadvanceddigitizingdockwidget.h
QgsAdvancedDigitizingDockWidget.CadCapacities.baseClass = QgsAdvancedDigitizingDockWidget
CadCapacities = QgsAdvancedDigitizingDockWidget # dirty hack since SIP seems to introduce the flags in module
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/gui/attributetable/qgsattributetablefiltermodel.h
QgsAttributeTableFilterModel.FilterMode.baseClass = QgsAttributeTableFilterModel
QgsAttributeTableFilterModel.ColumnType.baseClass = QgsAttributeTableFilterModel
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/auth/qgsauthsettingswidget.h
QgsAuthSettingsWidget.WarningType.baseClass = QgsAuthSettingsWidget
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgscolorbutton.h
QgsColorButton.Behavior.baseClass = QgsColorButton
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgscolorwidgets.h
QgsColorTextWidget.ColorTextFormat.baseClass = QgsColorTextWidget
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/attributetable/qgsdualview.h
QgsDualView.ViewMode.baseClass = QgsDualView
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgsfilterlineedit.h
QgsFilterLineEdit.ClearMode.baseClass = QgsFilterLineEdit
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgsfloatingwidget.h
QgsFloatingWidget.AnchorPoint.baseClass = QgsFloatingWidget
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgsfontbutton.h
QgsFontButton.Mode.baseClass = QgsFontButton
@@ -0,0 +1,5 @@
# The following has been generated automatically from src/gui/qgsmaplayeractionregistry.h
QgsMapLayerAction.Targets.baseClass = QgsMapLayerAction
Targets = QgsMapLayerAction # dirty hack since SIP seems to introduce the flags in module
QgsMapLayerAction.Flags.baseClass = QgsMapLayerAction
Flags = QgsMapLayerAction # dirty hack since SIP seems to introduce the flags in module
@@ -0,0 +1,4 @@
# The following has been generated automatically from src/gui/qgsmaptoolidentify.h
QgsMapToolIdentify.IdentifyMode.baseClass = QgsMapToolIdentify
QgsMapToolIdentify.LayerType.baseClass = QgsMapToolIdentify
LayerType = QgsMapToolIdentify # dirty hack since SIP seems to introduce the flags in module
File renamed without changes.
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""

0 comments on commit d5afc71

Please sign in to comment.
You can’t perform that action at this time.