Skip to content
Permalink
Browse files

Fix for #6309, add case-insensitive sort for vector provider encodings

  • Loading branch information
dakcarto committed Sep 6, 2012
1 parent 24d50e4 commit 652deba734269c2c70bca13b042a01b7eed88451
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/core/qgsvectordataprovider.cpp
@@ -460,6 +460,11 @@ QVariant QgsVectorDataProvider::convertValue( QVariant::Type type, QString value
return v;
}

static bool _compareEncodings( const QString& s1, const QString& s2 )
{
return s1.toLower() < s2.toLower();
}

const QStringList &QgsVectorDataProvider::availableEncodings()
{
if ( smEncodings.isEmpty() )
@@ -468,7 +473,6 @@ const QStringList &QgsVectorDataProvider::availableEncodings()
{
smEncodings << codec;
}
qSort( smEncodings );
#if 0
smEncodings << "BIG5";
smEncodings << "BIG5-HKSCS";
@@ -518,6 +522,9 @@ const QStringList &QgsVectorDataProvider::availableEncodings()
#endif
}

// Do case-insensitive sorting of encodings
qSort( smEncodings.begin(), smEncodings.end(), _compareEncodings );

return smEncodings;
}

0 comments on commit 652deba

Please sign in to comment.
You can’t perform that action at this time.