From 66b61f42871089f3962920924f9030cd6dff2ad8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 3 Apr 2018 13:37:13 +0300 Subject: CLIST_INTERFACE: - unused members removed (requires new History++ for people who compile Miranda themselves); - useless helpers Proto_IsAccountEnabled & Proto_IsProtocolLocked replaced with direct calls of PROTOACCOUNT members IsEnabled & IsLocked respectively; - static interface member pfnGetProtocolVisibility replaced with static function Clist_GetProtocolVisibility or PROTOACCOUNT::IsVisible when possible --- plugins/Clist_modern/src/modern_clcopts.cpp | 12 ++++++------ plugins/Clist_modern/src/modern_clisttray.cpp | 8 ++++---- plugins/Clist_modern/src/modern_clui.cpp | 2 +- plugins/Clist_modern/src/modern_statusbar.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'plugins/Clist_modern') diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 3ec5ff83e4..56b9b2ace6 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -470,14 +470,14 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar static int _GetNetVisibleProtoCount() { - int i, count, netProtoCount; + int count, netProtoCount; PROTOACCOUNT **accs; Proto_EnumAccounts(&count, &accs); - for (i = 0, netProtoCount = 0; i < count; i++) { - if (pcli->pfnGetProtocolVisibility(accs[i]->szModuleName) == 0) - continue; - netProtoCount++; - } + + for (int i = 0, netProtoCount = 0; i < count; i++) + if (accs[i]->IsVisible()) + netProtoCount++; + return netProtoCount; } diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index cc56258329..49d924a24b 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -90,7 +90,7 @@ INT_PTR CListTray_GetGlobalStatus(WPARAM, LPARAM) int connectingCount = 0; for (int i = 0; i < pcli->hClcProtoCount; i++) { ClcProtoStatus &p = pcli->clcProto[i]; - if (!pcli->pfnGetProtocolVisibility(p.szProto)) + if (!Clist_GetProtocolVisibility(p.szProto)) continue; if (IsStatusConnecting(p.dwStatus)) { @@ -285,7 +285,7 @@ static int GetGoodAccNum(bool *bDiffers, bool *bConn = nullptr) int iPrevStatus = 0, res = 0; while (AccNum--) { PROTOACCOUNT *pa = acc[AccNum]; - if (!pcli->pfnGetProtocolVisibility(pa->szModuleName)) + if (!pa->IsVisible()) continue; res++; @@ -379,7 +379,7 @@ int cliTrayIconInit(HWND hwnd) for (int i = AccNum; i--;) { PROTOACCOUNT *pa = acc[i]; - if (pcli->pfnGetProtocolVisibility(pa->szModuleName) && pa->ppro != nullptr) + if (pa->IsVisible() && pa->ppro != nullptr) pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus); } break; @@ -396,7 +396,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) if (!pcli->trayIconCount) return -1; - if (!pcli->pfnGetProtocolVisibility(szChangedProto)) + if (!Clist_GetProtocolVisibility(szChangedProto)) return -1; bool bDiffers, bConn; diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 1ebb35d4e7..7763e5c34a 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -1058,7 +1058,7 @@ void CLUI_DisconnectAll() Proto_EnumAccounts(&nProtoCount, &accs); for (int nProto = 0; nProto < nProtoCount; nProto++) - if (Proto_IsAccountEnabled(accs[nProto])) + if (accs[nProto]->IsEnabled()) CallProtoService(accs[nProto]->szModuleName, PS_SETSTATUS, ID_STATUS_OFFLINE, 0); } diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 678faaa1cd..ccb7808d7b 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -179,10 +179,10 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (i == -1) continue; - char *szProto = accs[i]->szModuleName; - if (!pcli->pfnGetProtocolVisibility(szProto)) + if (!accs[i]->IsVisible()) continue; + char *szProto = accs[i]->szModuleName; char buf[256]; mir_snprintf(buf, "SBarAccountIsCustom_%s", szProto); -- cgit v1.2.3