Skip to content

Commit

Permalink
[sipify] do not copy struct docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 7, 2017
1 parent f82997c commit 97e2661
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/sipify.pl
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ sub processDoxygenLine
}

# write comment
if ( $line =~ m/^\s*$/ || $line =~ m/\/\// || $line =~ m/\s*typedef / ){
if ( $line =~ m/^\s*$/ || $line =~ m/\/\// || $line =~ m/\s*typedef / || $line =~ m/\s*struct / ){
$comment = '';
}
elsif ( $comment !~ m/^\s*$/ ){
Expand Down
6 changes: 6 additions & 0 deletions tests/scripts/sipifyheader.expected.sip
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class QgsSipifyHeader : QtClass<QVariant>
};
typedef QFlags<QgsSipifyHeader::MyEnum> Flags;

struct Data
{
QString name;
int count;
};

explicit QgsSipifyHeader();
%Docstring
A constructor with definition in header
Expand Down
10 changes: 10 additions & 0 deletions tests/scripts/sipifyheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
};
Q_DECLARE_FLAGS( Flags, MyEnum )

/**
* Docstring headers for structs are not supported by sip (as of 4.18) and
* therefore this docstring must not to be copied to the sipfile.
*/
struct Data
{
QString name;
int count;
};

//! A constructor with definition in header
explicit QgsSipifyHeader()
: QtClass<QVariant>()
Expand Down

0 comments on commit 97e2661

Please sign in to comment.