From f5d8bbfb549446c53671250364a60af02b9874e7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Feb 2019 11:03:52 +0300 Subject: CLISTEVENT::szTooltip/pszService to be constant --- src/mir_app/src/clc.h | 2 +- src/mir_app/src/clistevents.cpp | 14 +++++++------- src/mir_app/src/clisttray.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 6c49f1ce8b..62a2b7ab50 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -137,7 +137,7 @@ void InitTray(void); void TrayIconSetToBase(char *szPreferredProto); void TrayIconTaskbarCreated(HWND hwnd); int TrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase); -void TrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto); +void TrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, const char *szPreferredProto); /* clui.c */ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp index 47d9352a31..6bd03a52bb 100644 --- a/src/mir_app/src/clistevents.cpp +++ b/src/mir_app/src/clistevents.cpp @@ -66,7 +66,7 @@ static int CompareEvents(const CListEvent *p1, const CListEvent *p2) OBJLIST g_cliEvents(10, CompareEvents); -static char* GetEventProtocol(int idx) +static const char* GetEventProtocol(int idx) { if (!g_cliEvents.getCount() || idx < 0 && idx >= g_cliEvents.getCount()) return nullptr; @@ -117,7 +117,7 @@ static void ShowEventsInTray() pTrayProtos[nTrayProtoCnt++] = g_clistApi.trayIcon[i].szProto; for (int i = 0; i < g_cliEvents.getCount(); i++) { - char *iEventProto = GetEventProtocol(i); + const char *iEventProto = GetEventProtocol(i); int j; for (j = 0; j < nTrayProtoCnt; j++) @@ -176,7 +176,7 @@ CListEvent* fnAddEvent(CLISTEVENT *cle) g_cliEvents.insert(p); if (g_cliEvents.getCount() == 1) { - char *szProto; + const char *szProto; if (cle->hContact == 0) { if (cle->flags & CLEF_PROTOCOLGLOBAL) szProto = cle->lpszProtocol; @@ -220,11 +220,11 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent) // count same protocoled events int nSameProto = 0; for (auto &it : g_cliEvents) { - char *szEventProto; + const char *szEventProto; if (it->hContact) szEventProto = GetContactProto((it->hContact)); else if (it->flags & CLEF_PROTOCOLGLOBAL) - szEventProto = (char*)it->lpszProtocol; + szEventProto = it->lpszProtocol; else szEventProto = nullptr; if (szEventProto && szProto && !mir_strcmp(szEventProto, szProto)) @@ -298,7 +298,7 @@ MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index) } if (szProto) { for (auto &it : g_cliEvents) { - char *eventProto = nullptr; + const char *eventProto = nullptr; if (it->hContact) eventProto = GetContactProto(it->hContact); if (!eventProto) @@ -314,7 +314,7 @@ MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index) if (pEvent == nullptr) { if (click_in_first_icon) { for (auto &it : g_cliEvents) { - char *eventProto = nullptr; + const char *eventProto = nullptr; if (it->hContact) eventProto = GetContactProto(it->hContact); if (!eventProto) diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index 83b20ac00f..2277ea364f 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -421,7 +421,7 @@ MIR_APP_DLL(int) Clist_TrayIconSetBaseInfo(HICON hIcon, const char *szPreferredP goto LBL_Error; } -void TrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto) +void TrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, const char *szPreferredProto) { HICON hIcon = ImageList_GetIcon(hCListImages, iImage, ILD_NORMAL); TrayIconUpdate(hIcon, szNewTip, szPreferredProto, 0); -- cgit v1.2.3