Skip to content
Permalink
Browse files
Adding missing type definitions to delimited text provider
  • Loading branch information
ccrook committed Feb 26, 2015
1 parent c20d02d commit 63f612f9feff42241cfc431613d33b2364179cf5
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
@@ -84,6 +84,14 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
, mBuildSpatialIndex( false )
, mSpatialIndex( 0 )
{

// Add supported types to enable creating expression fields in field calculator
mNativeTypes
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), "integer", QVariant::Int, 0, 10 )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (double)" ), "double precision", QVariant::Double, -1, -1, -1, -1 )
<< QgsVectorDataProvider::NativeType( tr( "Text, unlimited length (text)" ), "text", QVariant::String, -1, -1, -1, -1 )
;

QgsDebugMsg( "Delimited text file uri is " + uri );

QUrl url = QUrl::fromEncoded( uri.toAscii() );

2 comments on commit 63f612f

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Feb 26, 2015

@ccrook should this be backported to 2.8?

@ccrook

This comment has been minimized.

Copy link
Contributor Author

@ccrook ccrook replied Feb 26, 2015

@nyalldawson Yes I think so. This is the first part of a fix for issue #12257 which prevents creating virtual fields with delimited text layers. The second part will require fixing the Field Calculator UI code.

Please sign in to comment.