summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/clistopts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_nicer/src/clistopts.cpp')
-rw-r--r--plugins/Clist_nicer/src/clistopts.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp
index d713c58080..44fab1e82e 100644
--- a/plugins/Clist_nicer/src/clistopts.cpp
+++ b/plugins/Clist_nicer/src/clistopts.cpp
@@ -89,16 +89,13 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
int item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Global"));
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM)0);
- int count;
- PROTOACCOUNT **accs;
- Proto_EnumAccounts(&count, &accs);
- for (int i = 0; i < count; i++) {
- if (!accs[i]->IsEnabled() || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ for (auto &pa : Accounts()) {
+ if (!pa->IsEnabled() || CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
- item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
- SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM)accs[i]);
- if (!mir_strcmp(szPrimaryStatus, accs[i]->szModuleName))
+ item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)pa->tszAccountName);
+ SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM)pa);
+ if (!mir_strcmp(szPrimaryStatus, pa->szModuleName))
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, item, 0);
}
}