Skip to content

Commit

Permalink
Prep work for ticket #25 (case sensitivity for attribute table search)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6728 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Feb 28, 2007
1 parent 5d8ef9b commit 8f65621
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/qgssearchtreenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ QgsSearchTreeValue QgsSearchTreeNode::valueAgainst(const QgsAttributeMap& attrib
}


int QgsSearchTreeValue::compare(QgsSearchTreeValue& value1, QgsSearchTreeValue& value2)
int QgsSearchTreeValue::compare(QgsSearchTreeValue& value1, QgsSearchTreeValue& value2, Qt::CaseSensitivity cs)
{
if (value1.isNumeric() || value2.isNumeric())
{
Expand Down Expand Up @@ -424,6 +424,6 @@ int QgsSearchTreeValue::compare(QgsSearchTreeValue& value1, QgsSearchTreeValue&
else
{
// string comparison
return value1.string().compare(value2.string());
return value1.string().compare(value2.string(), cs);
}
}
3 changes: 2 additions & 1 deletion src/core/qgssearchtreenode.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ class QgsSearchTreeValue
QgsSearchTreeValue(double number) { mType = valNumber; mNumber = number; }
QgsSearchTreeValue(int error, QString errorMsg) { mType = valError; mNumber = error; mString = errorMsg; }

static int compare(QgsSearchTreeValue& value1, QgsSearchTreeValue& value2);
static int compare(QgsSearchTreeValue& value1, QgsSearchTreeValue& value2,
Qt::CaseSensitivity = Qt::CaseSensitive);

bool isNumeric() { return mType == valNumber; }
bool isError() { return mType == valError; }
Expand Down

0 comments on commit 8f65621

Please sign in to comment.