Skip to content

Commit

Permalink
Improve handling of geometryless tables in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 29, 2016
1 parent e830c23 commit 4a3d3db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/providers/mssql/qgsmssqldataitems.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresdataitems.cpp
Expand Up @@ -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() )
Expand Down

0 comments on commit 4a3d3db

Please sign in to comment.