Skip to content
Permalink
Browse files

spatialite provider:

- fix #4569
- select newly added spatialite database
  • Loading branch information
jef-n committed Jul 4, 2012
1 parent fd2f341 commit 72d7a238b76c2d9a137da7a7eebe9d7833509561
@@ -3600,13 +3600,6 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
values = QString( ") VALUES (" );
separator = "";

if ( !mPrimaryKey.isEmpty() )
{
sql += separator + quotedIdentifier( mPrimaryKey );
values += separator + "NULL";
separator = ",";
}

if ( !mGeometryColumn.isNull() )
{
sql += separator + quotedIdentifier( mGeometryColumn );
@@ -3621,11 +3614,12 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
continue;

QString fieldname = fit->name();
if ( fieldname.isEmpty() || fieldname == mGeometryColumn || fieldname == mPrimaryKey )
if ( fieldname.isEmpty() || fieldname == mGeometryColumn )
continue;

sql += separator + quotedIdentifier( fieldname );
values += separator + "?";
separator = ",";
}

sql += values;
@@ -3673,7 +3667,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
continue;

QString fieldname = fit->name();
if ( fieldname.isEmpty() || fieldname == mGeometryColumn || fieldname == mPrimaryKey )
if ( fieldname.isEmpty() || fieldname == mGeometryColumn )
continue;

QVariant::Type type = fit->type();
@@ -493,6 +493,8 @@ void QgsSpatiaLiteSourceSelect::setConnectionListPosition()
// If possible, set the item currently displayed database
QString toSelect = settings.value( "/SpatiaLite/connections/selected" ).toString();

toSelect += "@" + settings.value( "/SpatiaLite/connections/" + toSelect + "/sqlitepath" ).toString();

cmbConnections->setCurrentIndex( cmbConnections->findText( toSelect ) );

if ( cmbConnections->currentIndex() < 0 )

0 comments on commit 72d7a23

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