From 9613f96e6a6f96ad02a0fc926054132811ae2bb1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 3 Apr 2018 16:30:25 +0300 Subject: Accounts() : iterator for accounts --- plugins/CSList/src/cslist.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'plugins/CSList/src') diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index a63999c415..cf4a830c2a 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -93,13 +93,9 @@ static int OnInitOptions(WPARAM wparam, LPARAM) static int OnCreateMenuItems(WPARAM, LPARAM) { - int protoCount; - PROTOACCOUNT** pdesc; - Proto_EnumAccounts(&protoCount, &pdesc); - - for (int i = 0; i < protoCount; i++) - if (ProtoServiceExists(pdesc[i]->szModuleName, PS_SETCUSTOMSTATUSEX)) - addProtoStatusMenuItem(pdesc[i]->szModuleName); + for (auto &pa : Accounts()) + if (ProtoServiceExists(pa->szModuleName, PS_SETCUSTOMSTATUSEX)) + addProtoStatusMenuItem(pa->szModuleName); return 0; } -- cgit v1.2.3