diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-20 08:26:15 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-20 08:26:15 +0000 |
commit | c92e6fa7468cfbbf0e05e611ba0790307fbd953a (patch) | |
tree | e5443fc6c7381a577f1e53af03e2778a616d5a7e /plugins/Utils | |
parent | c1c83bf5790a1adfeccd1e948e321ac3a7e3e54c (diff) |
andalso another accounts related code fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@1067 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils')
-rw-r--r-- | plugins/Utils/mir_options.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index 8062c1180e..1096f44276 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -241,45 +241,30 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha lvi.iSubItem = 0;
lvi.iItem = 1000;
- PROTOACCOUNT **protos;
int count;
-
- BOOL hasAccounts = ServiceExists(MS_PROTO_ENUMACCOUNTS);
- if (hasAccounts)
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&protos);
- else
- CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&count, (LPARAM)&protos);
+ PROTOACCOUNT **protos;
+ CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&protos);
for (int i = 0; i < count; i++) {
- if (protos[i]->type != PROTOTYPE_PROTOCOL)
+ PROTOACCOUNT *p = protos[i];
+ if (p->type != PROTOTYPE_PROTOCOL)
continue;
- if (protos[i]->szModuleName == NULL || protos[i]->szModuleName[0] == '\0')
+ if (p->szModuleName == NULL || p->szModuleName[0] == '\0')
continue;
- if (ctrl->allowProtocol != NULL && !ctrl->allowProtocol(protos[i]->szModuleName))
+ if (ctrl->allowProtocol != NULL && !ctrl->allowProtocol(p->szModuleName))
continue;
- TCHAR *name;
- if (hasAccounts)
- name = mir_tstrdup(protos[i]->tszAccountName);
- else {
- char szName[128];
- CallProtoService(protos[i]->szModuleName, PS_GETNAME, sizeof(szName), (LPARAM)szName);
- name = mir_a2t(szName);
- }
-
char *setting = (char *) mir_alloc(128 * sizeof(char));
- mir_snprintf(setting, 128, ctrl->setting, protos[i]->szModuleName);
+ mir_snprintf(setting, 128, ctrl->setting, p->szModuleName);
BOOL show = (BOOL)db_get_b(NULL, module, setting, ctrl->dwDefValue);
lvi.lParam = (LPARAM)setting;
- lvi.pszText = TranslateTS(name);
+ lvi.pszText = TranslateTS(p->tszAccountName);
lvi.iItem = ListView_InsertItem(hwndProtocols, &lvi);
ListView_SetItemState(hwndProtocols, lvi.iItem, INDEXTOSTATEIMAGEMASK(show?2:1), LVIS_STATEIMAGEMASK);
-
- mir_free(name);
}
ListView_SetColumnWidth(hwndProtocols, 0, LVSCW_AUTOSIZE);
|