Skip to content
Permalink
Browse files

Ensure that class \brief comes before \since (#7081)

Otherwise it breaks the Python docstrings, which require
the brief to come first
  • Loading branch information
nyalldawson authored and 3nids committed May 28, 2018
1 parent facf7a2 commit 4c3a9ef7be1ced39a5ee16fda600c94ec73b25ec
@@ -14,9 +14,9 @@
class QgsGraphEdge
{
%Docstring
This class implements a graph edge

.. versionadded:: 3.0
This class implements a graph edge
%End

%TypeHeaderCode
@@ -11,10 +11,10 @@
class QgsNetworkDistanceStrategy : QgsNetworkStrategy
{
%Docstring

.. versionadded:: 3.0
Strategy for calculating edge cost based on its length. Should be
used for finding shortest path between two points.

.. versionadded:: 3.0
%End

%TypeHeaderCode
@@ -18,12 +18,12 @@
class QgsNetworkStrategy
{
%Docstring

.. versionadded:: 3.0
QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can
take into account travel distance, amount of time or money. Currently there are two strategies
implemented in the analysis library: QgsNetworkDistanceStrategy and QgsNetworkSpeedStrategy.
QgsNetworkStrategy implemented using "strategy" design pattern.

.. versionadded:: 3.0
%End

%TypeHeaderCode
@@ -13,9 +13,9 @@
class QgsVectorLayerDirector : QgsGraphDirector
{
%Docstring
Determine making the graph from vector line layer

.. versionadded:: 3.0
Determine making the graph from vector line layer
%End

%TypeHeaderCode
@@ -12,9 +12,9 @@
class QgsNativeAlgorithms: QgsProcessingProvider
{
%Docstring
Native c++ processing algorithm provider.

.. versionadded:: 3.0
Native c++ processing algorithm provider.
%End

%TypeHeaderCode
@@ -14,8 +14,6 @@ class QgsAnnotation : QObject
{
%Docstring

.. versionadded:: 3.0

Abstract base class for annotation items which are drawn over a map.

QgsAnnotation is an abstract base class for map annotation items. These annotations can be
@@ -26,6 +24,8 @@ QgsCoordinateReferenceSystem, which can be determined by calling mapPositionCrs(

Derived classes should implement their custom painting routines within
a renderAnnotation() override.

.. versionadded:: 3.0
%End

%TypeHeaderCode
@@ -14,8 +14,6 @@ class QgsAnnotationManager : QObject
{
%Docstring

.. versionadded:: 3.0

Manages storage of a set of QgsAnnotation annotation objects.

QgsAnnotationManager handles the storage, serializing and deserializing
@@ -24,6 +22,8 @@ rather accessed through a QgsProject via :py:func:`QgsProject.annotationManager(

QgsAnnotationManager retains ownership of all the annotations contained
in the manager.

.. versionadded:: 3.0
%End

%TypeHeaderCode
@@ -14,8 +14,6 @@ class QgsLayoutManager : QObject
{
%Docstring

.. versionadded:: 3.0

Manages storage of a set of layouts.

QgsLayoutManager handles the storage, serializing and deserializing
@@ -24,6 +22,8 @@ rather accessed through a QgsProject via :py:func:`QgsProject.layoutManager()`

QgsLayoutManager retains ownership of all the layouts contained
in the manager.

.. versionadded:: 3.0
%End

%TypeHeaderCode
@@ -64,6 +64,7 @@
my $RETURN_TYPE = '';
my $IS_OVERRIDE = 0;
my $IF_FEATURE_CONDITION = '';
my $FOUND_SINCE = 0;
my %QFLAG_HASH;

my $LINE_COUNT = @INPUT_LINES;
@@ -208,7 +209,10 @@ sub processDoxygenLine {

if ( $line =~ m/^\s*[\\@]brief/){
$line =~ s/[\\@]brief\s*//;
$INDENT = '';
if ( $FOUND_SINCE eq 1 ) {
exit_with_error("$headerfile\:\:$LINE_IDX Since annotation must come after brief")
}
$FOUND_SINCE = 0;
if ( $line =~ m/^\s*$/ ){
return "";
}
@@ -220,6 +224,7 @@ sub processDoxygenLine {
}
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
$INDENT = '';
$FOUND_SINCE = 1;
return "\n.. versionadded:: $1\n";
}
if ( $line =~ m/\\deprecated (.*)/i ) {
@@ -424,6 +429,7 @@ sub detect_comment_block{
$INDENT = '';
$COMMENT_CODE_SNIPPET = 0;
$COMMENT_LAST_LINE_NOTE_WARNING = 0;
$FOUND_SINCE = 0;
if ( $LINE =~ m/^\s*\/\*/ || $args{strict_mode} == UNSTRICT && $LINE =~ m/\/\*/ ){
dbg_info("found comment block");
do {no warnings 'uninitialized';
@@ -37,8 +37,8 @@ class QgsGraphVertex;
/**
* \ingroup analysis
* \class QgsGraphEdge
* \since QGIS 3.0
* \brief This class implements a graph edge
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsGraphEdge
{
@@ -22,9 +22,9 @@
/**
* \ingroup analysis
* \class QgsNetworkDistanceStrategy
* \since QGIS 3.0
* \brief Strategy for calculating edge cost based on its length. Should be
* used for finding shortest path between two points.
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsNetworkDistanceStrategy : public QgsNetworkStrategy
{
@@ -32,11 +32,11 @@
/**
* \ingroup analysis
* \class QgsNetworkStrategy
* \since QGIS 3.0
* \brief QgsNetworkStrategy defines strategy used for calculation of the edge cost. For example it can
* take into account travel distance, amount of time or money. Currently there are two strategies
* implemented in the analysis library: QgsNetworkDistanceStrategy and QgsNetworkSpeedStrategy.
* QgsNetworkStrategy implemented using "strategy" design pattern.
* \since QGIS 3.0
*/

class ANALYSIS_EXPORT QgsNetworkStrategy
@@ -27,8 +27,8 @@ class QgsFeatureSource;
/**
* \ingroup analysis
* \class QgsVectorLayerDirector
* \since QGIS 3.0
* \brief Determine making the graph from vector line layer
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsVectorLayerDirector : public QgsGraphDirector
{
@@ -25,8 +25,8 @@
/**
* \ingroup analysis
* \class QgsNativeAlgorithms
* \since QGIS 3.0
* \brief Native c++ processing algorithm provider.
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsNativeAlgorithms: public QgsProcessingProvider
{
@@ -30,7 +30,6 @@
/**
* \ingroup core
* \class QgsAnnotation
* \since QGIS 3.0
*
* \brief Abstract base class for annotation items which are drawn over a map.
*
@@ -42,6 +41,8 @@
*
* Derived classes should implement their custom painting routines within
* a renderAnnotation() override.
*
* \since QGIS 3.0
*/

class CORE_EXPORT QgsAnnotation : public QObject
@@ -29,7 +29,6 @@ class QgsAnnotation;
/**
* \ingroup core
* \class QgsAnnotationManager
* \since QGIS 3.0
*
* \brief Manages storage of a set of QgsAnnotation annotation objects.
*
@@ -39,6 +38,8 @@ class QgsAnnotation;
*
* QgsAnnotationManager retains ownership of all the annotations contained
* in the manager.
*
* \since QGIS 3.0
*/
class CORE_EXPORT QgsAnnotationManager : public QObject
{
@@ -27,7 +27,6 @@ class QgsPrintLayout;
/**
* \ingroup core
* \class QgsLayoutManager
* \since QGIS 3.0
*
* \brief Manages storage of a set of layouts.
*
@@ -37,6 +36,7 @@ class QgsPrintLayout;
*
* QgsLayoutManager retains ownership of all the layouts contained
* in the manager.
* \since QGIS 3.0
*/

class CORE_EXPORT QgsLayoutManager : public QObject

0 comments on commit 4c3a9ef

Please sign in to comment.
You can’t perform that action at this time.