Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix type name mismatch
  • Loading branch information
elpaso authored and nyalldawson committed Nov 29, 2021
1 parent 189aa0f commit 062f3c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Expand Up @@ -69,7 +69,7 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( const QString &uri, const Pr
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), QStringLiteral( "integer" ), QVariant::Int, 0, 10 )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer - 64 bit)" ), QStringLiteral( "integer64" ), QVariant::LongLong )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (double)" ), QStringLiteral( "double" ), QVariant::Double, -1, -1, -1, -1 )
<< QgsVectorDataProvider::NativeType( tr( "Text, unlimited length (text)" ), QStringLiteral( "string" ), QVariant::String, -1, -1, -1, -1 )
<< QgsVectorDataProvider::NativeType( tr( "Text, unlimited length (text)" ), QStringLiteral( "text" ), QVariant::String, -1, -1, -1, -1 )

// date type
<< QgsVectorDataProvider::NativeType( tr( "Date" ), QStringLiteral( "date" ), QVariant::Date, -1, -1, -1, -1 )
Expand Down Expand Up @@ -779,7 +779,7 @@ void QgsDelimitedTextProvider::scanFile( bool buildIndexes, bool forceFullScan,
}
else if ( couldBeLongLong[i] )
{
typeName = QStringLiteral( "longlong" );
typeName = QStringLiteral( "integer64" );
}
else if ( couldBeDouble[i] )
{
Expand Down
7 changes: 4 additions & 3 deletions src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
Expand Up @@ -484,8 +484,9 @@ void QgsDelimitedTextSourceSelect::updateFieldLists()
for ( int column = 0; column < tblSample->columnCount(); column++ )
{
QComboBox *typeCombo = new QComboBox( tblSample );
typeCombo->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldText.svg" ) ), tr( "Text" ), "string" );
typeCombo->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldInteger.svg" ) ), tr( "Whole Number" ), "integer" );
typeCombo->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldText.svg" ) ), tr( "Text" ), "text" );
typeCombo->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldInteger.svg" ) ), tr( "Whole Number (integer)" ), "integer" );
typeCombo->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldInteger.svg" ) ), tr( "Whole Number (integer - 64 bit)" ), "integer64" );
typeCombo->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldFloat.svg" ) ), tr( "Decimal Number" ), "double" );
// Not supported by the provider
// typeCombo->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldBool.svg" ) ), tr( "Boolean" ), "bool" );
Expand Down Expand Up @@ -921,7 +922,7 @@ QString QgsDelimitedTextSourceSelect::url( bool skipOverriddenTypes )
if ( typeCombo && typeCombo->currentData().toString() != fieldTypeName )
{
query.addQueryItem( QStringLiteral( "field" ),
QString( fieldName ).replace( ':', QStringLiteral( "%3A" ) ) + ':' + fieldTypeName );
QString( fieldName ).replace( ':', QStringLiteral( "%3A" ) ) + ':' + typeCombo->currentData().toString() );
}
}
}
Expand Down

0 comments on commit 062f3c5

Please sign in to comment.