[QGIS Commit] r12369 - trunk/qgis/src/providers/postgres

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Dec 7 19:53:54 EST 2009


Author: jef
Date: 2009-12-07 19:53:53 -0500 (Mon, 07 Dec 2009)
New Revision: 12369

Modified:
   trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp
Log:
include key= field in all postgres data source uris (only for views before)

Modified: trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp
===================================================================
--- trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp	2009-12-08 00:43:56 UTC (rev 12368)
+++ trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp	2009-12-08 00:53:53 UTC (rev 12369)
@@ -159,8 +159,8 @@
   if ( mCurrentSchema == mSchemaName )
   {
     mUri.clearSchema();
-    setDataSourceUri( mUri.uri() );
   }
+
   if ( mSchemaName == "" )
     mSchemaName = mCurrentSchema;
 
@@ -250,6 +250,11 @@
   {
     valid = false;
   }
+  else
+  {
+    mUri.setKeyColumn( primaryKey );
+    setDataSourceUri( mUri.uri() );
+  }
 
   // Close the database connection if the layer isn't going to be loaded.
   if ( !valid )
@@ -1097,9 +1102,6 @@
         // From the view columns, choose one for which the underlying
         // column is suitable for use as a key into the view.
         primaryKey = chooseViewColumn( cols );
-
-        mUri.setKeyColumn( primaryKey );
-        setDataSourceUri( mUri.uri() );
       }
     }
     else
@@ -3159,9 +3161,6 @@
   return POSTGRES_DESCRIPTION;
 } //  QgsPostgresProvider::description()
 
-
-
-
 /**
  * Class factory to return a pointer to a newly created
  * QgsPostgresProvider object



More information about the QGIS-commit mailing list