Skip to content
Permalink
Browse files
unquote field names in delimited text plugin like in the provider
git-svn-id: http://svn.osgeo.org/qgis/trunk@13646 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 4, 2010
1 parent 5926edf commit 0c22ca88e1b571c341482eabdfc792e427c32ecb
Showing with 12 additions and 7 deletions.
  1. +12 −7 src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
@@ -154,14 +154,19 @@ void QgsDelimitedTextPluginGui::updateFieldLists()
//
// We don't know anything about a text based field other
// than its name. All fields are assumed to be text
for ( QStringList::Iterator it = fieldList.begin(); it != fieldList.end(); ++it )
foreach( QString field, fieldList )
{
// add item to both drop-downs (X field and Y field)
if (( *it ).length() > 0 )
{
cmbXField->addItem( *it );
cmbYField->addItem( *it );
}
if (( field.left( 1 ) == "'" || field.left( 1 ) == "\"" ) &&
field.left( 1 ) == field.right( 1 ) )
// eat quotes
field = field.mid( 1, field.length() - 2 );

if ( field.length() == 0 )
// skip empty field names
continue;

cmbXField->addItem( field );
cmbYField->addItem( field );
}
// Have a go at setting the selected items in the X and Y
// combo boxes to something sensible.

0 comments on commit 0c22ca8

Please sign in to comment.