Skip to content
Permalink
Browse files
Error string is mutable
  • Loading branch information
pblottiere committed Jun 7, 2021
1 parent eb7d465 commit 572995889a5c2e08cf8dacd40dd95a7d66b66add
@@ -338,7 +338,7 @@ Saves the current database.
:return: ``True`` if everything is saved, ``False`` otherwise
%End

QgsAuxiliaryLayer *createAuxiliaryLayer( const QgsField &field, QgsVectorLayer *layer, QString *errorMessage /Out/ = 0 ) const /Factory/;
QgsAuxiliaryLayer *createAuxiliaryLayer( const QgsField &field, QgsVectorLayer *layer ) const /Factory/;
%Docstring
Creates an auxiliary layer for a vector layer. A new table is created if
necessary. The primary key to use to construct the auxiliary layer is
@@ -611,7 +611,7 @@ bool QgsAuxiliaryStorage::save() const
}
}

QgsAuxiliaryLayer *QgsAuxiliaryStorage::createAuxiliaryLayer( const QgsField &field, QgsVectorLayer *layer, QString *errorMessage ) const
QgsAuxiliaryLayer *QgsAuxiliaryStorage::createAuxiliaryLayer( const QgsField &field, QgsVectorLayer *layer ) const
{
QgsAuxiliaryLayer *alayer = nullptr;

@@ -623,13 +623,8 @@ QgsAuxiliaryLayer *QgsAuxiliaryStorage::createAuxiliaryLayer( const QgsField &fi

if ( !tableExists( table, database.get() ) )
{
QString msg;
if ( !createTable( field.typeName(), table, database.get(), msg ) )
if ( !createTable( field.typeName(), table, database.get(), mErrorString ) )
{
if ( errorMessage )
{
*errorMessage = msg;
}
return alayer;
}
}
@@ -381,7 +381,7 @@ class CORE_EXPORT QgsAuxiliaryStorage
*
* \returns A new auxiliary layer or NULLPTR if an error happened.
*/
QgsAuxiliaryLayer *createAuxiliaryLayer( const QgsField &field, QgsVectorLayer *layer, QString *errorMessage SIP_OUT = nullptr ) const SIP_FACTORY;
QgsAuxiliaryLayer *createAuxiliaryLayer( const QgsField &field, QgsVectorLayer *layer ) const SIP_FACTORY;

/**
* Removes a table from the auxiliary storage.
@@ -437,7 +437,7 @@ class CORE_EXPORT QgsAuxiliaryStorage
QString mFileName; // original filename
QString mTmpFileName; // temporary filename used in copy mode
bool mCopy = false;
QString mErrorString;
mutable QString mErrorString;
};

#endif

0 comments on commit 5729958

Please sign in to comment.