Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #804 from nyalldawson/bug_8311
Fix some bugs relating to display fields for new vector layers (fixes #8311)
  • Loading branch information
NathanW2 committed Sep 3, 2013
2 parents 70841a8 + eb11479 commit 88d3ade
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -147,10 +147,6 @@ QgsVectorLayer::QgsVectorLayer( QString vectorLayerPath,
// Always set crs
setCoordinateSystem();

mJoinBuffer = new QgsVectorLayerJoinBuffer();

updateFields();

// check if there is a default style / propertysheet defined
// for this layer and if so apply it
bool defaultLoadedFlag = false;
Expand Down Expand Up @@ -271,21 +267,21 @@ void QgsVectorLayer::setDisplayField( QString fldName )
// We assume that the user has organized the data with the
// more "interesting" field names first. As such, name should
// be selected before oldname, othername, etc.
if ( fldName.indexOf( "name", false ) > -1 )
if ( fldName.indexOf( "name", 0, Qt::CaseInsensitive ) > -1 )
{
if ( idxName.isEmpty() )
{
idxName = fldName;
}
}
if ( fldName.indexOf( "descrip", false ) > -1 )
if ( fldName.indexOf( "descrip", 0, Qt::CaseInsensitive ) > -1 )
{
if ( idxName.isEmpty() )
{
idxName = fldName;
}
}
if ( fldName.indexOf( "id", false ) > -1 )
if ( fldName.indexOf( "id", 0, Qt::CaseInsensitive ) > -1 )
{
if ( idxId.isEmpty() )
{
Expand Down Expand Up @@ -1633,6 +1629,10 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
// get and store the feature type
mWkbType = mDataProvider->geometryType();

mJoinBuffer = new QgsVectorLayerJoinBuffer();

updateFields();

// look at the fields in the layer and set the primary
// display field using some real fuzzy logic
setDisplayField();
Expand Down

0 comments on commit 88d3ade

Please sign in to comment.