File tree 1 file changed +12
-7
lines changed
src/plugins/delimited_text
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -154,14 +154,19 @@ void QgsDelimitedTextPluginGui::updateFieldLists()
154
154
//
155
155
// We don't know anything about a text based field other
156
156
// than its name. All fields are assumed to be text
157
- for ( QStringList::Iterator it = fieldList. begin (); it != fieldList. end (); ++it )
157
+ foreach ( QString field, fieldList )
158
158
{
159
- // add item to both drop-downs (X field and Y field)
160
- if (( *it ).length () > 0 )
161
- {
162
- cmbXField->addItem ( *it );
163
- cmbYField->addItem ( *it );
164
- }
159
+ if (( field.left ( 1 ) == " '" || field.left ( 1 ) == " \" " ) &&
160
+ field.left ( 1 ) == field.right ( 1 ) )
161
+ // eat quotes
162
+ field = field.mid ( 1 , field.length () - 2 );
163
+
164
+ if ( field.length () == 0 )
165
+ // skip empty field names
166
+ continue ;
167
+
168
+ cmbXField->addItem ( field );
169
+ cmbYField->addItem ( field );
165
170
}
166
171
// Have a go at setting the selected items in the X and Y
167
172
// combo boxes to something sensible.
You can’t perform that action at this time.
0 commit comments