From be489c4e6f4c1ab4b4d7f84e35a73e34e1b0b331 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 25 Jun 2015 23:34:47 +0000 Subject: - Menu_EnableItem & Menu_SetChecked - more suitable helpers to set flags; - fix for checks in frame menus; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14389 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AvatarHistory/src/AvatarDlg.cpp | 4 ++-- plugins/AvatarHistory/src/stdafx.h | 4 ++-- plugins/AvatarHistory/src/utils.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'plugins/AvatarHistory') diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index cadd9fcc14..da41894e42 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -25,7 +25,7 @@ void __cdecl AvatarDialogThread(void *param); static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam); int ShowSaveDialog(HWND hwnd, TCHAR* fn,MCONTACT hContact = NULL); -BOOL ProtocolEnabled(const char *proto); +bool ProtocolEnabled(const char *proto); int FillAvatarListFromDB(HWND list, MCONTACT hContact); int FillAvatarListFromFolder(HWND list, MCONTACT hContact); int FillAvatarListFromFiles(HWND list, MCONTACT hContact); @@ -506,7 +506,7 @@ int CleanupAvatarPic(HWND hwnd) int PreBuildContactMenu(WPARAM wParam, LPARAM) { char *proto = GetContactProto(wParam); - Menu_ShowItem(hMenu, ProtocolEnabled(proto)); + Menu_ShowItem(hMenu, 0 != ProtocolEnabled(proto)); return 0; } diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h index 27a584f5a1..4564dd5d73 100644 --- a/plugins/AvatarHistory/src/stdafx.h +++ b/plugins/AvatarHistory/src/stdafx.h @@ -70,8 +70,8 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn); // utils TCHAR* GetCachedAvatar(char *proto, TCHAR *hash); -BOOL ProtocolEnabled(const char *proto); -BOOL ContactEnabled(MCONTACT hContact, char *setting, int def); +bool ProtocolEnabled(const char *proto); +bool ContactEnabled(MCONTACT hContact, char *setting, int def); BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file); void ConvertToFilename(TCHAR *str, size_t size); diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 88b00b3dfb..9344544a1e 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -24,24 +24,24 @@ Avatar History Plugin #include "stdafx.h" -BOOL ProtocolEnabled(const char *proto) +bool ProtocolEnabled(const char *proto) { if (proto == NULL) return FALSE; char setting[256]; mir_snprintf(setting, "%sEnabled", proto); - return (BOOL) db_get_b(NULL, MODULE_NAME, setting, TRUE); + return 0 != db_get_b(NULL, MODULE_NAME, setting, true); } -BOOL ContactEnabled(MCONTACT hContact, char *setting, int def) +bool ContactEnabled(MCONTACT hContact, char *setting, int def) { if (hContact == NULL) - return FALSE; + return false; char *proto = GetContactProto(hContact); if (!ProtocolEnabled(proto)) - return FALSE; + return false; BYTE globpref = db_get_b(NULL, MODULE_NAME, setting, def); BYTE userpref = db_get_b(hContact, MODULE_NAME, setting, BST_INDETERMINATE); -- cgit v1.2.3