Skip to content
Permalink
Browse files
Fix sipify override and inline definition combination
  • Loading branch information
m-kuhn committed Apr 2, 2017
1 parent a609883 commit 16594da94c495df6e31a474f7912a8f4f71ccbf4
Showing with 4 additions and 1 deletion.
  1. +1 −1 scripts/sipify.pl
  2. +1 −0 tests/scripts/sipifyheader.expected.sip
  3. +2 −0 tests/scripts/sipifyheader.h
@@ -305,7 +305,7 @@ sub processDoxygenLine
}

# remove function bodies
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?((\w+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?((\w+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(override)?\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){

This comment has been minimized.

Copy link
@3nids

3nids Apr 3, 2017

Member

override should have been removed at line 274. Maybe worth making the check lighter with a .* at the end to allow method body detection.

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Apr 3, 2017

Author Member

please improve it if you see possibilities. theres a test in place to check if it works properly.

This comment has been minimized.

Copy link
@3nids

3nids Apr 3, 2017

Member

done

my $newline = "$1$2$3$4;\n";
if ($line !~ m/\{.*?\}$/){
$line = readline $header;
@@ -150,6 +150,7 @@ complex default value and type (i.e. containing commas) should be given as a str

bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl );

virtual int overriddenProperty();
protected:
bool thisShouldBeListed();

@@ -182,6 +182,8 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla

bool deletedFunction() = delete; // some comments

virtual int overriddenProperty() override { return 42; } // if in doubt, comment it out

protected:
bool thisShouldBeListed();

0 comments on commit 16594da

Please sign in to comment.