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/MirandaG15/src/CAppletManager.cpp | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/MirandaG15/src/CAppletManager.cpp')
-rw-r--r-- | plugins/MirandaG15/src/CAppletManager.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 3abdd9c0cb..2f3375b481 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -81,23 +81,18 @@ bool CAppletManager::Initialize(tstring strAppletName) m_hMIHookChatEvent = HookEvent(ME_GC_HOOK_EVENT, CAppletManager::HookChatInbound); // enumerate protocols - int iCount; int iProtoCount = 0; - PROTOACCOUNT **ppAccounts; CProtocolData *pProtoData = nullptr; CIRCConnection *pIRCConnection = nullptr; - Proto_EnumAccounts(&iCount, &ppAccounts); - for (int i = 0; i < iCount; i++) { - /**if(ppProtocolDescriptor[i]->type != PROTOTYPE_PROTOCOL) - continue;**/ - if (ppAccounts[i]->bIsEnabled == 0) + for (auto &pa : Accounts()) { + if (pa->bIsEnabled == 0) continue; iProtoCount++; pProtoData = new CProtocolData(); pProtoData->iStatus = ID_STATUS_OFFLINE; - pProtoData->strProtocol = toTstring(ppAccounts[i]->szModuleName); + pProtoData->strProtocol = toTstring(pa->szModuleName); pProtoData->lTimeStamp = 0; // try to create an irc connection for that protocol (will fail if it is no irc protocol) |