[QGIS Commit] r14130 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Aug 23 07:45:24 EDT 2010


Author: timlinux
Date: 2010-08-23 11:45:24 +0000 (Mon, 23 Aug 2010)
New Revision: 14130

Modified:
   trunk/qgis/src/core/qgsvectorfilewriter.cpp
Log:
More useful debug error message when trying to write a vector attribute with an invalid QVariant type. Message displayed now looks like this: Invalid variant type for field lon 1: Expected Type float : Received Value: 20.375

Modified: trunk/qgis/src/core/qgsvectorfilewriter.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorfilewriter.cpp	2010-08-23 07:53:51 UTC (rev 14129)
+++ trunk/qgis/src/core/qgsvectorfilewriter.cpp	2010-08-23 11:45:24 UTC (rev 14130)
@@ -32,6 +32,7 @@
 #include <QTextCodec>
 #include <QTextStream>
 #include <QSet>
+#include <QMetaType>
 
 #include <cassert>
 #include <cstdlib> // size_t
@@ -341,7 +342,10 @@
         OGR_F_SetFieldString( poFeature, ogrField, mCodec->fromUnicode( attrValue.toString() ).data() );
         break;
       default:
-        QgsDebugMsg( "Invalid variant type for field " + QString::number( ogrField ) + ": " + QString::number( attrValue.type() ) );
+        QgsDebugMsg( "Invalid variant type for field " + QString( fldIt.value().name() ) + " " 
+            + QString::number( ogrField ) + ": Received Type " + QMetaType::typeName (  attrValue.type() )
+            + " : With Value : " +  attrValue.toString() 
+            );
         return false;
     }
   }



More information about the QGIS-commit mailing list