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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed May 12 18:45:26 EDT 2010


Author: jef
Date: 2010-05-12 18:45:25 -0400 (Wed, 12 May 2010)
New Revision: 13470

Modified:
   trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp
   trunk/qgis/src/providers/postgres/qgspostgresprovider.h
Log:
fix #2707

Modified: trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp
===================================================================
--- trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp	2010-05-12 21:34:51 UTC (rev 13469)
+++ trunk/qgis/src/providers/postgres/qgspostgresprovider.cpp	2010-05-12 22:45:25 UTC (rev 13470)
@@ -2205,10 +2205,10 @@
   return postgisVersionInfo;
 }
 
-QByteArray QgsPostgresProvider::paramValue( QString fieldValue, const QString &defaultValue ) const
+QString QgsPostgresProvider::paramValue( QString fieldValue, const QString &defaultValue ) const
 {
   if ( fieldValue.isNull() )
-    return QByteArray( 0 );  // QByteArray(0).isNull() is true
+    return QString::null;
 
   if ( fieldValue == defaultValue && !defaultValue.isNull() )
   {
@@ -2219,17 +2219,17 @@
     if ( PQgetisnull( result, 0, 0 ) )
     {
       PQclear( result );
-      return QByteArray( 0 );  // QByteArray(0).isNull() is true
+      return QString::null;
     }
     else
     {
       QString val = QString::fromUtf8( PQgetvalue( result, 0, 0 ) );
       PQclear( result );
-      return val.toUtf8();
+      return val;
     }
   }
 
-  return fieldValue.toUtf8();
+  return fieldValue;
 }
 
 bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )

Modified: trunk/qgis/src/providers/postgres/qgspostgresprovider.h
===================================================================
--- trunk/qgis/src/providers/postgres/qgspostgresprovider.h	2010-05-12 21:34:51 UTC (rev 13469)
+++ trunk/qgis/src/providers/postgres/qgspostgresprovider.h	2010-05-12 22:45:25 UTC (rev 13470)
@@ -588,7 +588,7 @@
     void customEvent( QEvent *e );
 
     void appendGeomString( QgsGeometry *geom, QString &geomParam ) const;
-    QByteArray paramValue( QString fieldvalue, const QString &defaultValue ) const;
+    QString paramValue( QString fieldvalue, const QString &defaultValue ) const;
 
     class Conn
     {



More information about the QGIS-commit mailing list