[QGIS Commit] r8654 - in trunk/qgis/src: app core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Jun 18 06:37:19 EDT 2008
Author: jef
Date: 2008-06-18 06:37:19 -0400 (Wed, 18 Jun 2008)
New Revision: 8654
Modified:
trunk/qgis/src/app/qgsdbsourceselect.cpp
trunk/qgis/src/core/qgsvectorlayer.cpp
Log:
revert r8586 and solve issue in QgsVectorLayer (fixes #1126)
Modified: trunk/qgis/src/app/qgsdbsourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsdbsourceselect.cpp 2008-06-18 07:49:58 UTC (rev 8653)
+++ trunk/qgis/src/app/qgsdbsourceselect.cpp 2008-06-18 10:37:19 UTC (rev 8654)
@@ -249,14 +249,6 @@
{
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 @@
}
//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,13 +327,8 @@
}
}
- if(schemaName!=currentSchema)
- {
- query += "\"" + schemaName + "\".";
- }
+ query += "\"" + schemaName + "\".\"" + tableName + "\" " + "(" + geomColumnName + ") sql=" + sql;
- query += "\"" + tableName + "\" " + "(" + geomColumnName + ") sql=" + sql;
-
m_selectedTables.push_back(query);
}
}
Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp 2008-06-18 07:49:58 UTC (rev 8653)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp 2008-06-18 10:37:19 UTC (rev 8654)
@@ -2224,6 +2224,9 @@
lName = name();
setLayerName(lName);
QgsDebugMsg("Beautifying layer name " + name());
+
+ // deal with unnecessary schema qualification to make v.in.ogr happy
+ mDataSource = mDataProvider->dataSourceUri();
}
// label
More information about the QGIS-commit
mailing list