Skip to content
Permalink
Browse files

Improve handling of geometryless tables in browser

  • Loading branch information
nyalldawson committed Jan 29, 2016
1 parent e830c23 commit 4a3d3db2d21862152c31a51a71ee4264ee77bb91
Showing with 4 additions and 2 deletions.
  1. +3 −1 src/providers/mssql/qgsmssqldataitems.cpp
  2. +1 −1 src/providers/postgres/qgspostgresdataitems.cpp
@@ -377,7 +377,9 @@ bool QgsMssqlConnectionItem::handleDrop( const QMimeData* data, const QString& t
tableName = u.name;
}

QString uri = connInfo() + " table=" + tableName + " (geom)";
QString uri = connInfo() + " table=" + tableName;
if ( srcLayer->geometryType() != QGis::NoGeometry )
uri += " (geom)";

QgsVectorLayerImport::ImportError err;
QString importError;
@@ -222,7 +222,7 @@ bool QgsPGConnectionItem::handleDrop( const QMimeData * data, QString toSchema )

if ( srcLayer->isValid() )
{
uri.setDataSource( QString(), u.name, "geom" );
uri.setDataSource( QString(), u.name, srcLayer->geometryType() != QGis::NoGeometry ? "geom" : QString() );
QgsDebugMsg( "URI " + uri.uri( false ) );

if ( !toSchema.isNull() )

0 comments on commit 4a3d3db

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