diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-16 15:33:26 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-16 15:33:26 +0300 |
commit | f0157cebda12743f081e1e43e1c986dde60e2cd0 (patch) | |
tree | 46bfc8ca823bda55ef336da8137be68e0478cfa5 /plugins | |
parent | 8807bf4fa9fb99604c32d2da2dfcd284958a50c5 (diff) |
minor code cleaning
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TabSRMM/src/chat.h | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_tools.cpp | 18 | ||||
-rw-r--r-- | plugins/TabSRMM/src/hotkeyhandler.cpp | 10 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 3 |
4 files changed, 16 insertions, 19 deletions
diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h index ab05c48688..8e64d6c09b 100644 --- a/plugins/TabSRMM/src/chat.h +++ b/plugins/TabSRMM/src/chat.h @@ -80,13 +80,13 @@ struct TMUCSettings : public GlobalLogSettingsBase CMUCHighlight *Highlight;
};
-struct FLASH_PARAMS
+struct FLASH_PARAMS : public MZeroedObject
{
MCONTACT hContact;
const char* sound;
int iEvent;
HICON hNotifyIcon;
- bool bActiveTab, bHighlight, bInactive, bMustFlash, bMustAutoswitch;
+ bool bActiveTab, bInactive, bMustFlash, bMustAutoswitch;
HWND hWnd;
};
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index 8a34696804..dd284321d7 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -283,7 +283,7 @@ void DoFlashAndSoundWorker(FLASH_PARAMS *p) UpdateTrayMenu(dat, si->wStatus, si->pszModule, dat->m_wszStatus, si->hContact, 1);
}
- mir_free(p);
+ delete p;
}
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix)
@@ -292,15 +292,15 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight return FALSE;
CMsgDialog *dat = nullptr;
- FLASH_PARAMS *params = (FLASH_PARAMS*)mir_calloc(sizeof(FLASH_PARAMS));
+ auto *params = new FLASH_PARAMS();
params->hContact = si->hContact;
- params->bInactive = TRUE;
+ params->bInactive = true;
if (si->pDlg) {
dat = si->pDlg;
if ((si->pDlg->GetHwnd() == si->pDlg->m_pContainer->m_hwndActive) && GetForegroundWindow() == si->pDlg->m_pContainer->m_hwnd)
- params->bInactive = FALSE;
+ params->bInactive = false;
}
- params->bActiveTab = params->bMustFlash = params->bMustAutoswitch = FALSE;
+ params->bActiveTab = params->bMustFlash = params->bMustAutoswitch = false;
params->iEvent = gce->iType;
WPARAM wParamForHighLight = 0;
@@ -326,8 +326,8 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight if (dat || !nen_options.iMUCDisable)
DoPopup(si, gce);
if (g_Settings.bFlashWindowHighlight && params->bInactive)
- params->bMustFlash = TRUE;
- params->bMustAutoswitch = TRUE;
+ params->bMustFlash = true;
+ params->bMustAutoswitch = true;
params->hNotifyIcon = g_chatApi.hIcons[ICON_HIGHLIGHT];
}
else {
@@ -436,9 +436,9 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight }
if (params->iEvent == GC_EVENT_MESSAGE) {
- params->bMustAutoswitch = TRUE;
+ params->bMustAutoswitch = true;
if (g_Settings.bFlashWindow)
- params->bMustFlash = TRUE;
+ params->bMustFlash = true;
params->hNotifyIcon = g_chatApi.hIcons[ICON_MESSAGE];
}
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 9e9ee3f502..f33bc99ac3 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -462,15 +462,13 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP FLASH_PARAMS *p = reinterpret_cast<FLASH_PARAMS*>(lParam);
if (1 == wParam) {
Clist_ContactDoubleClicked(p->hContact);
- p->bActiveTab = TRUE;
- p->bInactive = FALSE;
- p->bMustAutoswitch = p->bMustFlash = FALSE;
+ p->bActiveTab = true;
+ p->bInactive = p->bMustAutoswitch = p->bMustFlash = false;
}
if (2 == wParam) {
- p->bActiveTab = TRUE;
- p->bInactive = FALSE;
- p->bMustAutoswitch = p->bMustFlash = FALSE;
+ p->bActiveTab = true;
+ p->bInactive = p->bMustAutoswitch = p->bMustFlash = false;
SendMessage(p->hWnd, DM_ACTIVATEME, 0, 0);
}
DoFlashAndSoundWorker(p);
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index e74ea6b5ba..18b902763b 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -49,8 +49,7 @@ void CMsgDialog::AddLog() DM_AddDivider(); } else { - bool bInactive = !IsActive(); - if (bInactive) + if (!IsActive()) DM_AddDivider(); else if (m_pContainer->m_hwndActive != m_hwnd) DM_AddDivider(); |