summaryrefslogtreecommitdiff
authordrw <drw>2005-03-15 18:20:46 (UTC)
committer drw <drw>2005-03-15 18:20:46 (UTC)
commite0a3ecfb3981cbc6fa413b08b123685a6c2632d1 (patch) (side-by-side diff)
tree04e9592ba48c5a25a8ffd474cec923c2bfdfa9bd
parent90d940ea8244140b25552bb8a28eacb7d3db01e8 (diff)
downloadopie-e0a3ecfb3981cbc6fa413b08b123685a6c2632d1.zip
opie-e0a3ecfb3981cbc6fa413b08b123685a6c2632d1.tar.gz
opie-e0a3ecfb3981cbc6fa413b08b123685a6c2632d1.tar.bz2
Fix addressbook sort by implementing sorting by 'File As' name
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/private/opimcontactsortvector.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/opiepim/private/opimcontactsortvector.cpp b/libopie2/opiepim/private/opimcontactsortvector.cpp
index 9e186fe..8c7d5ca 100644
--- a/libopie2/opiepim/private/opimcontactsortvector.cpp
+++ b/libopie2/opiepim/private/opimcontactsortvector.cpp
@@ -32,27 +32,27 @@
namespace Opie {
namespace Internal {
OPimContactSortVector::OPimContactSortVector( uint size, bool asc, int sort )
: OPimSortVector<OPimContact>( size, asc, sort ) {}
int OPimContactSortVector::compareItems( const OPimContact& left,
const OPimContact& right ) {
if ( left.uid() == right.uid() )
return 0;
bool soTitle, soSummary, soFirstName, soMiddleName, soSuffix, soEmail,
- soNick, soAnni, soBirth, soGender;
+ soNick, soFileAs, soAnni, soBirth, soGender;
soTitle = soSummary = soFirstName = soMiddleName = soSuffix = soEmail =
- soNick = soAnni = soBirth = soGender = false;
+ soNick = soFileAs = soAnni = soBirth = soGender = false;
int ret = 0;
bool asc = sortAscending();
switch( sortOrder() ) {
case OPimContactAccess::SortSummary:
ret = testString( left.fileAs(), right.fileAs() );
soSummary = true;
break;
case OPimContactAccess::SortTitle:
ret = testString( left.title(), right.title() );
soTitle = true;
break;
@@ -67,24 +67,28 @@ int OPimContactSortVector::compareItems( const OPimContact& left,
case OPimContactAccess::SortSuffix:
ret = testString( left.suffix(), right.suffix() );
soSuffix = true;
break;
case OPimContactAccess::SortEmail:
ret = testString( left.defaultEmail(), right.defaultEmail() );
soEmail = true;
break;
case OPimContactAccess::SortNickname:
ret = testString( left.nickname(), right.nickname() );
soNick = true;
break;
+ case OPimContactAccess::SortFileAsName:
+ ret = testString( left.fileAs(), right.fileAs() );
+ soFileAs = true;
+ break;
case OPimContactAccess::SortAnniversary:
ret = testDate( left.anniversary(), right.anniversary() );
soAnni = true;
break;
case OPimContactAccess::SortByDate:
case OPimContactAccess::SortBirthday:
ret = testDate( left.birthday(), right.birthday() );
soBirth = true;
break;
case OPimContactAccess::SortGender:
ret = testString( left.gender(), right.gender() );
soGender = true;