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_*) --- src/core/stdclist/src/clistmenus.cpp | 2 +- src/core/stdclist/src/clistopts.cpp | 2 +- src/core/stdclist/src/cluiopts.cpp | 66 +++++++++++++++---------------- src/core/stdclist/src/init.cpp | 17 ++++---- src/core/stdfile/src/file.cpp | 6 +-- src/core/stdfile/src/main.cpp | 4 -- src/core/stdidle/src/main.cpp | 3 -- src/core/stdmsg/src/chat_manager.cpp | 4 +- src/core/stdmsg/src/chat_window.cpp | 4 +- src/core/stdmsg/src/msgdialog.cpp | 2 +- src/core/stdmsg/src/msglog.cpp | 2 +- src/core/stdmsg/src/msgs.cpp | 10 ++--- src/core/stdmsg/src/srmm.cpp | 4 -- src/core/stdmsg/src/tabs.cpp | 4 +- src/core/stduseronline/src/main.cpp | 3 -- src/core/stduseronline/src/useronline.cpp | 4 +- 16 files changed, 61 insertions(+), 76 deletions(-) (limited to 'src/core') diff --git a/src/core/stdclist/src/clistmenus.cpp b/src/core/stdclist/src/clistmenus.cpp index afdb4c8da7..9ac72f36e2 100644 --- a/src/core/stdclist/src/clistmenus.cpp +++ b/src/core/stdclist/src/clistmenus.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR CloseAction(WPARAM, LPARAM) { if (Miranda_OkToExit()) - DestroyWindow(pcli->hwndContactList); + DestroyWindow(g_CLI.hwndContactList); return(0); } diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index 623787e931..65e6f790fb 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -178,7 +178,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP Clist_TrayIconIconsChanged(); Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */ - pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */ + g_CLI.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); /* force reshuffle */ return TRUE; } break; diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index f4607ada42..6d1f00ddd3 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -168,11 +168,11 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t title[256]; GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title)); db_set_ws(NULL, "CList", "TitleText", title); - SetWindowText(pcli->hwndContactList, title); + SetWindowText(g_CLI.hwndContactList, title); } - pcli->pfnLoadCluiGlobalOpts(); - SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, + g_CLI.pfnLoadCluiGlobalOpts(); + SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) { @@ -180,50 +180,50 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp WINDOWPLACEMENT p; p.length = sizeof(p); - GetWindowPlacement(pcli->hwndContactList, &p); - ShowWindow(pcli->hwndContactList, SW_HIDE); - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, - GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_APPWINDOW | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE); - SetWindowPlacement(pcli->hwndContactList, &p); + GetWindowPlacement(g_CLI.hwndContactList, &p); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, + GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_APPWINDOW | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE); + SetWindowPlacement(g_CLI.hwndContactList, &p); } else - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW); if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) { HWND hProgMan = FindWindow(L"Progman", nullptr); if (hProgMan) - SetParent(pcli->hwndContactList, hProgMan); + SetParent(g_CLI.hwndContactList, hProgMan); } else - SetParent(pcli->hwndContactList, nullptr); + SetParent(g_CLI.hwndContactList, nullptr); if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) { - int style = GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; - SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, style); + int style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; + SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, style); } else { - SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, - GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, + GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)); } if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU)) - SetMenu(pcli->hwndContactList, nullptr); + SetMenu(g_CLI.hwndContactList, nullptr); else - SetMenu(pcli->hwndContactList, pcli->hMenuMain); + SetMenu(g_CLI.hwndContactList, g_CLI.hMenuMain); - SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE); + SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE); - if (IsIconic(pcli->hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) - ShowWindow(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW); + if (IsIconic(g_CLI.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) + ShowWindow(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW); if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) { - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); - SetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); + SetLayeredWindowAttributes(g_CLI.hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA); } else - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED); - SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged + SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged return TRUE; } @@ -283,22 +283,22 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L db_set_b(NULL, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA)); db_set_b(NULL, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS)); db_set_b(NULL, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL)); - pcli->pfnLoadCluiGlobalOpts(); + g_CLI.pfnLoadCluiGlobalOpts(); if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) { - HWND parent = GetParent(pcli->hwndStatus); + HWND parent = GetParent(g_CLI.hwndStatus); int flags = WS_CHILD | CCS_BOTTOM; db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)); - ShowWindow(pcli->hwndStatus, SW_HIDE); - DestroyWindow(pcli->hwndStatus); + ShowWindow(g_CLI.hwndStatus, SW_HIDE); + DestroyWindow(g_CLI.hwndStatus); flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0; flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0; - pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr); + g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr); } if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) - ShowWindow(pcli->hwndStatus, SW_SHOW); + ShowWindow(g_CLI.hwndStatus, SW_SHOW); else - ShowWindow(pcli->hwndStatus, SW_HIDE); - SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); + ShowWindow(g_CLI.hwndStatus, SW_HIDE); + SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0); return TRUE; } break; diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp index 94d4517491..fc49caac7a 100644 --- a/src/core/stdclist/src/init.cpp +++ b/src/core/stdclist/src/init.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" CMPlugin g_plugin; -CLIST_INTERFACE* pcli = nullptr, coreCli; +CLIST_INTERFACE coreCli; HIMAGELIST himlCListClc = nullptr; ///////////////////////////////////////////////////////////////////////////////////////// @@ -99,7 +99,7 @@ static int OnOptsInit(WPARAM wParam, LPARAM lParam) static INT_PTR GetStatusMode(WPARAM, LPARAM) { - return pcli->currentDesiredStatusMode; + return g_CLI.currentDesiredStatusMode; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -107,16 +107,15 @@ static INT_PTR GetStatusMode(WPARAM, LPARAM) extern "C" __declspec(dllexport) int CListInitialise() { - pcli = Clist_GetInterface(); - g_bSortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT); g_bSortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT); - coreCli = *pcli; - pcli->hInst = g_plugin.getInst(); - pcli->pfnPaintClc = PaintClc; - pcli->pfnLoadClcOptions = LoadClcOptions; - pcli->pfnCompareContacts = CompareContacts; + Clist_GetInterface(); + coreCli = g_CLI; + g_CLI.hInst = g_plugin.getInst(); + g_CLI.pfnPaintClc = PaintClc; + g_CLI.pfnLoadClcOptions = LoadClcOptions; + g_CLI.pfnCompareContacts = CompareContacts; CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode); diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 9ce90ca28a..fa85763130 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -114,7 +114,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) cle.flags |= CLEF_UNICODE; cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE); cle.pszService = "SRFile/RecvFile"; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } } @@ -306,9 +306,9 @@ static int SRFileProtoAck(WPARAM, LPARAM lParam) ACKDATA *ack = (ACKDATA*)lParam; if (ack->type == ACKTYPE_FILE) { int iEvent = 0; - while (CLISTEVENT *cle = pcli->pfnGetEvent(ack->hContact, iEvent++)) + while (CLISTEVENT *cle = g_CLI.pfnGetEvent(ack->hContact, iEvent++)) if (cle->lParam == (LPARAM)ack->hProcess) - pcli->pfnRemoveEvent(ack->hContact, cle->hDbEvent); + g_CLI.pfnRemoveEvent(ack->hContact, cle->hDbEvent); } return 0; } diff --git a/src/core/stdfile/src/main.cpp b/src/core/stdfile/src/main.cpp index 27a00db40a..b4b4146518 100644 --- a/src/core/stdfile/src/main.cpp +++ b/src/core/stdfile/src/main.cpp @@ -25,8 +25,6 @@ int LoadSendRecvFileModule(void); CMPlugin g_plugin; -CLIST_INTERFACE* pcli; - ITaskbarList3 * pTaskbarInterface; ///////////////////////////////////////////////////////////////////////////////////////// @@ -56,8 +54,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRFILE extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - if ( IsWinVer7Plus()) CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface); diff --git a/src/core/stdidle/src/main.cpp b/src/core/stdidle/src/main.cpp index 89268caadf..747808bb8e 100644 --- a/src/core/stdidle/src/main.cpp +++ b/src/core/stdidle/src/main.cpp @@ -25,7 +25,6 @@ int LoadIdleModule(void); void UnloadIdleModule(void); CMPlugin g_plugin; -CLIST_INTERFACE* pcli; ///////////////////////////////////////////////////////////////////////////////////////// @@ -54,8 +53,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_IDLE, extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - LoadIdleModule(); return 0; } diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index 9a3885baa6..26b834617e 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -75,10 +75,10 @@ static void OnCreateModule(MODULEINFO *mi) { OnDestroyModule(mi); - mi->OnlineIconIndex = pcli->pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0); + mi->OnlineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0); mi->hOnlineIcon = ImageList_GetIcon(Clist_GetImageList(), mi->OnlineIconIndex, ILD_TRANSPARENT); - mi->OfflineIconIndex = pcli->pfnIconFromStatusMode(mi->pszModule, ID_STATUS_OFFLINE, 0); + mi->OfflineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_OFFLINE, 0); mi->hOfflineIcon = ImageList_GetIcon(Clist_GetImageList(), mi->OfflineIconIndex, ILD_TRANSPARENT); } diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index f6e101eb5f..66be4aaba6 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -104,8 +104,8 @@ void CChatRoomDlg::OnActivate() FlashWindow(m_pOwner->GetHwnd(), FALSE); if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0) db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); - if (pcli->pfnGetEvent(m_hContact, 0)) - pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(m_hContact, 0)) + g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); } void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton) diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index e65ea3f177..5bfcb1f191 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -455,7 +455,7 @@ void CSrmmWindow::OnSplitterMoved(CSplitter *pSplitter) int CSrmmWindow::GetImageId() const { - return (WORD)pcli->pfnIconFromStatusMode(m_szProto, m_wStatus, m_hContact); + return (WORD)g_CLI.pfnIconFromStatusMode(m_szProto, m_wStatus, m_hContact); } void CSrmmWindow::NotifyTyping(int mode) diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index b06bdb9b64..029d72a8e2 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -215,7 +215,7 @@ static bool CreateRTFFromDbEvent(LogStreamData *dat) if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) { db_event_markRead(dat->hContact, dat->hDbEvent); - pcli->pfnRemoveEvent(dat->hContact, dat->hDbEvent); + g_CLI.pfnRemoveEvent(dat->hContact, dat->hDbEvent); } else if (dbei.eventType == EVENTTYPE_JABBER_CHATSTATES || dbei.eventType == EVENTTYPE_JABBER_PRESENCE) { db_event_markRead(dat->hContact, dat->hDbEvent); diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index c141710293..9f4532041b 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -90,7 +90,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) return 0; - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); /* does a window for the contact exist? */ HWND hwnd = Srmm_FindWindow(hContact); if (hwnd) { @@ -127,7 +127,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = MS_MSG_READMESSAGE; cle.szTooltip.w = toolTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); return 0; } @@ -200,7 +200,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact)); if (g_dat.bShowTypingClist) { - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); CLISTEVENT cle = {}; cle.hContact = hContact; @@ -209,7 +209,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_TYPING); cle.pszService = MS_MSG_READMESSAGE; cle.szTooltip.w = szTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); IcoLib_ReleaseIcon(cle.hIcon); } @@ -304,7 +304,7 @@ static void RestoreUnreadMessageAlerts(void) mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact)); cle.hContact = e->hContact; cle.hDbEvent = e->hEvent; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } } diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp index 2cdff71f91..d5004f291b 100644 --- a/src/core/stdmsg/src/srmm.cpp +++ b/src/core/stdmsg/src/srmm.cpp @@ -26,8 +26,6 @@ void SplitmsgShutdown(void); CMPlugin g_plugin; -CLIST_INTERFACE *pcli; - ///////////////////////////////////////////////////////////////////////////////////////// PLUGININFOEX pluginInfoEx = { @@ -54,8 +52,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRMM, extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - Load_ChatModule(); return LoadSendRecvMessageModule(); } diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index b7cfae1650..8aa3608d1b 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -408,8 +408,8 @@ void CTabbedWindow::TabClicked() if (s->wState & GC_EVENT_HIGHLIGHT) { s->wState &= ~GC_EVENT_HIGHLIGHT; - if (pcli->pfnGetEvent(s->hContact, 0)) - pcli->pfnRemoveEvent(s->hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(s->hContact, 0)) + g_CLI.pfnRemoveEvent(s->hContact, GC_FAKE_EVENT); } FixTabIcons(pDlg); diff --git a/src/core/stduseronline/src/main.cpp b/src/core/stduseronline/src/main.cpp index 248bf8077e..4794c2dc21 100644 --- a/src/core/stduseronline/src/main.cpp +++ b/src/core/stduseronline/src/main.cpp @@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadUserOnlineModule(void); CMPlugin g_plugin; -CLIST_INTERFACE* pcli; ///////////////////////////////////////////////////////////////////////////////////////// @@ -53,8 +52,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_USERON extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - LoadUserOnlineModule(); return 0; } diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 163b705835..8a0980bbae 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -42,7 +42,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) int lastEvent = (int)db_get_dw(hContact, MODULENAME, "LastEvent", 0); if (lastEvent) { - pcli->pfnRemoveEvent(hContact, lastEvent); + g_CLI.pfnRemoveEvent(hContact, lastEvent); db_set_dw(hContact, MODULENAME, "LastEvent", 0); } } @@ -62,7 +62,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false); cle.pszService = "UserOnline/Description"; cle.szTooltip.w = tooltip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); IcoLib_ReleaseIcon(cle.hIcon, 0); db_set_dw(cle.hContact, MODULENAME, "LastEvent", (DWORD)cle.hDbEvent); Skin_PlaySound(MODULENAME); -- cgit v1.2.3