Skip to content

Commit

Permalink
Remove \brief from doxygen in sipify
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 2, 2017
1 parent 0c08fb3 commit f044eeb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion python/core/annotations/qgsannotationmanager.sip
Expand Up @@ -15,7 +15,7 @@ class QgsAnnotationManager : QObject
%Docstring
.. versionadded:: 3.0

\brief Manages storage of a set of QgsAnnotation annotation objects.
Manages storage of a set of QgsAnnotation annotation objects.

QgsAnnotationManager handles the storage, serializing and deserializing
of QgsAnnotations. Usually this class is not constructed directly, but
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayer.sip
Expand Up @@ -1539,7 +1539,7 @@ Returns the current transparency for the vector layer

QgsConditionalLayerStyles *conditionalStyles() const;
%Docstring
@brief Return the conditional styles that are set for this layer. Style information is
Return the conditional styles that are set for this layer. Style information is
used to render conditional formatting in the attribute table.
@return Return a QgsConditionalLayerStyles object holding the conditional attribute
style information. Style information is generic and can be used for anything.
Expand Down
28 changes: 9 additions & 19 deletions scripts/sipify.pl
Expand Up @@ -7,24 +7,20 @@
# "multiline function signatures"
# docustrings for QgsFeature::QgsAttributes

sub shouldSkipDoxygenLine
{
do {no warnings 'uninitialized';
if ( $_[0] =~ m/[\\@](ingroup|class)/ ) {
return 1;
}
return 0;
}
}

sub processDoxygenLine
{
if ( $_[0] =~ m/[\\@](ingroup|class)/ ) {
return ""
}
if ( $_[0] =~ m/[\\@]note added .*?([\d\.]+)/i ) {
return ".. versionadded:: $1\n";
}
if ( $_[0] =~ m/[\\@]note (.*)/ ) {
return ".. note::\n\n $1\n";
}
if ( $_[0] =~ m/[\\@]brief (.*)/ ) {
return " $1\n";
}
return $_[0];
}

Expand Down Expand Up @@ -172,18 +168,12 @@ sub processDoxygenLine
# Detect comment block
if ($line =~ m/^\s*\/\*/){
do {no warnings 'uninitialized';
if ( !shouldSkipDoxygenLine($line) )
{
$comment = processDoxygenLine( $line =~ s/^\s*\/\*(\*)?(.*)$/$2/r );
}
$comment = processDoxygenLine( $line =~ s/^\s*\/\*(\*)?(.*)$/$2/r );
};
$comment =~ s/^\s*$//;
while(!eof $header){
$line = readline $header;
if ( !shouldSkipDoxygenLine($line) )
{
$comment .= processDoxygenLine( $line =~ s/\s*\*?(.*?)(\/)?$/$1/r );
}
$comment .= processDoxygenLine( $line =~ s/\s*\*?(.*?)(\/)?$/$1/r );
if ( $line =~ m/\*\/$/ ){
last;
}
Expand All @@ -195,7 +185,7 @@ sub processDoxygenLine

# save comments and do not print them, except in SIP_RUN
if ( $SIP_RUN == 0 ){
if ( $line =~ m/^\s*\/\// && !shouldSkipDoxygenLine($line) ){
if ( $line =~ m/^\s*\/\// ){
$line =~ s/^\s*\/\/\!*\s*(.*)\n?$/$1/;
$comment = processDoxygenLine( $line );
next;
Expand Down
7 changes: 7 additions & 0 deletions tests/scripts/sipifyheader.expected.sip
Expand Up @@ -93,6 +93,13 @@ Factory annotation
is not very interesting!
%End

void LongDocStringMethodWithBrief();
%Docstring
some brief
My long doc string
is not very interesting!
%End

bool isOKwithErrMesg( QString &ErrMsg /Out/ );

void InOutParam( bool &ok = true /In,Out/ );
Expand Down
7 changes: 7 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -124,6 +124,13 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla
*/
void LongDocStringMethod();

/**
* \brief some brief
* My long doc string
* is not very interesting!
*/
void LongDocStringMethodWithBrief();

bool isOKwithErrMesg( QString &ErrMsg SIP_OUT );

void InOutParam( bool &ok = true SIP_INOUT );
Expand Down

0 comments on commit f044eeb

Please sign in to comment.