Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
revert r8586 and solve issue in QgsVectorLayer (fixes #1126)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8654 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 18, 2008
1 parent 0a7069b commit 128fb33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/app/qgsdbsourceselect.cpp
Expand Up @@ -249,14 +249,6 @@ void QgsDbSourceSelect::addTables()
{
m_selectedTables.clear();

QString currentSchema;
QString sql = "select current_schema()";
PGresult *result = PQexec(pd, sql.toUtf8());
if (result && PQresultStatus(result)==PGRES_TUPLES_OK && PQntuples(result)==1 )
{
currentSchema = QString::fromUtf8(PQgetvalue(result, 0, 0));
}

typedef QMap<int, QVector<QString> > schemaInfo;
QMap<QString, schemaInfo> dbInfo;

Expand Down Expand Up @@ -292,7 +284,7 @@ void QgsDbSourceSelect::addTables()
}

//now traverse all the schemas and table infos
QString schemaName, tableName, geomColumnName;
QString schemaName, tableName, geomColumnName, sql;
QString query;

QMap<QString, schemaInfo>::const_iterator schema_it = dbInfo.constBegin();
Expand Down Expand Up @@ -335,12 +327,7 @@ void QgsDbSourceSelect::addTables()
}
}

if(schemaName!=currentSchema)
{
query += "\"" + schemaName + "\".";
}

query += "\"" + tableName + "\" " + "(" + geomColumnName + ") sql=" + sql;
query += "\"" + schemaName + "\".\"" + tableName + "\" " + "(" + geomColumnName + ") sql=" + sql;

m_selectedTables.push_back(query);
}
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2224,6 +2224,9 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
lName = name();
setLayerName(lName);
QgsDebugMsg("Beautifying layer name " + name());

// deal with unnecessary schema qualification to make v.in.ogr happy
mDataSource = mDataProvider->dataSourceUri();
}

// label
Expand Down

0 comments on commit 128fb33

Please sign in to comment.