diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-16 12:01:20 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-16 12:01:20 +0000 |
commit | 403ee5e18b2393a430ff5e9d3f0cb5feccdb341e (patch) | |
tree | 376596c08e208029430901904eb1568ba37024fb | |
parent | 701b1a977500e9b5326ef6be8938c1020500a9ec (diff) |
Clist_modern: fix sorting by status
git-svn-id: http://svn.miranda-ng.org/main/trunk@16674 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_modern/src/modern_contact.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 891168dffb..297b366c1e 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -105,7 +105,8 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) ClcCacheEntry *c2 = cliGetCacheEntry(contact2->hContact);
for (int i = 0; i < _countof(g_CluiData.bSortByOrder); i++) {
- int by = g_CluiData.bSortByOrder[i];
+ BYTE &by = g_CluiData.bSortByOrder[i];
+
if (by == SORTBY_STATUS) { //status
int ordera = GetStatusModeOrdering(c1->getStatus());
int orderb = GetStatusModeOrdering(c2->getStatus());
@@ -117,12 +118,13 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) // one is offline: offline goes below online
if (g_CluiData.fSortNoOfflineBottom == 0) {
int statusa = c1->getStatus();
- int statusb = c1->getStatus();
+ int statusb = c2->getStatus();
if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE))
return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
}
- int r;
+ int r = 0;
+
switch (by) {
case SORTBY_NAME: // name
r = mir_tstrcmpi(contact1->szText, contact2->szText);
|