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@13646 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 4, 2010
1 parent 5926edf commit 0c22ca8
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 // We don't know anything about a text based field other
// than its name. All fields are assumed to be text // 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 (( field.left( 1 ) == "'" || field.left( 1 ) == "\"" ) &&
if (( *it ).length() > 0 ) field.left( 1 ) == field.right( 1 ) )
{ // eat quotes
cmbXField->addItem( *it ); field = field.mid( 1, field.length() - 2 );
cmbYField->addItem( *it );
} 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 // Have a go at setting the selected items in the X and Y
// combo boxes to something sensible. // combo boxes to something sensible.
Expand Down

0 comments on commit 0c22ca8

Please sign in to comment.