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/AutoShutdown/src/settingsdlg.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'plugins/AutoShutdown/src') diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 662196b3ca..f16108840d 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -51,13 +51,10 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam) static bool AnyProtoHasCaps(DWORD caps1) { - int nProtoCount; - PROTOACCOUNT **protos; - Proto_EnumAccounts(&nProtoCount, &protos); - - for (int i = 0; i < nProtoCount; ++i) - if (CallProtoService(protos[i]->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&caps1) + for (auto &pa : Accounts()) + if (CallProtoService(pa->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0) & caps1) return true; /* CALLSERVICE_NOTFOUND also handled gracefully */ + return false; } -- cgit v1.2.3