Skip to content
Permalink
Browse files

Fix for problems with unique value dialog and some postgis tables

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7138 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Aug 14, 2007
1 parent c666e72 commit f17eeacb85c2d8564beecc47557b20e016f53182
Showing with 16 additions and 2 deletions.
  1. +13 −2 src/app/qgsuniquevaluedialog.cpp
  2. +3 −0 src/providers/postgres/qgspostgresprovider.cpp
@@ -119,8 +119,19 @@ void QgsUniqueValueDialog::apply()
renderer->insertValue(it->first,newsymbol);
}

renderer->setClassificationField(mClassificationComboBox->currentItem());
mVectorLayer->setRenderer(renderer);
QgsVectorDataProvider *provider = dynamic_cast<QgsVectorDataProvider *>(mVectorLayer->getDataProvider());
if (provider)
{
int fieldIndex = provider->indexFromFieldName(mClassificationComboBox->currentText());
if(fieldIndex > 0)
{
renderer->setClassificationField(fieldIndex);
mVectorLayer->setRenderer(renderer);
return;
}
}

delete renderer; //something went wrong
}

void QgsUniqueValueDialog::changeClassificationAttribute()
@@ -1178,6 +1178,9 @@ int QgsPostgresProvider::SRCFromViewColumn(const QString& ns, const QString& rel

//relation is table, we just have to add the type
QString typeSql = "SELECT pg_type.typname FROM pg_attribute, pg_class, pg_namespace, pg_type WHERE pg_class.relname = '" + relname + "' AND pg_namespace.nspname = '" + ns + "' AND pg_attribute.attname = '" + attname_table + "' AND pg_attribute.attrelid = pg_class.oid AND pg_class.relnamespace = pg_namespace.oid AND pg_attribute.atttypid = pg_type.oid";
QgsDebugMsg("***********************************************************************************");
QgsDebugMsg(typeSql);
QgsDebugMsg("***********************************************************************************");
PGresult* typeSqlResult = PQexec(connection, (const char*)(typeSql.utf8()));
if(PQntuples(typeSqlResult) < 1)
{

0 comments on commit f17eeac

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