summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-07 19:27:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-07 19:27:31 +0000
commit1a8fbb98e30b55aee908e3ad2382622a0688c635 (patch)
tree870a5861345c4f0115304655861c1d0137d8b3ef /plugins/Clist_modern/src
parentd2a2a30b0dfd94fa50bf269a17c6486a33114877 (diff)
direct access to CListGroups restricted
git-svn-id: http://svn.miranda-ng.org/main/trunk@6009 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 4cf5074ef6..ad4717d393 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -237,10 +237,6 @@ static int FillDialog(HWND hwnd)
// fill groups
{
- LVITEM item = {0};
- char buf[20];
- DBVARIANT dbv = {0};
-
hwndList = GetDlgItem(hwnd, IDC_GROUPS);
ListView_SetExtendedListViewStyle(hwndList, LVS_EX_CHECKBOXES);
@@ -248,21 +244,17 @@ static int FillDialog(HWND hwnd)
lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
ListView_InsertColumn(hwndList, 0, &lvc);
+ LVITEM item = {0};
item.mask = LVIF_TEXT;
item.iItem = 1000;
item.pszText = TranslateT("Ungrouped contacts");
newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- for (i=0;;i++)
- {
- mir_snprintf(buf, 20, "%d", i);
- if (db_get_ts(NULL, "CListGroups", buf, &dbv))
- break;
-
- item.pszText = &dbv.ptszVal[1];
+ TCHAR *szGroup;
+ for (int i=1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) {
+ item.pszText = szGroup;
newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- db_free(&dbv);
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);