Skip to content

Commit

Permalink
Add 'accessor for' to doxygen compliance blacklist
Browse files Browse the repository at this point in the history
Use "Returns the..." instead
  • Loading branch information
nyalldawson committed May 27, 2018
1 parent 487a6a8 commit b6b08e9
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 29 deletions.
8 changes: 4 additions & 4 deletions python/core/auto_generated/qgsscalecalculator.sip.in
Expand Up @@ -33,16 +33,16 @@ Constructor

void setDpi( double dpi );
%Docstring
Set the dpi to be used in scale calculations
Sets the ``dpi`` (dots per inch) for the output resolution, to be used in scale calculations.

:param dpi: Dots per inch of monitor resolution
.. seealso:: :py:func:`dpi`
%End

double dpi();
%Docstring
Accessor for dpi used in scale calculations
Returns the DPI (dots per inch) used in scale calculations.

:return: int the dpi used for scale calculations.
.. seealso:: :py:func:`setDpi`
%End

void setMapUnits( QgsUnitTypes::DistanceUnit mapUnits );
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsvectorlayer.sip.in
Expand Up @@ -437,7 +437,7 @@ Removes a vector layer join

QgsVectorLayerJoinBuffer *joinBuffer();
%Docstring
Accessor to the join buffer object
Returns the join buffer object.

.. versionadded:: 2.14.7
%End
Expand Down
Expand Up @@ -224,7 +224,7 @@ to caller.

virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() );
%Docstring
Accessor for the raster layers pyramid list.
Returns the raster layers pyramid list.

:param overviewList: used to construct the pyramid list (optional), when empty the list is defined by the provider.
A pyramid list defines the
Expand Down
16 changes: 10 additions & 6 deletions python/core/auto_generated/raster/qgsrasterlayer.sip.in
Expand Up @@ -199,7 +199,7 @@ Set the data provider.

LayerType rasterType();
%Docstring
Accessor for raster layer type (which is a read only property)
Returns the raster layer type (which is a read only property).
%End

void setRenderer( QgsRasterRenderer *renderer /Transfer/ );
Expand All @@ -218,27 +218,31 @@ Sets raster resample filter. Takes ownership of the resample filter object

QgsRasterPipe *pipe();
%Docstring
Get raster pipe
Returns the raster pipe.
%End

int width() const;
%Docstring
Accessor that returns the width of the (unclipped) raster
Returns the width of the (unclipped) raster.

.. seealso:: :py:func:`height`
%End

int height() const;
%Docstring
Accessor that returns the height of the (unclipped) raster
Returns the height of the (unclipped) raster.

.. seealso:: :py:func:`width`
%End

int bandCount() const;
%Docstring
Get the number of bands in this layer
Returns the number of bands in this layer.
%End

QString bandName( int bandNoInt ) const;
%Docstring
Get the name of a band given its number
Returns the name of a band given its number.
%End

virtual QgsRasterDataProvider *dataProvider();
Expand Down
13 changes: 11 additions & 2 deletions python/core/auto_generated/raster/qgsrastertransparency.sip.in
Expand Up @@ -40,14 +40,19 @@ Constructor for QgsRasterTransparency.
double percentTransparent;
};


QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
%Docstring
Accessor for transparentSingleValuePixelList
Returns the transparent single value pixel list.

.. seealso:: :py:func:`setTransparentSingleValuePixelList`
%End

QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
%Docstring
Accessor for transparentThreeValuePixelList
Returns the transparent three value pixel list.

.. seealso:: :py:func:`setTransparentThreeValuePixelList`
%End

void initializeTransparentPixelList( double value );
Expand All @@ -63,11 +68,15 @@ Resets the transparency list to single red, green, and blue values.
void setTransparentSingleValuePixelList( const QList<QgsRasterTransparency::TransparentSingleValuePixel> &newList );
%Docstring
Sets the transparent single value pixel list, replacing the whole existing list.

.. seealso:: :py:func:`transparentSingleValuePixelList`
%End

void setTransparentThreeValuePixelList( const QList<QgsRasterTransparency::TransparentThreeValuePixel> &newList );
%Docstring
Sets the transparent three value pixel list, replacing the whole existing list.

.. seealso:: :py:func:`transparentThreeValuePixelList`
%End

int alphaValue( double value, int globalTransparency = 255 ) const;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsprojectproperties.h
Expand Up @@ -58,7 +58,7 @@ class APP_EXPORT QgsProjectProperties : public QgsOptionsDialogBase, private Ui:
QString title() const;
void title( QString const &title );

//! Accessor for projection
//! Returns the projection as a WKT string
QString projectionWkt();

public slots:
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsscalecalculator.h
Expand Up @@ -44,14 +44,14 @@ class CORE_EXPORT QgsScaleCalculator
QgsUnitTypes::DistanceUnit mapUnits = QgsUnitTypes::DistanceMeters );

/**
* Set the dpi to be used in scale calculations
* \param dpi Dots per inch of monitor resolution
* Sets the \a dpi (dots per inch) for the output resolution, to be used in scale calculations.
* \see dpi()
*/
void setDpi( double dpi );

/**
* Accessor for dpi used in scale calculations
* \returns int the dpi used for scale calculations.
* Returns the DPI (dots per inch) used in scale calculations.
* \see setDpi()
*/
double dpi();

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Expand Up @@ -504,7 +504,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
bool removeJoin( const QString &joinLayerId );

/**
* Accessor to the join buffer object
* Returns the join buffer object.
* \since QGIS 2.14.7
*/
QgsVectorLayerJoinBuffer *joinBuffer() { return mJoinBuffer; }
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterdataprovider.h
Expand Up @@ -312,7 +312,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
}

/**
* \brief Accessor for the raster layers pyramid list.
* Returns the raster layers pyramid list.
* \param overviewList used to construct the pyramid list (optional), when empty the list is defined by the provider.
* A pyramid list defines the
* POTENTIAL pyramids that can be in a raster. To know which of the pyramid layers
Expand Down
26 changes: 20 additions & 6 deletions src/core/raster/qgsrasterlayer.h
Expand Up @@ -262,7 +262,9 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
*/
void setDataProvider( const QString &provider, const QgsDataProvider::ProviderOptions &options );

//! \brief Accessor for raster layer type (which is a read only property)
/**
* Returns the raster layer type (which is a read only property).
*/
LayerType rasterType() { return mRasterType; }

//! Sets raster renderer. Takes ownership of the renderer object
Expand All @@ -275,19 +277,31 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
QgsBrightnessContrastFilter *brightnessFilter() const { return mPipe.brightnessFilter(); }
QgsHueSaturationFilter *hueSaturationFilter() const { return mPipe.hueSaturationFilter(); }

//! Get raster pipe
/**
* Returns the raster pipe.
*/
QgsRasterPipe *pipe() { return &mPipe; }

//! \brief Accessor that returns the width of the (unclipped) raster
/**
* Returns the width of the (unclipped) raster.
* \see height()
*/
int width() const;

//! \brief Accessor that returns the height of the (unclipped) raster
/**
* Returns the height of the (unclipped) raster.
* \see width()
*/
int height() const;

//! \brief Get the number of bands in this layer
/**
* Returns the number of bands in this layer.
*/
int bandCount() const;

//! \brief Get the name of a band given its number
/**
* Returns the name of a band given its number.
*/
QString bandName( int bandNoInt ) const;

// Returns nullptr if not using the data provider model (i.e. directly using GDAL)
Expand Down
13 changes: 11 additions & 2 deletions src/core/raster/qgsrastertransparency.h
Expand Up @@ -60,10 +60,17 @@ class CORE_EXPORT QgsRasterTransparency
//
// Initializer, Accessor and mutator for transparency tables.
//
//! \brief Accessor for transparentSingleValuePixelList

/**
* Returns the transparent single value pixel list.
* \see setTransparentSingleValuePixelList()
*/
QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;

//! \brief Accessor for transparentThreeValuePixelList
/**
* Returns the transparent three value pixel list.
* \see setTransparentThreeValuePixelList()
*/
QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;

/**
Expand All @@ -78,11 +85,13 @@ class CORE_EXPORT QgsRasterTransparency

/**
* Sets the transparent single value pixel list, replacing the whole existing list.
* \see transparentSingleValuePixelList()
*/
void setTransparentSingleValuePixelList( const QList<QgsRasterTransparency::TransparentSingleValuePixel> &newList );

/**
* Sets the transparent three value pixel list, replacing the whole existing list.
* \see transparentThreeValuePixelList()
*/
void setTransparentThreeValuePixelList( const QList<QgsRasterTransparency::TransparentThreeValuePixel> &newList );

Expand Down
2 changes: 2 additions & 0 deletions tests/code_layout/doxygen_parser.py
Expand Up @@ -579,6 +579,8 @@ def memberDocIsNonCompliant(self, member_elem):
return 'Use "Sets the..." instead of "setter"'
elif para.text.strip().lower().startswith('mutator'):
return 'Use "Sets the..." instead of "mutator for..."'
elif para.text.strip().lower().startswith('accessor'):
return 'Use "Returns the..." instead of "accessor for..."'
elif para.text.strip().lower().startswith('return '):
return 'Use "Returns the..." instead of "return ..."'
#elif para.text.strip().lower().startswith('set '):
Expand Down

0 comments on commit b6b08e9

Please sign in to comment.