From 84c6ccfafbfe7b320443294ac78b3033774602cf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Nov 2012 12:11:11 +0000 Subject: proper file for the precompiled headers git-svn-id: http://svn.miranda-ng.org/main/trunk@2415 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_contact.cpp | 34 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'plugins/Clist_modern/src/modern_contact.cpp') diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index e1cc237e36..4f1de747b5 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -83,42 +83,41 @@ DWORD CompareContacts2_getLMTime(HANDLE hContact) int GetProtoIndex(char * szName) { - PROTOACCOUNT **accs = NULL; - int accCount = 0; - int i; - if ( !szName) return -1; - ProtoEnumAccounts( &accCount, &accs ); - for (i=0; i < accCount; i++) - if ( !mir_strcmpi(szName,accs[i]->szModuleName)) - return accs[i]->iOrder; - return -1; + if (szName) { + PROTOACCOUNT **accs = NULL; + int accCount = 0; + ProtoEnumAccounts( &accCount, &accs ); + + for (int i=0; i < accCount; i++) + if ( !mir_strcmpi(szName, accs[i]->szModuleName)) + return accs[i]->iOrder; + } + + return -1; } int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int by) { - HANDLE a; HANDLE b; TCHAR *namea, *nameb; int statusa,statusb; char *szProto1,*szProto2; - + if ((INT_PTR)contact1 < 100 || (INT_PTR)contact2 < 100) return 0; - + a = contact1->hContact; b = contact2->hContact; - + namea = (TCHAR *)contact1->szText; statusa = GetContactCachedStatus(contact1->hContact); szProto1 = contact1->proto; - + nameb = (TCHAR *)contact2->szText; statusb = GetContactCachedStatus(contact2->hContact); szProto2 = contact2->proto; - - if (by == SORTBY_STATUS) - { //status + if (by == SORTBY_STATUS) { //status int ordera,orderb; ordera = GetStatusModeOrdering(statusa); orderb = GetStatusModeOrdering(statusb); @@ -191,7 +190,6 @@ INT_PTR ToggleHideOffline(WPARAM wParam,LPARAM lParam) INT_PTR ToggleGroups(WPARAM wParam,LPARAM lParam) { - db_set_b(NULL, "CList", "UseGroups", (BYTE) !db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT)); pcli->pfnLoadContactTree(); -- cgit v1.2.3