Skip to content

Commit

Permalink
unquote field names in delimited text plugin like in the provider
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13646 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 4, 2010
1 parent 8f7304e commit caa934d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit caa934d

Please sign in to comment.