Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sipify] Handle enum values using bitshift operators
  • Loading branch information
nyalldawson committed Apr 3, 2017
1 parent 7db1913 commit 3e9c527
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/sipify.pl
Expand Up @@ -266,7 +266,7 @@ sub processDoxygenLine
if ($line =~ m/\};/){
last;
}
$line =~ s/(\s*\w+)(\s*=\s*\w+.*?)?(,?).*$/$1$3/;
$line =~ s/(\s*\w+)(\s*=\s*[\w\s\d<]+.*?)?(,?).*$/$1$3/;
print $line;
}
print $line;
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/sipifyheader.expected.sip
Expand Up @@ -61,6 +61,8 @@ class QgsSipifyHeader : QtClass<QVariant>
{
Success,
NoSuccess,
ImaginarySuccess,
RecursiveSuccess,
};
typedef QFlags<QgsSipifyHeader::MyEnum> Flags;

Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -98,6 +98,8 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla
{
Success = 0, //!< Edit operation was successful
NoSuccess = 1, //!< Edit operation resulted in an empty geometry
ImaginarySuccess = 1 << 3, //!< Edit operation resulted in an imaginary geometry
RecursiveSuccess = 1 << 4, //!< Edit operation resulted in an n-dimensional wormhole
};
Q_DECLARE_FLAGS( Flags, MyEnum )

Expand Down

0 comments on commit 3e9c527

Please sign in to comment.