Skip to content

Commit fbd62be

Browse files
committedMay 2, 2017
[sipify] remove static const value assignment
1 parent 1f3ff11 commit fbd62be

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
 

‎scripts/sipify.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ sub remove_constructor_or_body {
465465
next;
466466
}
467467

468+
# remove static const value assignment
469+
# https://regex101.com/r/DyWkgn/1
470+
$line =~ s/^(\s*static const \w+(<([\w()<>, ]|::)+>)? \w+) = .*;\s*(\/\/.*)?$/$1;/;
471+
468472
# remove struct member assignment
469473
if ( $SIP_RUN != 1 && $ACCESS[$#ACCESS] == PUBLIC && $line =~ m/^(\s*\w+[\w<> *&:,]* \*?\w+) = \w+(\([^()]+\))?;/ ){
470474
dbg_info("remove struct member assignment");

‎tests/scripts/sipifyheader.expected.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class QgsSipifyHeader : QtClass<QVariant>
8989
QgsMapLayer *mLayer;
9090
};
9191

92+
static const int MONTHS;
93+
9294
explicit QgsSipifyHeader();
9395
%Docstring
9496
A constructor with definition in header

‎tests/scripts/sipifyheader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
134134
QgsMapLayer *mLayer = nullptr;
135135
};
136136

137+
static const int MONTHS = 60 * 60 * 24 * 30; // something
138+
137139
//! A constructor with definition in header
138140
explicit QgsSipifyHeader()
139141
: QtClass<QVariant>()

0 commit comments

Comments
 (0)
Please sign in to comment.