Skip to content
Permalink
Browse files
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
  • Loading branch information
g_j_m committed Sep 30, 2006
1 parent 7575886 commit d01a00268d7385a45bc312caf85dd89290161566
Showing with 20 additions and 1 deletion.
  1. +20 −1 src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
@@ -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();
}

0 comments on commit d01a002

Please sign in to comment.