@@ -80,7 +80,7 @@ class CORE_EXPORT QgsReadWriteContext
80
80
* Append a message to the context
81
81
* \since QGIS 3.2
82
82
*/
83
- void pushMessage ( const QString &message, Qgis::MessageLevel level = Qgis::Warning );
83
+ void pushMessage ( const QString &message, Qgis::MessageLevel level = Qgis::Warning ) const ;
84
84
85
85
/* *
86
86
* Push a category to the stack
@@ -93,7 +93,7 @@ class CORE_EXPORT QgsReadWriteContext
93
93
* \endcode
94
94
* \since QGIS 3.2
95
95
*/
96
- MAYBE_UNUSED NODISCARD QgsReadWriteContextCategoryPopper enterCategory ( const QString &category, const QString &details = QString() ) SIP_PYNAME( _enterCategory );
96
+ MAYBE_UNUSED NODISCARD QgsReadWriteContextCategoryPopper enterCategory ( const QString &category, const QString &details = QString() ) const SIP_PYNAME( _enterCategory );
97
97
98
98
/* *
99
99
* Returns the stored messages and remove them
@@ -136,11 +136,11 @@ class CORE_EXPORT QgsReadWriteContext
136
136
private:
137
137
138
138
// ! Pop the last category
139
- void leaveCategory ();
139
+ void leaveCategory () const ;
140
140
141
141
QgsPathResolver mPathResolver ;
142
- QList<ReadWriteMessage> mMessages ;
143
- QStringList mCategories = QStringList();
142
+ mutable QList<ReadWriteMessage> mMessages ;
143
+ mutable QStringList mCategories = QStringList();
144
144
QgsProjectTranslator *mProjectTranslator = nullptr ;
145
145
friend class QgsReadWriteContextCategoryPopper ;
146
146
QgsCoordinateTransformContext mCoordinateTransformContext = QgsCoordinateTransformContext();
@@ -159,14 +159,14 @@ class CORE_EXPORT QgsReadWriteContextCategoryPopper
159
159
{
160
160
public:
161
161
// ! Creates a popper
162
- QgsReadWriteContextCategoryPopper ( QgsReadWriteContext &context ) : mContext ( context ) {}
162
+ QgsReadWriteContextCategoryPopper ( const QgsReadWriteContext &context ) : mContext ( context ) {}
163
163
~QgsReadWriteContextCategoryPopper () {mContext .leaveCategory ();}
164
164
private:
165
165
#ifdef SIP_RUN
166
166
QgsReadWriteContextCategoryPopper &operator =( const QgsReadWriteContextCategoryPopper & );
167
167
#endif
168
168
169
- QgsReadWriteContext &mContext ;
169
+ const QgsReadWriteContext &mContext ;
170
170
};
171
171
172
172
#endif // QGSREADWRITECONTEXT_H
0 commit comments