From 176e52e14fd0358a7f26ca8d7b0205244dfde2e7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 23 May 2018 23:29:25 +0300 Subject: no need to initialize pcli variable in each plugin (only in Clist_*) --- plugins/Alarms/src/alarmlist.cpp | 2 +- plugins/Alarms/src/alarms.cpp | 3 --- plugins/Alarms/src/frame.cpp | 14 +++++++------- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'plugins/Alarms/src') diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 485a02d6e8..91085be269 100755 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -684,7 +684,7 @@ void DoAlarm(ALARM *alarm) cle.hIcon = hIconSystray; cle.szTooltip.w = alarm->szTitle; cle.flags = CLEF_ONLYAFEW | CLEF_UNICODE; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } } } diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index 729b1ec001..55cc434915 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -17,7 +17,6 @@ There is no warranty. wchar_t szGamePrefix[] = COMMANDPREFIX; -CLIST_INTERFACE *pcli; CMPlugin g_plugin; HANDLE hTopToolbarButton; @@ -146,8 +145,6 @@ static int MainDeInit(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - // ensure datetime picker is loaded INITCOMMONCONTROLSEX ccx; ccx.dwSize = sizeof(ccx); diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index e756521f6d..686cbdd5c9 100755 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -264,7 +264,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } else if (!IsWindowVisible(hwnd) && count > 0) { // we have reminders - show if not linked to clist or if clist is visible - if ((!options.hide_with_clist && FrameIsFloating()) || IsWindowVisible(pcli->hwndContactList)) { + if ((!options.hide_with_clist && FrameIsFloating()) || IsWindowVisible(g_CLI.hwndContactList)) { CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)frame_id, 0); CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, FU_FMREDRAW | FU_FMPOS); } @@ -275,7 +275,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetReminderFrameVisible(false); else if (!IsWindowVisible(hwnd) && count > 0) // we have reminders - show if not linked to clist or if clist is visible - if (!options.hide_with_clist || IsWindowVisible(pcli->hwndContactList)) + if (!options.hide_with_clist || IsWindowVisible(g_CLI.hwndContactList)) SetReminderFrameVisible(true); } } @@ -320,14 +320,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SendMessage(hwnd, WMU_FILL_LIST, 0, 0); else if (wParam == ID_FRAME_SHOWHIDE_TIMER && options.hide_with_clist) { // link show/hide with clist // hide if we're visible and clist isn't (possible only when floating if frames are present) - if (!IsWindowVisible(pcli->hwndContactList) && IsWindowVisible(hwnd)) { + if (!IsWindowVisible(g_CLI.hwndContactList) && IsWindowVisible(hwnd)) { if (ServiceExists(MS_CLIST_FRAMES_SHFRAME)) CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)frame_id, 0); else SetReminderFrameVisible(false); } // we're not visible but clist is - show depending on hide_with_clist and auto_showhide options - if (!IsWindowVisible(hwnd) && IsWindowVisible(pcli->hwndContactList)) { + if (!IsWindowVisible(hwnd) && IsWindowVisible(g_CLI.hwndContactList)) { // if not auto show/hide, show (reminders or not) if we're not visible and the clist is // otherwise, show only if there are reminders int count = SendMessage(hwnd_list, LB_GETCOUNT, 0, 0); @@ -489,7 +489,7 @@ int CreateFrame() if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { hwnd_plugin = CreateWindow(L"AlarmsFrame", TranslateT("Alarms"), WS_CHILD | WS_CLIPCHILDREN, - 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr); + 0, 0, 10, 10, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr); CLISTFrame Frame = { sizeof(CLISTFrame) }; Frame.tname = TranslateT("Alarms"); @@ -509,7 +509,7 @@ int CreateFrame() hwnd_frame = CreateWindowEx(WS_EX_TOOLWINDOW, L"AlarmsFrameContainer", TranslateT("Alarms"), (WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN) & ~WS_VISIBLE, - 0, 0, 200, 100, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr); + 0, 0, 200, 100, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr); hwnd_plugin = CreateWindow(L"AlarmsFrame", TranslateT("Alarms"), WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE, @@ -535,7 +535,7 @@ int CreateFrame() if (!options.auto_showhide) { if (options.hide_with_clist) { - if (IsWindowVisible(pcli->hwndContactList)) { + if (IsWindowVisible(g_CLI.hwndContactList)) { ShowWindow(hwnd_frame, SW_SHOW); RefreshReminderFrame(); } -- cgit v1.2.3