summaryrefslogtreecommitdiff
path: root/plugins/AvatarHistory/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-25 23:34:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-25 23:34:47 +0000
commitbe489c4e6f4c1ab4b4d7f84e35a73e34e1b0b331 (patch)
tree233968040ec6bff10b0726de4e7a69313bb78266 /plugins/AvatarHistory/src
parentc055d21f01423462fa8d468f7c33bde55e595773 (diff)
- 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
Diffstat (limited to 'plugins/AvatarHistory/src')
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp4
-rw-r--r--plugins/AvatarHistory/src/stdafx.h4
-rw-r--r--plugins/AvatarHistory/src/utils.cpp10
3 files changed, 9 insertions, 9 deletions
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);