mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
correctly use reference for context in QgsReadWriteContextCategoryPopper
This commit is contained in:
parent
3c78fb58aa
commit
a483ef817a
@ -116,7 +116,7 @@ This would happen when it gets out of scope.
|
|||||||
#include "qgsreadwritecontext.h"
|
#include "qgsreadwritecontext.h"
|
||||||
%End
|
%End
|
||||||
public:
|
public:
|
||||||
QgsReadWriteContextCategoryPopper( QgsReadWriteContext *context );
|
QgsReadWriteContextCategoryPopper( QgsReadWriteContext &context );
|
||||||
%Docstring
|
%Docstring
|
||||||
Creates a popper
|
Creates a popper
|
||||||
%End
|
%End
|
||||||
|
@ -41,7 +41,7 @@ QgsReadWriteContextCategoryPopper QgsReadWriteContext::enterCategory( const QStr
|
|||||||
if ( !details.isEmpty() )
|
if ( !details.isEmpty() )
|
||||||
message.append( QString( " :: %1" ).arg( details ) );
|
message.append( QString( " :: %1" ).arg( details ) );
|
||||||
mCategories.push_back( message );
|
mCategories.push_back( message );
|
||||||
return QgsReadWriteContextCategoryPopper( this );
|
return QgsReadWriteContextCategoryPopper( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsReadWriteContext::leaveCategory()
|
void QgsReadWriteContext::leaveCategory()
|
||||||
|
@ -124,14 +124,10 @@ class CORE_EXPORT QgsReadWriteContextCategoryPopper
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Creates a popper
|
//! Creates a popper
|
||||||
QgsReadWriteContextCategoryPopper( QgsReadWriteContext *context ) : mContext( context ) {}
|
QgsReadWriteContextCategoryPopper( QgsReadWriteContext &context ) : mContext( context ) {}
|
||||||
~QgsReadWriteContextCategoryPopper()
|
~QgsReadWriteContextCategoryPopper() {mContext.leaveCategory();}
|
||||||
{
|
|
||||||
if ( mContext )
|
|
||||||
mContext->leaveCategory();
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
QgsReadWriteContext *mContext;
|
QgsReadWriteContext &mContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QGSREADWRITECONTEXT_H
|
#endif // QGSREADWRITECONTEXT_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user