Skip to content
Permalink
Browse files

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
jef committed Jun 18, 2008
1 parent 0a7069b commit 128fb33b71d8410683ca1abbd816d336ddd76557
Showing with 5 additions and 15 deletions.
  1. +2 −15 src/app/qgsdbsourceselect.cpp
  2. +3 −0 src/core/qgsvectorlayer.cpp
@@ -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;

@@ -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();
@@ -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);
}
@@ -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

0 comments on commit 128fb33

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