Skip to content
Permalink
Browse files

use MAYBE_UNUSED in the method declaration

  • Loading branch information
3nids committed Feb 28, 2018
1 parent 8582517 commit 05ee1b02c3b25ac4f36455ae26bfacc1831d3361
@@ -260,7 +260,7 @@ void QgsEditFormConfig::setSuppress( QgsEditFormConfig::FeatureFormSuppress s )

void QgsEditFormConfig::readXml( const QDomNode &node, QgsReadWriteContext &context )
{
MAYBE_UNUSED QgsReadWriteContextCategoryPopper p = context.enterCategory( QObject::tr( "Edit form config" ) );
QgsReadWriteContextCategoryPopper p = context.enterCategory( QObject::tr( "Edit form config" ) );

d.detach();

@@ -430,7 +430,7 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, QgsReadWriteCo
// the subclass can also read custom properties
readCustomProperties( layerElement );

MAYBE_UNUSED QgsReadWriteContextCategoryPopper p = context.enterCategory( tr( "Layer" ), mne.text() );
QgsReadWriteContextCategoryPopper p = context.enterCategory( tr( "Layer" ), mne.text() );

// now let the children grab what they need from the Dom node.
layerError = !readXml( layerElement, context );
@@ -41,7 +41,7 @@ QgsReadWriteContextCategoryPopper QgsReadWriteContext::enterCategory( const QStr
if ( !details.isEmpty() )
message.append( QString( " :: %1" ).arg( details ) );
mCategories.push_back( message );
return QgsReadWriteContextCategoryPopper( this );
return QgsReadWriteContextCategoryPopper( *this );
}

void QgsReadWriteContext::leaveCategory()
@@ -88,7 +88,7 @@ class CORE_EXPORT QgsReadWriteContext
* \note Not available in the Python bindings.
* \since QGIS 3.2
*/
NODISCARD QgsReadWriteContextCategoryPopper enterCategory( const QString &category, const QString &details = QString() );
MAYBE_UNUSED NODISCARD QgsReadWriteContextCategoryPopper enterCategory( const QString &category, const QString &details = QString() );
#endif

/**
@@ -114,18 +114,10 @@ class CORE_EXPORT QgsReadWriteContext
class QgsReadWriteContextCategoryPopper
{
public:

QgsReadWriteContextCategoryPopper( QgsReadWriteContext *context )
: mContext( context )
{}

~QgsReadWriteContextCategoryPopper()
{
if ( mContext )
mContext->leaveCategory();
}

QgsReadWriteContext *mContext;
QgsReadWriteContextCategoryPopper( QgsReadWriteContext &context ) : mContext( context ) {}
~QgsReadWriteContextCategoryPopper() {mContext.leaveCategory();}
private:
QgsReadWriteContext mContext;
};
///@endcond PRIVATE
#endif
@@ -1688,7 +1688,7 @@ void QgsVectorLayer::resolveReferences( QgsProject *project )

bool QgsVectorLayer::readSymbology( const QDomNode &layerNode, QString &errorMessage, QgsReadWriteContext &context )
{
MAYBE_UNUSED QgsReadWriteContextCategoryPopper p = context.enterCategory( tr( "Symbology" ) );
QgsReadWriteContextCategoryPopper p = context.enterCategory( tr( "Symbology" ) );

if ( !mExpressionFieldBuffer )
mExpressionFieldBuffer = new QgsExpressionFieldBuffer();

0 comments on commit 05ee1b0

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