Skip to content

Commit

Permalink
Fix sipify override and inline definition combination
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 2, 2017
1 parent a609883 commit 16594da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/sipify.pl
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/sipifyheader.expected.sip
Expand Up @@ -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();

Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -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();

Expand Down

0 comments on commit 16594da

Please sign in to comment.