From f90be5cdeec5875d1022e1ef35f5b101bd76ac84 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Oct 2012 07:46:53 +0000 Subject: service call replaced with the direct function call git-svn-id: http://svn.miranda-ng.org/main/trunk@1857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/clcitems.cpp | 8 ++++---- src/modules/clist/clistmod.cpp | 8 ++++---- src/modules/clist/contact.cpp | 4 ++-- src/modules/clist/groups.cpp | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/modules/clist') diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 4ef4118104..0b343f19ca 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -106,13 +106,13 @@ struct ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, group->totalMembers = 0; if (flags != (DWORD) - 1 && pNextField == NULL && calcTotalMembers) { DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); - HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + HANDLE hContact = db_find_first(); while (hContact) { ClcCacheEntryBase* cache = cli.pfnGetCacheEntry(hContact); if ( !lstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden)) group->totalMembers++; - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); + hContact = db_find_next(hContact); } } } @@ -381,7 +381,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) } } - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + hContact = db_find_first(); while (hContact) { if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) { if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv)) @@ -414,7 +414,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) else cli.pfnAddContactToGroup(dat, group, hContact); } } - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); + hContact = db_find_next(hContact); } if (style & CLS_HIDEEMPTYGROUPS) { diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 2f1cbfbfd0..2bc691ca94 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -146,13 +146,13 @@ static int ProtocolAck(WPARAM, LPARAM lParam) if ((int) ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) { DWORD caps = (DWORD)CallProtoServiceInt(NULL,ack->szModule, PS_GETCAPS, PFLAGNUM_1, 0); if (caps & PF1_SERVERCLIST) { - HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + HANDLE hContact = db_find_first(); while (hContact) { char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0); if (szProto != NULL && !strcmp(szProto, ack->szModule)) if (db_get_b(hContact, "CList", "Delete", 0)) CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); + hContact = db_find_next(hContact); } } } @@ -552,9 +552,9 @@ void UnloadContactListModule() return; //remove transitory contacts - HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + HANDLE hContact = db_find_first(); while (hContact != NULL) { - HANDLE hNext = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); + HANDLE hNext = db_find_next(hContact); if (db_get_b(hContact, "CList", "NotOnList", 0)) CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); hContact = hNext; diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 932efb03fc..dd5afb8094 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -79,12 +79,12 @@ void fnLoadContactTree(void) } hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT); - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + hContact = db_find_first(); while (hContact != NULL) { status = GetContactStatus(hContact); if (( !hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0)) cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0), status, hContact), 1); - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); + hContact = db_find_next(hContact); } sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT); sortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT); diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 931a06d36e..1cfc8b7a9d 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -183,9 +183,9 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) CLISTGROUPCHANGE grpChg = { sizeof(CLISTGROUPCHANGE), NULL, NULL }; - for (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + for (hContact = db_find_first(); hContact; - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0)) + hContact = db_find_next(hContact)) { if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv)) continue; @@ -273,7 +273,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) DBWriteContactSettingTString(NULL, "CListGroups", idstr, str); //must rename setting in all child contacts too - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + hContact = db_find_first(); do { ClcCacheEntryBase* cache = cli.pfnGetCacheEntry(hContact); if ( !lstrcmp(cache->tszGroup, oldName)) { @@ -283,7 +283,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) cli.pfnCheckCacheItem(cache); } } - while ((hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0)) != NULL); + while ((hContact = db_find_next(hContact)) != NULL); //rename subgroups { -- cgit v1.2.3