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 /src/mir_app | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/proto_accs.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/proto_opts.cpp | 1 | ||||
-rw-r--r-- | src/mir_app/src/protocols.cpp | 6 |
5 files changed, 7 insertions, 4 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index bcfd2f2387..78bd18a0a5 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -534,3 +534,4 @@ Proto_SetUniqueId @549 ?IsVisible@PROTOACCOUNT@@QBE_NXZ @554 NONAME
?SetUniqueId@CMPluginBase@@IAEXPBD@Z @555 NONAME
Clist_GetProtocolVisibility @556
+?Accounts@@YGAAU?$LIST@UPROTOACCOUNT@@@@XZ @557 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index a95dca797e..92676a8a6e 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -534,3 +534,4 @@ Proto_SetUniqueId @549 ?IsVisible@PROTOACCOUNT@@QEBA_NXZ @554 NONAME
?SetUniqueId@CMPluginBase@@IEAAXPEBD@Z @555 NONAME
Clist_GetProtocolVisibility @556
+?Accounts@@YAAEAU?$LIST@UPROTOACCOUNT@@@@XZ @557 NONAME
diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index e23ae1296d..109b9e9421 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -49,7 +49,6 @@ static int EnumDbModules(const char *szModuleName, void*) if (szProtoName) {
if (!Proto_GetAccount(szModuleName)) {
PROTOACCOUNT *pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
- pa->cbSize = sizeof(*pa);
pa->szModuleName = mir_strdup(szModuleName);
pa->szProtoName = szProtoName.detach();
pa->tszAccountName = mir_a2u(szModuleName);
@@ -77,7 +76,6 @@ void LoadDbAccounts(void) PROTOACCOUNT *pa = Proto_GetAccount(szModuleName);
if (pa == nullptr) {
pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
- pa->cbSize = sizeof(*pa);
pa->szModuleName = szModuleName;
accounts.insert(pa);
}
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 7d6553f804..d2f21b548d 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -62,7 +62,6 @@ MIR_APP_DLL(PROTOACCOUNT*) Proto_CreateAccount(const char *pszInternal, const ch return nullptr;
PROTOACCOUNT *pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
- pa->cbSize = sizeof(PROTOACCOUNT);
pa->bIsEnabled = pa->bIsVisible = true;
pa->iOrder = accounts.getCount();
pa->szProtoName = mir_strdup(pszBaseProto);
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 9699129981..53b00388da 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -124,7 +124,6 @@ MIR_APP_DLL(int) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd) PROTOACCOUNT *pa = Proto_GetAccount(pd->szName);
if (pa == nullptr) {
pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
- pa->cbSize = sizeof(PROTOACCOUNT);
pa->szModuleName = mir_strdup(pd->szName);
pa->szProtoName = mir_strdup(pd->szName);
pa->tszAccountName = mir_a2u(pd->szName);
@@ -324,6 +323,11 @@ MIR_APP_DLL(void) Proto_EnumAccounts(int *nAccs, PROTOACCOUNT ***pAccs) if (pAccs) *pAccs = accounts.getArray();
}
+MIR_APP_DLL(LIST<PROTOACCOUNT>&) Accounts(void)
+{
+ return accounts;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
bool PROTOACCOUNT::IsEnabled() const
|