diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
commit | 9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch) | |
tree | f8fe94a3efe7598a2af926f264d354f7a08fb943 /plugins/CSList | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/CSList')
-rw-r--r-- | plugins/CSList/src/cslist.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
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; } |