From 1a8fbb98e30b55aee908e3ad2382622a0688c635 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Sep 2013 19:27:31 +0000 Subject: direct access to CListGroups restricted git-svn-id: http://svn.miranda-ng.org/main/trunk@6009 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/addcontact/addcontact.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/modules') diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index d12b5627e8..d178ec4840 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -85,16 +85,10 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp acs->szProto = GetContactProto(acs->handle); { - int groupId; - for (groupId = 0; groupId < 999; groupId++) { - DBVARIANT dbv; - char idstr[4]; - int id; - _itoa(groupId, idstr, 10); - if (db_get_ts(NULL, "CListGroups", idstr, &dbv)) break; - id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)(dbv.ptszVal+1)); + TCHAR *grpName; + for (int groupId = 1; (grpName = cli.pfnGetGroupName(groupId, NULL)) != NULL; groupId++) { + int id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)grpName); SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA , id, groupId+1); - db_free(&dbv); } } -- cgit v1.2.3