summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-03 13:37:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-03 13:37:13 +0300
commit66b61f42871089f3962920924f9030cd6dff2ad8 (patch)
treebfa19d1db1c84a841dd1e6ea258ae1d9212d2ada /plugins/Clist_modern/src
parentdfe4c13573386072b6fcf177e8f52fafc81891f1 (diff)
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
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp4
4 files changed, 13 insertions, 13 deletions
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);