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/TopToolBar/src/InternalButtons.cpp | 6 +++--- plugins/TopToolBar/src/main.cpp | 3 --- plugins/TopToolBar/src/toolbarwnd.cpp | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/TopToolBar/src') diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index 56c3714919..b1e2613b0a 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -38,7 +38,7 @@ INT_PTR TTBInternalMainMenuButt(WPARAM, LPARAM) { POINT pt; GetCursorPos(&pt); - TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); + TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr); return 0; } @@ -46,7 +46,7 @@ INT_PTR TTBInternalStatusMenuButt(WPARAM, LPARAM) { POINT pt; GetCursorPos(&pt); - TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); + TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr); return 0; } @@ -61,7 +61,7 @@ INT_PTR TTBInternalSoundsOnOff(WPARAM, LPARAM) void InitInternalButtons() { - hwndContactTree = pcli->hwndContactTree; + hwndContactTree = g_CLI.hwndContactTree; CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff); CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt); diff --git a/plugins/TopToolBar/src/main.cpp b/plugins/TopToolBar/src/main.cpp index 2715332a7a..e83a59dd08 100644 --- a/plugins/TopToolBar/src/main.cpp +++ b/plugins/TopToolBar/src/main.cpp @@ -2,7 +2,6 @@ #include "stdafx.h" CMPlugin g_plugin; -CLIST_INTERFACE *pcli; IconItem iconList[] = { @@ -42,8 +41,6 @@ CMPlugin::CMPlugin() : extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - g_plugin.registerIcon(TTB_OPTDIR, iconList, TTB_OPTDIR); LoadToolbarModule(); diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index cef033447d..cd5dcf1900 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -240,7 +240,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara void CALLBACK OnEventFire() { - HWND parent = pcli->hwndContactList; + HWND parent = g_CLI.hwndContactList; if (parent == nullptr) // no clist, no buttons return; -- cgit v1.2.3