Skip to content

Commit

Permalink
Adding missing type definitions to delimited text provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrook committed Feb 26, 2015
1 parent c20d02d commit 63f612f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Expand Up @@ -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() );
Expand Down

2 comments on commit 63f612f

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccrook should this be backported to 2.8?

@ccrook
Copy link
Contributor Author

@ccrook ccrook commented on 63f612f Feb 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.