mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix for ticket #320 (delimited plugin doesn't attempt to choose
sensible fields for the lat/long) git-svn-id: http://svn.osgeo.org/qgis/trunk@5896 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
7575886b1b
commit
d01a00268d
@ -126,7 +126,26 @@ void QgsDelimitedTextPluginGui::updateFieldLists()
|
||||
cmbXField->insertItem(*it);
|
||||
cmbYField->insertItem(*it);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Have a go at setting the selected items in the X and Y
|
||||
// combo boxes to something sensible.
|
||||
int indexX = cmbXField->findText("X", Qt::MatchContains);
|
||||
int indexY = cmbXField->findText("Y", Qt::MatchContains);
|
||||
if (indexX != -1 && indexY != -1)
|
||||
{
|
||||
cmbXField->setCurrentIndex(indexX);
|
||||
cmbYField->setCurrentIndex(indexY);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexX = cmbXField->findText("lon", Qt::MatchContains);
|
||||
indexY = cmbXField->findText("lat", Qt::MatchContains);
|
||||
if (indexX != -1 && indexY != -1)
|
||||
{
|
||||
cmbXField->setCurrentIndex(indexX);
|
||||
cmbYField->setCurrentIndex(indexY);
|
||||
}
|
||||
}
|
||||
// enable the buttons
|
||||
enableButtons();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user