From 6709debbac3c7810149b87f807fef0702fbc8a2a Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Tue, 16 Apr 2024 17:29:57 +0700 Subject: [PATCH] Fix sipify.pl script not handling Q_INVOKABLE inline --- .../PyQt6/core/auto_generated/vector/qgsvectorlayer.sip.in | 4 ++-- python/core/auto_generated/vector/qgsvectorlayer.sip.in | 4 ++-- scripts/sipify.pl | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/PyQt6/core/auto_generated/vector/qgsvectorlayer.sip.in b/python/PyQt6/core/auto_generated/vector/qgsvectorlayer.sip.in index c00320dc6ff..f67099d84c9 100644 --- a/python/PyQt6/core/auto_generated/vector/qgsvectorlayer.sip.in +++ b/python/PyQt6/core/auto_generated/vector/qgsvectorlayer.sip.in @@ -1049,7 +1049,7 @@ Queries the layer for features specified in request. Queries the layer for features matching a given expression. %End - inline QgsFeature getFeature( QgsFeatureId fid ) const; + QgsFeature getFeature( QgsFeatureId fid ) const; %Docstring Queries the layer for the feature with the given id. If there is no such feature, the returned feature will be invalid. @@ -1711,7 +1711,7 @@ This also includes fields which have not yet been saved to the provider. :return: A list of fields %End - inline QgsAttributeList attributeList() const; + QgsAttributeList attributeList() const; %Docstring Returns list of attribute indexes. i.e. a list from 0 ... :py:func:`~QgsVectorLayer.fieldCount` %End diff --git a/python/core/auto_generated/vector/qgsvectorlayer.sip.in b/python/core/auto_generated/vector/qgsvectorlayer.sip.in index c00320dc6ff..f67099d84c9 100644 --- a/python/core/auto_generated/vector/qgsvectorlayer.sip.in +++ b/python/core/auto_generated/vector/qgsvectorlayer.sip.in @@ -1049,7 +1049,7 @@ Queries the layer for features specified in request. Queries the layer for features matching a given expression. %End - inline QgsFeature getFeature( QgsFeatureId fid ) const; + QgsFeature getFeature( QgsFeatureId fid ) const; %Docstring Queries the layer for the feature with the given id. If there is no such feature, the returned feature will be invalid. @@ -1711,7 +1711,7 @@ This also includes fields which have not yet been saved to the provider. :return: A list of fields %End - inline QgsAttributeList attributeList() const; + QgsAttributeList attributeList() const; %Docstring Returns list of attribute indexes. i.e. a list from 0 ... :py:func:`~QgsVectorLayer.fieldCount` %End diff --git a/scripts/sipify.pl b/scripts/sipify.pl index e6f842ac504..f7602158bbd 100755 --- a/scripts/sipify.pl +++ b/scripts/sipify.pl @@ -1755,6 +1755,9 @@ while ($LINE_IDX < $LINE_COUNT){ $IS_OVERRIDE_OR_MAKE_PRIVATE = PREPEND_CODE_VIRTUAL if ( $LINE =~ m/\bFINAL\b/); $IS_OVERRIDE_OR_MAKE_PRIVATE = PREPEND_CODE_MAKE_PRIVATE if ( $LINE =~ m/\bSIP_MAKE_PRIVATE\b/); + # remove Q_INVOKABLE + $LINE =~ s/^(\s*)Q_INVOKABLE /$1/; + # keyword fixes do {no warnings 'uninitialized'; $LINE =~ s/^(\s*template\s*<)(?:class|typename) (\w+>)(.*)$/$1$2$3/; @@ -1861,9 +1864,6 @@ while ($LINE_IDX < $LINE_COUNT){ } } - # remove Q_INVOKABLE - $LINE =~ s/^(\s*)Q_INVOKABLE /$1/; - do {no warnings 'uninitialized'; # remove keywords if ( $IS_OVERRIDE_OR_MAKE_PRIVATE != PREPEND_CODE_NO ){