summaryrefslogtreecommitdiff
path: root/plugins/MirFox/src/MirfoxData.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
commit9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch)
treef8fe94a3efe7598a2af926f264d354f7a08fb943 /plugins/MirFox/src/MirfoxData.cpp
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/MirFox/src/MirfoxData.cpp')
-rw-r--r--plugins/MirFox/src/MirfoxData.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp
index aad3018e48..9a29cf99d7 100644
--- a/plugins/MirFox/src/MirfoxData.cpp
+++ b/plugins/MirFox/src/MirfoxData.cpp
@@ -582,39 +582,27 @@ MirfoxData::initializeMirandaAccounts()
clearMirandaAccounts();
//get accounts from Miranda by CallService MS_PROTO_ENUMACCOUNTS
- int accountsCount = 0;
- PROTOACCOUNT **accounts;
- Proto_EnumAccounts(&accountsCount, &accounts);
-
- for(int i=0; i<accountsCount; i++) {
-
- //checking account
- if(accounts[i]->bIsEnabled == 0){
+ for (auto &pa : Accounts()) {
+ // checking account
+ if (pa->bIsEnabled == 0)
continue;
- }
- if(accounts[i]->bDynDisabled != 0){
+
+ if (pa->bDynDisabled != 0)
continue;
- }
//add to list
- MirandaAccount* mirandaAccountItemPtr = new MirandaAccount(
- mirfoxAccountIdPool,
- accounts[i]->szModuleName,
- accounts[i]->tszAccountName,
- accounts[i]->szProtoName,
- accounts[i]->iOrder
- );
+ MirandaAccount* mirandaAccountItemPtr = new MirandaAccount(mirfoxAccountIdPool, pa->szModuleName, pa->tszAccountName, pa->szProtoName, pa->iOrder);
MFLogger* logger = MFLogger::getInstance();
- logger->log_p(L"initializeMirandaAccounts: tszAccountName: [%s] protocol: [%S]", accounts[i]->tszAccountName, accounts[i]->szProtoName );
+ logger->log_p(L"initializeMirandaAccounts: tszAccountName: [%s] protocol: [%S]", pa->tszAccountName, pa->szProtoName);
mirfoxAccountIdPool++;
- if (accounts[i]->iOrder > maxAccountIOrder) maxAccountIOrder = accounts[i]->iOrder;
+ if (pa->iOrder > maxAccountIOrder)
+ maxAccountIOrder = pa->iOrder;
mirandaAccountItemPtr->accountState = createOrGetAccountStateFromDB(mirandaAccountItemPtr);
addMirandaAccount(mirandaAccountItemPtr);
-
}
//TODO - sort by mirandaAccount.displayOrder