Skip to content
Permalink
Browse files

[OGR provider] Fix declaration of types (master regression) and updat…

…e more sensible values for min/max length
  • Loading branch information
rouault committed Oct 27, 2016
1 parent 984ec65 commit 631db7b8e63a7385cbba0ea21136265b66ede4db
Showing with 12 additions and 11 deletions.
  1. +12 −11 src/providers/ogr/qgsogrprovider.cpp
@@ -402,26 +402,27 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
open( OpenModeInitial );
setNativeTypes( QList<NativeType>()
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), QStringLiteral( "integer" ), QVariant::Int, 1, 10 )
QList<NativeType> nativeTypes;
nativeTypes
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), QStringLiteral( "integer" ), QVariant::Int, 0, 11 )
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer 64 bit)" ), "integer64", QVariant::LongLong, 1, 10 )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer 64 bit)" ), "integer64", QVariant::LongLong, 0, 21 )
#endif
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (real)" ), QStringLiteral( "double" ), QVariant::Double, 1, 20, 0, 15 )
<< QgsVectorDataProvider::NativeType( tr( "Text (string)" ), QStringLiteral( "string" ), QVariant::String, 1, 255 )
<< QgsVectorDataProvider::NativeType( tr( "Date" ), QStringLiteral( "date" ), QVariant::Date, 8, 8 )
);
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (real)" ), QStringLiteral( "double" ), QVariant::Double, 0, 20, 0, 15 )
<< QgsVectorDataProvider::NativeType( tr( "Text (string)" ), QStringLiteral( "string" ), QVariant::String, 0, 65535 )
<< QgsVectorDataProvider::NativeType( tr( "Date" ), QStringLiteral( "date" ), QVariant::Date, 8, 8 );

// Some drivers do not support datetime type
// Please help to fill this list
if ( ogrDriverName != QLatin1String( "ESRI Shapefile" ) )
{
setNativeTypes( QList<NativeType>()
<< QgsVectorDataProvider::NativeType( tr( "Time" ), QStringLiteral( "time" ), QVariant::Time, -1, -1 )
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), QStringLiteral( "datetime" ), QVariant::DateTime )
);
nativeTypes
<< QgsVectorDataProvider::NativeType( tr( "Time" ), QStringLiteral( "time" ), QVariant::Time, -1, -1 )
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), QStringLiteral( "datetime" ), QVariant::DateTime );
}

setNativeTypes( nativeTypes );

QgsOgrConnPool::instance()->ref( dataSourceUri() );
}

0 comments on commit 631db7b

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