summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-27 11:03:52 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-27 11:03:52 +0300
commitf5d8bbfb549446c53671250364a60af02b9874e7 (patch)
treeff7afcdde21a111ff9e2df72db404e9b2146e39b /src
parenta3eedb2759dd0c88c9fabee28e2432f71dd2b440 (diff)
CLISTEVENT::szTooltip/pszService to be constant
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clc.h2
-rw-r--r--src/mir_app/src/clistevents.cpp14
-rw-r--r--src/mir_app/src/clisttray.cpp2
3 files changed, 9 insertions, 9 deletions
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<CListEvent> 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);