Skip to content

Commit

Permalink
clean identifier of layer variable passed to the feature form
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 24, 2014
1 parent 62e59c8 commit 56acda6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/qgsattributeformlegacyinterface.cpp
Expand Up @@ -20,13 +20,15 @@

#include <QString>
#include <QDateTime>
#include <QRegExp>

QgsAttributeFormLegacyInterface::QgsAttributeFormLegacyInterface( const QString& function, const QString& pyFormName, QgsAttributeForm* form )
: QgsAttributeFormInterface( form )
, mPyFunctionName( function )
, mPyFormVarName( pyFormName )
{
mPyLayerVarName = QString( "_qgis_layer_%1" ).arg( form->layer()->id() );
mPyLayerVarName.replace( QRegExp( "[^a-zA-Z0-9_]" ), "_" ); // clean identifier

QString initLayer = QString( "%1 = sip.wrapinstance( %2, qgis.core.QgsVectorLayer )" )
.arg( mPyLayerVarName )
Expand Down

0 comments on commit 56acda6

Please sign in to comment.