Skip to content

Commit

Permalink
Remove ingroup and class from doxygen when creating sip docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 2, 2017
1 parent d40de5d commit 28a57c8
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 17 deletions.
2 changes: 0 additions & 2 deletions python/core/processing/qgsprocessingfeedback.sip
Expand Up @@ -12,8 +12,6 @@
class QgsProcessingFeedback : QgsFeedback
{
%Docstring
\class QgsProcessingFeedback
\ingroup core
Base class for providing feedback from a processing algorithm.

This base class implementation silently ignores all feedback reported by algorithms.
Expand Down
2 changes: 0 additions & 2 deletions python/core/processing/qgsprocessingprovider.sip
Expand Up @@ -12,8 +12,6 @@
class QgsProcessingProvider
{
%Docstring
\class QgsProcessingProvider
\ingroup core
Abstract base class for processing providers. An algorithm provider is a set of
related algorithms, typically from the same external application or related
to a common area of analysis.
Expand Down
2 changes: 0 additions & 2 deletions python/core/processing/qgsprocessingregistry.sip
Expand Up @@ -12,8 +12,6 @@
class QgsProcessingRegistry : QObject
{
%Docstring
\class QgsProcessingRegistry
\ingroup core
Registry for various processing components, including providers, algorithms
and various parameters and outputs.

Expand Down
1 change: 0 additions & 1 deletion python/core/qgsactionscope.sip
Expand Up @@ -10,7 +10,6 @@
class QgsActionScope
{
%Docstring
\ingroup core
An action scope defines a "place" for an action to be shown and may add
additional expression variables.
Each QgsAction can be available in one or several action scopes.
Expand Down
1 change: 0 additions & 1 deletion python/core/qgsactionscoperegistry.sip
Expand Up @@ -10,7 +10,6 @@
class QgsActionScopeRegistry : QObject
{
%Docstring
\ingroup core
The action scope registry is an application wide registry that
contains a list of available action scopes.
Some scopes are available by default, additional ones can be registered
Expand Down
1 change: 0 additions & 1 deletion python/core/qgsanimatedicon.sip
Expand Up @@ -11,7 +11,6 @@
class QgsAnimatedIcon : QObject
{
%Docstring
\ingroup core
Animated icon is keeping an animation running if there are listeners connected to frameChanged
%End

Expand Down
1 change: 0 additions & 1 deletion python/core/qgsfeature.sip
Expand Up @@ -20,7 +20,6 @@ typedef qint64 QgsFeatureId;
class QgsFeature
{
%Docstring
\ingroup core
The feature class encapsulates a single feature including its id,
geometry and a list of field/values attributes.
\note QgsFeature objects are implicitly shared.
Expand Down
2 changes: 0 additions & 2 deletions python/core/qgssettings.sip
Expand Up @@ -12,8 +12,6 @@
class QgsSettings : QObject
{
%Docstring
\ingroup core
\class QgsSettings

This class is a composition of two QSettings instances:
- the main QSettings instance is the standard User Settings and
Expand Down
1 change: 0 additions & 1 deletion python/core/qgsvectorlayer.sip
Expand Up @@ -22,7 +22,6 @@ typedef QList<QgsPointV2> QgsPointSequence;
class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator
{
%Docstring
\ingroup core
Represents a vector layer which manages a vector based data sets.

The QgsVectorLayer is instantiated by specifying the name of a data provider,
Expand Down
23 changes: 20 additions & 3 deletions scripts/sipify.pl
Expand Up @@ -7,6 +7,17 @@
# "multiline function signatures"
# docustrings for QgsFeature::QgsAttributes

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


my $headerfile = $ARGV[0];

open(my $header, "<", $headerfile) || die "Couldn't open '".$headerfile."' for reading because: ".$!;
Expand Down Expand Up @@ -150,12 +161,18 @@
# Detect comment block
if ($line =~ m/^\s*\/\*/){
do {no warnings 'uninitialized';
$comment = $line =~ s/^\s*\/\*(\*)?(.*)$/$2/r;
if ( !shouldSkipDoxygenLine($line) )
{
$comment = $line =~ s/^\s*\/\*(\*)?(.*)$/$2/r;
}
};
$comment =~ s/^\s*$//;
while(!eof $header){
$line = readline $header;
$comment .= $line =~ s/\s*\*?(.*?)(\/)?$/$1/r;
if ( !shouldSkipDoxygenLine($line) )
{
$comment .= $line =~ s/\s*\*?(.*?)(\/)?$/$1/r;
}
if ( $line =~ m/\*\/$/ ){
last;
}
Expand All @@ -167,7 +184,7 @@

# save comments and do not print them, except in SIP_RUN
if ( $SIP_RUN == 0 ){
if ( $line =~ m/^\s*\/\// ){
if ( $line =~ m/^\s*\/\// && !shouldSkipDoxygenLine($line) ){
$line =~ s/^\s*\/\/\!*\s*(.*)\n?$/$1/;
$comment = $line;
next;
Expand Down
4 changes: 3 additions & 1 deletion tests/scripts/sipifyheader.expected.sip
Expand Up @@ -39,7 +39,6 @@ typedef QVector<QVariant> QgsSuperClass;
class QgsSipifyHeader : QtClass<QVariant>
{
%Docstring
\ingroup core
Documentation goes here
%End

Expand Down Expand Up @@ -125,6 +124,9 @@ complex default value and type (i.e. containing commas) should be given as a str

class ClassWithPrivateInheritanceOnly
{
%Docstring
Documentation goes here
%End

%TypeHeaderCode
#include "sipifyheader.h"
Expand Down
5 changes: 5 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -162,6 +162,11 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla

};

/**
* \class ClassWithPrivateInheritanceOnly
* \ingroup core
* Documentation goes here
*/
class CORE_EXPORT ClassWithPrivateInheritanceOnly : private QgsBaseClass
{
//! A constructor with definition in header on several lines
Expand Down

0 comments on commit 28a57c8

Please sign in to comment.