summaryrefslogtreecommitdiff
path: root/src/modules/extraicons/DefaultExtraIcons.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-10 21:36:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-10 21:36:54 +0000
commit9c2e0c8b025c98cbff2975e6dd9c86e03cd04244 (patch)
treebd95b8ef2753ef3f2b3701bfe350eb7682794319 /src/modules/extraicons/DefaultExtraIcons.cpp
parentf22d8982b41614d703b0db98264e01ef7049a4a0 (diff)
code cleaning for ME_DB_CONTACT_SETTINGCHANGED in plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@2283 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/extraicons/DefaultExtraIcons.cpp')
-rw-r--r--src/modules/extraicons/DefaultExtraIcons.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp
index 46262f877d..8115e50b07 100644
--- a/src/modules/extraicons/DefaultExtraIcons.cpp
+++ b/src/modules/extraicons/DefaultExtraIcons.cpp
@@ -215,24 +215,20 @@ static int SettingChanged(WPARAM wParam, LPARAM lParam)
bool isProto = (strcmp(cws->szModule, proto) == 0);
- if (isProto && strcmp(cws->szSetting, "ApparentMode") == 0)
- {
+ if (isProto && strcmp(cws->szSetting, "ApparentMode") == 0) {
SetVisibility(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.wVal, TRUE);
return 0;
}
- if (strcmp(cws->szSetting, "Gender") == 0 && (isProto || strcmp(cws->szModule, "UserInfo") == 0))
- {
+ if (strcmp(cws->szSetting, "Gender") == 0 && (isProto || strcmp(cws->szModule, "UserInfo") == 0)) {
SetGender(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal, TRUE);
return 0;
}
- for (unsigned int i = 0; i < SIZEOF(infos); i++)
- {
+ for (unsigned int i = 0; i < SIZEOF(infos); i++) {
Info &info = infos[i];
- for (unsigned int j = 0; j < SIZEOF(info.db); j += 2)
- {
+ for (unsigned int j = 0; j < SIZEOF(info.db); j += 2) {
if (info.db[j + 1] == NULL)
break;
if (info.db[j] == NULL && !isProto)
@@ -267,16 +263,13 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
return 0;
bool found = false;
- for (unsigned int j = 0; !found && j < SIZEOF(info->db); j += 2)
- {
+ for (unsigned int j = 0; !found && j < SIZEOF(info->db); j += 2) {
if (info->db[j + 1] == NULL)
break;
DBVARIANT dbv = { 0 };
- if (!DBGetContactSettingString(hContact, info->db[j] == NULL ? proto : info->db[j], info->db[j+1], &dbv))
- {
- if (!IsEmpty(dbv.pszVal))
- {
+ if (!DBGetContactSettingString(hContact, info->db[j] == NULL ? proto : info->db[j], info->db[j+1], &dbv)) {
+ if (!IsEmpty(dbv.pszVal)) {
info->OnClick(info, dbv.pszVal);
found = true;
}
@@ -293,8 +286,7 @@ static void DBExtraIconsInit()
hExtraChat = ExtraIcon_Register("chat_activity", "Chat activity", "ChatActivity");
hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", "AlwaysVis");
hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male");
- for (unsigned int i = 0; i < SIZEOF(infos); i++)
- {
+ for (unsigned int i = 0; i < SIZEOF(infos); i++) {
Info &info = infos[i];
if (info.OnClick)
info.hExtraIcon = ExtraIcon_Register(info.name, info.desc, info.icon, DefaultOnClick, (LPARAM) &info);
@@ -303,8 +295,7 @@ static void DBExtraIconsInit()
}
HANDLE hContact = db_find_first();
- while (hContact != NULL)
- {
+ while (hContact != NULL) {
SetExtraIcons(hContact);
SetVisibility(hContact, -1, FALSE);
SetGender(hContact, -1, FALSE);
@@ -335,8 +326,7 @@ static int ProtocolRebuildIcons(WPARAM wParam, LPARAM lParam)
static ProtoInfo *FindProto(const char * proto)
{
- for (unsigned int i = 0; i < protos.size(); i++)
- {
+ for (unsigned int i = 0; i < protos.size(); i++) {
ProtoInfo *pi = &protos[i];
if (strcmp(pi->proto.c_str(), proto) == 0)
return pi;