Skip to content
Permalink
Browse files

enhance error message when change/added attributes mismatch (refs #8481)

  • Loading branch information
jef-n committed Jun 11, 2014
1 parent 1a85129 commit dc9148c674ff554d23ad909e30267dcc46c3bd9f
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/core/qgsvectorlayereditbuffer.cpp
@@ -327,7 +327,24 @@ bool QgsVectorLayerEditBuffer::commitChanges( QStringList& commitErrors )
const QgsField& newField = newFields[i];
if ( attributeChangesOk && oldField != newField )
{
commitErrors << tr( "ERROR: field with index %1 is not the same!" ).arg( i );
commitErrors
<< tr( "ERROR: field with index %1 is not the same!" ).arg( i )
<< tr( "Provider: %1" ).arg( L->providerType() )
<< tr( "Storage: %1" ).arg( L->storageType() )
<< QString( "%1: name=%2 type=%3 typeName=%4 len=%5 precision=%6" )
.arg( tr( "expected field" ) )
.arg( oldField.name() )
.arg( QVariant::typeToName( oldField.type() ) )
.arg( oldField.typeName() )
.arg( oldField.length() )
.arg( oldField.precision() )
<< QString( "%1: name=%2 type=%3 typeName=%4 len=%5 precision=%6" )
.arg( tr( "retrieved field" ) )
.arg( newField.name() )
.arg( QVariant::typeToName( newField.type() ) )
.arg( newField.typeName() )
.arg( newField.length() )
.arg( newField.precision() );
attributeChangesOk = false; // don't try attribute updates - they'll fail.
}
}

0 comments on commit dc9148c

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