File tree 1 file changed +20
-1
lines changed
src/plugins/delimited_text
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,26 @@ void QgsDelimitedTextPluginGui::updateFieldLists()
126
126
cmbXField->insertItem (*it);
127
127
cmbYField->insertItem (*it);
128
128
}
129
- }
129
+ }
130
+ // Have a go at setting the selected items in the X and Y
131
+ // combo boxes to something sensible.
132
+ int indexX = cmbXField->findText (" X" , Qt::MatchContains);
133
+ int indexY = cmbXField->findText (" Y" , Qt::MatchContains);
134
+ if (indexX != -1 && indexY != -1 )
135
+ {
136
+ cmbXField->setCurrentIndex (indexX);
137
+ cmbYField->setCurrentIndex (indexY);
138
+ }
139
+ else
140
+ {
141
+ indexX = cmbXField->findText (" lon" , Qt::MatchContains);
142
+ indexY = cmbXField->findText (" lat" , Qt::MatchContains);
143
+ if (indexX != -1 && indexY != -1 )
144
+ {
145
+ cmbXField->setCurrentIndex (indexX);
146
+ cmbYField->setCurrentIndex (indexY);
147
+ }
148
+ }
130
149
// enable the buttons
131
150
enableButtons ();
132
151
}
You can’t perform that action at this time.
0 commit comments