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/CmdLine/src/CmdLine.cpp | 3 --- plugins/CmdLine/src/mimcmd_handlers.cpp | 14 +++++++------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'plugins/CmdLine/src') diff --git a/plugins/CmdLine/src/CmdLine.cpp b/plugins/CmdLine/src/CmdLine.cpp index 47a34c6052..d42ba87727 100644 --- a/plugins/CmdLine/src/CmdLine.cpp +++ b/plugins/CmdLine/src/CmdLine.cpp @@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" CMPlugin g_plugin; -CLIST_INTERFACE *pcli; ///////////////////////////////////////////////////////////////////////////////////////// @@ -46,8 +45,6 @@ CMPlugin::CMPlugin() : extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - if (InitServer()) MessageBox(nullptr, TranslateT("Could not initialize CmdLine plugin property"), TranslateT("Error"), MB_ICONEXCLAMATION | MB_OK); diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index abbec32e84..f7ed632c9d 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -483,7 +483,7 @@ void HandleClistCommand(PCommand command, TArgument *argv, int argc, PReply repl switch (argc) { case 2: { - int state = IsWindowVisible(pcli->hwndContactList); + int state = IsWindowVisible(g_CLI.hwndContactList); Set2StateReply(reply, state, 0, LPGENW("Contact list is currently shown."), L"", LPGENW("Contact list is currently hidden."), L""); return; @@ -495,18 +495,18 @@ void HandleClistCommand(PCommand command, TArgument *argv, int argc, PReply repl switch (Get2StateValue(argv[2])) { case STATE_ON: - ShowWindow(pcli->hwndContactList, SW_SHOW); + ShowWindow(g_CLI.hwndContactList, SW_SHOW); state = TRUE; break; case STATE_OFF: - ShowWindow(pcli->hwndContactList, SW_HIDE); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); state = FALSE; break; case STATE_TOGGLE: - state = !IsWindowVisible(pcli->hwndContactList); - ShowWindow(pcli->hwndContactList, (state) ? SW_SHOW : SW_HIDE); + state = !IsWindowVisible(g_CLI.hwndContactList); + ShowWindow(g_CLI.hwndContactList, (state) ? SW_SHOW : SW_HIDE); break; default: @@ -531,7 +531,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply CallService("CloseAction", 0, 0); // try another quit method - PostMessage(pcli->hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0); + PostMessage(g_CLI.hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0); reply->code = MIMRES_SUCCESS; mir_snwprintf(reply->message, TranslateT("Issued a quit command.")); @@ -548,7 +548,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply CallService("CloseAction", 0, 0); //try another quit method - PostMessage(pcli->hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0); + PostMessage(g_CLI.hwndContactList, WM_COMMAND, ID_ICQ_EXIT, 0); reply->code = MIMRES_SUCCESS; mir_snwprintf(reply->message, TranslateT("Issued a quit and wait command.")); -- cgit v1.2.3