summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirandaG15')
-rw-r--r--plugins/MirandaG15/src/CAppletManager.cpp11
-rw-r--r--plugins/MirandaG15/src/CConfig.cpp11
2 files changed, 6 insertions, 16 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)
diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp
index 351755a572..0d56bdf3a6 100644
--- a/plugins/MirandaG15/src/CConfig.cpp
+++ b/plugins/MirandaG15/src/CConfig.cpp
@@ -110,22 +110,17 @@ void CConfig::LoadSettings()
LoadFontSettings(i);
// Load protocol specific settings
- int iCount;
int iProtoCount = 0;
- PROTOACCOUNT **ppAccounts;
CProtoFilter *pProtoFilter;
tstring strSetting;
- 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++;
pProtoFilter = new CProtoFilter();
- pProtoFilter->strName = toTstring(ppAccounts[i]->szModuleName);
+ pProtoFilter->strName = toTstring(pa->szModuleName);
strSetting = L"ProtoFilter_" + pProtoFilter->strName;
pProtoFilter->bNotificationFilter = db_get_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), 1) != 0;