summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-05-23 14:46:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-05-23 14:46:56 +0000
commit286f6d8ed325ca5f726e6ba5fad86fb834d51c16 (patch)
tree748642f7c8d719842070cfdcbb124438b86d6eed /plugins/Clist_modern
parent439c6760bf51d44e22b7147d54e1f38ce8e1dbab (diff)
fix for wrongly named variables
git-svn-id: http://svn.miranda-ng.org/main/trunk@16865 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp60
-rw-r--r--plugins/Clist_modern/src/modern_clc.h9
-rw-r--r--plugins/Clist_modern/src/modern_clcidents.cpp22
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp56
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp30
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp28
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp12
9 files changed, 116 insertions, 113 deletions
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index 58d61c52bd..99d5a93fcc 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -607,8 +607,8 @@ static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFun
if (!func(group->cl.items[scanIndex], FALSE, param))
return FALSE;
- if (group->cl.items[scanIndex]->SubAllocated > 0) {
- for (int i = 0; i < group->cl.items[scanIndex]->SubAllocated; i++)
+ if (group->cl.items[scanIndex]->iSubAllocated > 0) {
+ for (int i = 0; i < group->cl.items[scanIndex]->iSubAllocated; i++)
if (!func(&group->cl.items[scanIndex]->subcontacts[i], TRUE, param))
return FALSE;
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index a4e0a90b84..249f1eb8b8 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -509,21 +509,21 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
return 0;
}
- if (contact->type == CLCIT_CONTACT && (contact->isSubcontact || contact->SubAllocated > 0)) {
- if (contact->isSubcontact && changeGroupExpand == 1) {
- dat->selection -= contact->isSubcontact;
+ if (contact->type == CLCIT_CONTACT && (contact->nSubContacts || contact->iSubAllocated > 0)) {
+ if (contact->nSubContacts && changeGroupExpand == 1) {
+ dat->selection -= contact->nSubContacts;
selMoved = 1;
}
- else if (!contact->isSubcontact && contact->SubAllocated > 0) {
- if (changeGroupExpand == 1 && !contact->SubExpanded) {
+ else if (!contact->nSubContacts && contact->iSubAllocated > 0) {
+ if (changeGroupExpand == 1 && !contact->bSubExpanded) {
dat->selection = cliGetRowsPriorTo(&dat->list, group, -1);
selMoved = 1;
}
- else if (changeGroupExpand == 1 && contact->SubExpanded) {
+ else if (changeGroupExpand == 1 && contact->bSubExpanded) {
//Contract
ClcContact *ht = NULL;
KillTimer(hwnd, TIMERID_SUBEXPAND);
- contact->SubExpanded = 0;
+ contact->bSubExpanded = false;
db_set_b(contact->hContact, "CList", "Expanded", 0);
ht = contact;
dat->bNeedsResort = true;
@@ -531,14 +531,14 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
cliRecalcScrollBar(hwnd, dat);
hitcontact = NULL;
}
- else if (changeGroupExpand == 2 && contact->SubExpanded) {
+ else if (changeGroupExpand == 2 && contact->bSubExpanded) {
dat->selection++;
selMoved = 1;
}
- else if (changeGroupExpand == 2 && !contact->SubExpanded && dat->expandMeta) {
+ else if (changeGroupExpand == 2 && !contact->bSubExpanded && dat->expandMeta) {
ClcContact *ht = NULL;
KillTimer(hwnd, TIMERID_SUBEXPAND);
- contact->SubExpanded = 1;
+ contact->bSubExpanded = true;
db_set_b(contact->hContact, "CList", "Expanded", 1);
ht = contact;
dat->bNeedsResort = true;
@@ -549,7 +549,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
ClcGroup *group2;
if (FindItem(hwnd, dat, contact->hContact, &contact2, &group2, NULL, false)) {
int i = cliGetRowsPriorTo(&dat->list, group2, GetContactIndex(group2, contact2));
- pcli->pfnEnsureVisible(hwnd, dat, i + contact->SubAllocated, 0);
+ pcli->pfnEnsureVisible(hwnd, dat, i + contact->iSubAllocated, 0);
}
}
hitcontact = NULL;
@@ -630,10 +630,10 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR
{
ClcContact *ht = NULL;
if (hitcontact && dat->expandMeta) {
- if (hitcontact->SubExpanded) hitcontact->SubExpanded = 0; else hitcontact->SubExpanded = 1;
- db_set_b(hitcontact->hContact, "CList", "Expanded", hitcontact->SubExpanded);
- if (hitcontact->SubExpanded)
- ht = &(hitcontact->subcontacts[hitcontact->SubAllocated - 1]);
+ hitcontact->bSubExpanded = !hitcontact->bSubExpanded;
+ db_set_b(hitcontact->hContact, "CList", "Expanded", hitcontact->bSubExpanded);
+ if (hitcontact->bSubExpanded)
+ ht = &(hitcontact->subcontacts[hitcontact->iSubAllocated - 1]);
}
dat->bNeedsResort = true;
@@ -645,7 +645,7 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR
ClcGroup *group;
if (FindItem(hwnd, dat, hitcontact->hContact, &contact, &group, NULL, false)) {
i = cliGetRowsPriorTo(&dat->list, group, GetContactIndex(group, contact));
- pcli->pfnEnsureVisible(hwnd, dat, i + hitcontact->SubAllocated, 0);
+ pcli->pfnEnsureVisible(hwnd, dat, i + hitcontact->iSubAllocated, 0);
}
}
hitcontact = NULL;
@@ -745,7 +745,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lP
}
}
- if (hit != -1 && !(hitFlags & CLCHT_NOWHERE) && contact->type == CLCIT_CONTACT && contact->SubAllocated && !contact->isSubcontact)
+ if (hit != -1 && !(hitFlags & CLCHT_NOWHERE) && contact->type == CLCIT_CONTACT && contact->iSubAllocated && !contact->nSubContacts)
if (hitFlags & CLCHT_ONITEMICON && dat->expandMeta) {
hitcontact = contact;
HitPoint.x = (short)LOWORD(lParam);
@@ -972,7 +972,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
if (contSour->isChat())
break;
if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) {
- if (!contSour->isSubcontact)
+ if (!contSour->nSubContacts)
hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA));
@@ -985,7 +985,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
if (contSour->isChat() || contDest->isChat())
break;
if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) {
- if (!contSour->isSubcontact)
+ if (!contSour->nSubContacts)
hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else if (contSour->subcontacts == contDest)
hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault
@@ -1000,7 +1000,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
if (contSour->isChat() || contDest->isChat())
break;
if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) {
- if (!contSour->isSubcontact)
+ if (!contSour->nSubContacts)
hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else if (contDest->subcontacts == contSour->subcontacts)
break;
@@ -1048,7 +1048,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
cliGetRowByIndex(dat, dat->iDragItem, NULL, &group);
if (group && group->parent) {
cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
- if (!contSour->isSubcontact)
+ if (!contSour->nSubContacts)
hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER));
}
break;
@@ -1104,7 +1104,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
if (contSour->type == CLCIT_CONTACT) {
MCONTACT hcontact = contSour->hContact;
if (mir_strcmp(contSour->proto, META_PROTO)) {
- if (!contSour->isSubcontact) {
+ if (!contSour->nSubContacts) {
MCONTACT hDest = contDest->hContact;
mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText);
int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact"), MB_OKCANCEL | MB_ICONQUESTION);
@@ -1142,7 +1142,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
if (contSour->type == CLCIT_CONTACT) {
if (!mir_strcmp(contSour->proto, META_PROTO))
break;
- if (!contSour->isSubcontact) {
+ if (!contSour->nSubContacts) {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->hContact;
mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText);
@@ -1184,7 +1184,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
if (contSour->type == CLCIT_CONTACT) {
if (!mir_strcmp(contSour->proto, META_PROTO))
break;
- if (!contSour->isSubcontact) {
+ if (!contSour->nSubContacts) {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->subcontacts->hContact;
mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->subcontacts->szText);
@@ -1351,7 +1351,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
char *szProto = GetContactProto(wParam);
WORD status = (szProto == NULL) ? ID_STATUS_OFFLINE : GetContactCachedStatus(wParam);
- BOOL image_is_special = (LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons
+ bool bImageIsSpecial = (LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons
int nHiddenStatus = CLVM_GetContactHiddenStatus(wParam, szProto, dat);
@@ -1376,7 +1376,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = lParam;
- contact->image_is_special = image_is_special;
+ contact->bImageIsSpecial = bImageIsSpecial;
pcli->pfnNotifyNewContact(hwnd, wParam);
dat->bNeedsResort = true;
}
@@ -1403,8 +1403,8 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
contact->flags |= CONTACTF_ONLINE;
else
contact->flags &= ~CONTACTF_ONLINE;
- contact->image_is_special = image_is_special;
- if (!image_is_special) { //Only if it is status changing
+ contact->bImageIsSpecial = bImageIsSpecial;
+ if (!bImageIsSpecial) { //Only if it is status changing
dat->bNeedsResort = true;
needRepaint = true;
}
@@ -1542,9 +1542,9 @@ static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM
SendMessage(hwnd, INTM_ICONCHANGED, wParam, corecli.pfnGetContactIcon(wParam));
if (contact->type == CLCIT_CONTACT) {
- if (!contact->image_is_special && pdnce->getStatus() > ID_STATUS_OFFLINE)
+ if (!contact->bImageIsSpecial && pdnce->getStatus() > ID_STATUS_OFFLINE)
contact->iImage = corecli.pfnGetContactIcon(wParam);
- if (contact->isSubcontact && contact->subcontacts && contact->subcontacts->type == CLCIT_CONTACT)
+ if (contact->nSubContacts && contact->subcontacts && contact->subcontacts->type == CLCIT_CONTACT)
pcli->pfnClcBroadcast(INTM_STATUSCHANGED, contact->subcontacts->hContact, 0); //forward status changing to host meta contact
}
}
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h
index ab542e615b..5e457b7b94 100644
--- a/plugins/Clist_modern/src/modern_clc.h
+++ b/plugins/Clist_modern/src/modern_clc.h
@@ -181,11 +181,10 @@ struct tContactItems
struct ClcContact : public ClcContactBase
{
ClcContact *subcontacts;
- BYTE SubAllocated;
- BYTE SubExpanded;
- BYTE isSubcontact;
- // int status;
- BOOL image_is_special;
+ int iSubAllocated, nSubContacts;
+
+ bool bSubExpanded, bImageIsSpecial;
+
int avatar_pos;
avatarCacheEntry *avatar_data;
SIZE avatar_size;
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp
index 2f10f3306f..8afc03b8b6 100644
--- a/plugins/Clist_modern/src/modern_clcidents.cpp
+++ b/plugins/Clist_modern/src/modern_clcidents.cpp
@@ -37,7 +37,7 @@ int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex)
{
int count = 0;
int subcontactscount = 0;
- BYTE k = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
+ bool bMetaExpanding = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT) != 0;
group->scanIndex = 0;
for (;;) {
if (group->scanIndex == group->cl.count) {
@@ -61,16 +61,16 @@ int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex)
continue;
}
}
+ int iRows = (bMetaExpanding && c->bSubExpanded) ? c->iSubAllocated : 0;
if (group == subgroup) {
- if (c->type == CLCIT_CONTACT && c->SubAllocated) {
- int rows = (c->SubAllocated*c->SubExpanded*k);
- if (group->scanIndex + rows >= contactIndex)
+ if (c->type == CLCIT_CONTACT && c->iSubAllocated) {
+ if (group->scanIndex + iRows >= contactIndex)
return count + (contactIndex - group->scanIndex) - 1;
}
}
if (c->type == CLCIT_CONTACT) {
- count += (c->SubAllocated * c->SubExpanded * k);
- subcontactscount += (c->SubAllocated * c->SubExpanded * k);
+ count += iRows;
+ subcontactscount += iRows;
}
group->scanIndex++;
}
@@ -134,8 +134,8 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro
return 1;
}
- if (!isIgnoreSubcontacts && IsHContactContact(dwItem) && c->type == CLCIT_CONTACT && c->SubAllocated > 0) {
- for (int i = 0; i < c->SubAllocated; i++) {
+ if (!isIgnoreSubcontacts && IsHContactContact(dwItem) && c->type == CLCIT_CONTACT && c->iSubAllocated > 0) {
+ for (int i = 0; i < c->iSubAllocated; i++) {
if (c->subcontacts[i].hContact == dwItem) {
if (contact) *contact = &c->subcontacts[i];
if (subgroup) *subgroup = group;
@@ -183,9 +183,9 @@ int cliGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup
}
if (c->type == CLCIT_CONTACT)
- if (c->SubAllocated)
- if (c->SubExpanded && dat->expandMeta) {
- for (i = 0; i < c->SubAllocated; i++) {
+ if (c->iSubAllocated)
+ if (c->bSubExpanded && dat->expandMeta) {
+ for (i = 0; i < c->iSubAllocated; i++) {
index++;
if (testindex == index) {
if (contact) {
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index f44ba8d2a0..d8a14a5753 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -26,19 +26,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
{
- cont->SubExpanded = (db_get_b(cont->hContact, "CList", "Expanded", 0) && (db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT)));
+ cont->bSubExpanded = db_get_b(cont->hContact, "CList", "Expanded", 0) && db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
int subcount = db_mc_getSubCount(cont->hContact);
if (subcount <= 0) {
- cont->isSubcontact = 0;
+ cont->nSubContacts = 0;
cont->subcontacts = NULL;
- cont->SubAllocated = 0;
+ cont->iSubAllocated = 0;
return;
}
- cont->isSubcontact = 0;
+ cont->nSubContacts = 0;
mir_free(cont->subcontacts);
cont->subcontacts = (ClcContact *)mir_calloc(sizeof(ClcContact)*subcount);
- cont->SubAllocated = subcount;
+ cont->iSubAllocated = subcount;
int i = 0;
int bHideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
for (int j = 0; j < subcount; j++) {
@@ -61,10 +61,10 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
p.proto = cacheEntry->m_pszProto;
p.type = CLCIT_CONTACT;
p.flags = 0;//CONTACTF_ONLINE;
- p.isSubcontact = i + 1;
+ p.nSubContacts = i + 1;
p.lastPaintCounter = 0;
p.subcontacts = cont;
- p.image_is_special = FALSE;
+ p.bImageIsSpecial = false;
//p.status = cacheEntry->status;
Cache_GetTimezone(dat, (&p)->hContact);
Cache_GetText(dat, &p);
@@ -82,16 +82,16 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
i++;
}
- cont->SubAllocated = i;
+ cont->iSubAllocated = i;
if (!i && cont->subcontacts != NULL)
mir_free_and_nil(cont->subcontacts);
}
void cli_FreeContact(ClcContact *p)
{
- if (p->SubAllocated) {
- if (p->subcontacts && !p->isSubcontact) {
- for (int i = 0; i < p->SubAllocated; i++) {
+ if (p->iSubAllocated) {
+ if (p->subcontacts && !p->nSubContacts) {
+ for (int i = 0; i < p->iSubAllocated; i++) {
p->subcontacts[i].ssText.DestroySmileyList();
if (p->subcontacts[i].avatar_pos == AVATAR_POS_ANIMATED)
AniAva_RemoveAvatar(p->subcontacts[i].hContact);
@@ -99,7 +99,7 @@ void cli_FreeContact(ClcContact *p)
}
mir_free_and_nil(p->subcontacts);
}
- p->SubAllocated = 0;
+ p->iSubAllocated = 0;
}
p->ssText.DestroySmileyList();
@@ -119,12 +119,12 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat,
cont->type = CLCIT_CONTACT;
cont->pce = cacheEntry;
- cont->SubAllocated = 0;
- cont->isSubcontact = 0;
+ cont->iSubAllocated = 0;
+ cont->nSubContacts = 0;
cont->subcontacts = NULL;
cont->szText[0] = 0;
cont->lastPaintCounter = 0;
- cont->image_is_special = FALSE;
+ cont->bImageIsSpecial = false;
cont->hContact = hContact;
cont->proto = szProto;
@@ -153,7 +153,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat,
// Add subcontacts
if (szProto)
- if (dat->IsMetaContactsEnabled && mir_strcmp(cont->proto, META_PROTO) == 0)
+ if (dat->IsMetaContactsEnabled && !mir_strcmp(cont->proto, META_PROTO))
AddSubcontacts(dat, cont, CLCItems_IsShowOfflineGroup(group));
cont->lastPaintCounter = 0;
@@ -227,13 +227,13 @@ int RestoreSelection(ClcData *dat, MCONTACT hSelected)
return dat->selection;
}
- if (!selcontact->isSubcontact)
+ if (!selcontact->nSubContacts)
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact));
else {
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact->subcontacts));
if (dat->selection != -1)
- dat->selection += selcontact->isSubcontact;
+ dat->selection += selcontact->nSubContacts;
}
return dat->selection;
}
@@ -298,7 +298,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat)
}
}
if (cont) {
- cont->SubAllocated = 0;
+ cont->iSubAllocated = 0;
if (cont->proto && dat->IsMetaContactsEnabled && mir_strcmp(cont->proto, META_PROTO) == 0)
AddSubcontacts(dat, cont, CLCItems_IsShowOfflineGroup(group));
}
@@ -422,7 +422,7 @@ void cli_SetContactCheckboxes(ClcContact *cc, int checked)
{
corecli.pfnSetContactCheckboxes(cc, checked);
- for (int i = 0; i < cc->SubAllocated; i++)
+ for (int i = 0; i < cc->iSubAllocated; i++)
corecli.pfnSetContactCheckboxes(&cc->subcontacts[i], checked);
}
@@ -437,17 +437,21 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly)
if (group == topgroup)
break;
group = group->parent;
+ group->scanIndex++;
+ continue;
}
- else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (!(visibleOnly & 0x01) || group->cl.items[group->scanIndex]->group->expanded)) {
- group = group->cl.items[group->scanIndex]->group;
+
+ ClcContact *cc = group->cl.items[group->scanIndex];
+ if (cc->type == CLCIT_GROUP && (!(visibleOnly & 0x01) || cc->group->expanded)) {
+ group = cc->group;
group->scanIndex = 0;
count += group->cl.count;
continue;
}
- else if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) &&
- (group->cl.items[group->scanIndex]->subcontacts != NULL) &&
- ((group->cl.items[group->scanIndex]->SubExpanded || (!visibleOnly)))) {
- count += group->cl.items[group->scanIndex]->SubAllocated;
+ else if ((cc->type == CLCIT_CONTACT) &&
+ (cc->subcontacts != NULL) &&
+ ((cc->bSubExpanded || (!visibleOnly)))) {
+ count += group->cl.items[group->scanIndex]->iSubAllocated;
}
group->scanIndex++;
}
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp
index 2b889619b8..0edbb82ae8 100644
--- a/plugins/Clist_modern/src/modern_clcmsgs.cpp
+++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp
@@ -184,22 +184,22 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP
for (tgroup = group; tgroup; tgroup = tgroup->parent)
pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- if (!contact->isSubcontact) {
+ if (!contact->nSubContacts) {
index = List_IndexOf((SortedList*)&group->cl, contact);
mainindex = index;
}
else {
index = List_IndexOf((SortedList*)&group->cl, contact->subcontacts);
mainindex = index;
- index += contact->isSubcontact;
+ index += contact->nSubContacts;
}
BYTE k = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
if (k) {
for (int i = 0; i < mainindex; i++) {
ClcContact *tempCont = group->cl.items[i];
- if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
- index += tempCont->SubAllocated;
+ if (tempCont->type == CLCIT_CONTACT && tempCont->iSubAllocated && tempCont->bSubExpanded)
+ index += tempCont->iSubAllocated;
}
}
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index cd8b03178b..8c759b9af4 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -554,21 +554,21 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac
case CLCIT_CONTACT:
{
ClcContact *mCont = Drawing;
- if (Drawing->isSubcontact) {
+ if (Drawing->nSubContacts) {
_AddParamShort(mpModernMask, hi_Type, hi_SubContact);
- if (Drawing->isSubcontact == 1 && Drawing->subcontacts->SubAllocated == 1)
+ if (Drawing->nSubContacts == 1 && Drawing->subcontacts->iSubAllocated == 1)
_AddParamShort(mpModernMask, hi_SubPos, hi_First_Single);
- else if (Drawing->isSubcontact == 1)
+ else if (Drawing->nSubContacts == 1)
_AddParamShort(mpModernMask, hi_SubPos, hi_First);
- else if (Drawing->isSubcontact == Drawing->subcontacts->SubAllocated)
+ else if (Drawing->nSubContacts == Drawing->subcontacts->iSubAllocated)
_AddParamShort(mpModernMask, hi_SubPos, hi_Last);
else
_AddParamShort(mpModernMask, hi_SubPos, hi_Middle);
mCont = Drawing->subcontacts;
}
- else if (Drawing->SubAllocated) {
+ else if (Drawing->iSubAllocated) {
_AddParamShort(mpModernMask, hi_Type, hi_MetaContact);
- _AddParamShort(mpModernMask, hi_Open, (Drawing->SubExpanded) ? hi_True : hi_False);
+ _AddParamShort(mpModernMask, hi_Open, (Drawing->bSubExpanded) ? hi_True : hi_False);
}
else _AddParamShort(mpModernMask, hi_Type, hi_Contact);
@@ -1146,7 +1146,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
case TC_STATUS:
if ((Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon) || (Drawing->type == CLCIT_CONTACT && Drawing->iImage != -1
- && !(dat->icon_hide_on_avatar && dat->avatars_show && Drawing->avatar_data != NULL && !Drawing->image_is_special))) {
+ && !(dat->icon_hide_on_avatar && dat->avatars_show && Drawing->avatar_data != NULL && !Drawing->bImageIsSpecial))) {
int iImage = -1;
// Get image
if (Drawing->type == CLCIT_GROUP) {
@@ -1323,7 +1323,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
case TC_EXTRA:
if (Drawing->type == CLCIT_CONTACT &&
- (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0)) {
+ (!Drawing->nSubContacts || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0)) {
int BlendedInActiveState = dat->dbbBlendInActiveState;
int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
int count = 0;
@@ -1375,7 +1375,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
case TC_EXTRA7:
case TC_EXTRA8:
case TC_EXTRA9:
- if (Drawing->type == CLCIT_CONTACT && (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0)) {
+ if (Drawing->type == CLCIT_CONTACT && (!Drawing->nSubContacts || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0)) {
int eNum = gl_RowTabAccess[i]->type - TC_EXTRA1;
if (eNum < dat->extraColumnsCount) {
if (Drawing->iExtraImage[eNum] != EMPTY_EXTRA_ICON) {
@@ -1426,7 +1426,7 @@ void CLCPaint::_DrawStatusIcon(ClcContact *Drawing, ClcData *dat, int iImage, HD
if (Drawing->type != CLCIT_CONTACT) {
ske_ImageList_DrawEx(g_himlCListClc, LOWORD(iImage), hdcMem, x, y, cx, cy, colorbg, colorfg, mode);
}
- else if (Drawing->image_is_special) {
+ else if (Drawing->bImageIsSpecial) {
ske_ImageList_DrawEx(g_himlCListClc, LOWORD(iImage), hdcMem, x, y, cx, cy, colorbg, colorfg, mode);
}
else if (iImage != -1 && HIWORD(iImage) && dat->drawOverlayedStatus) {
@@ -1821,8 +1821,8 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint,
// increment by subcontacts
if ((group->cl.items && group->scanIndex < group->cl.count && group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP)
- && (group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta)) {
- if (subindex < group->cl.items[group->scanIndex]->SubAllocated - 1)
+ && (group->cl.items[group->scanIndex]->bSubExpanded && dat->expandMeta)) {
+ if (subindex < group->cl.items[group->scanIndex]->iSubAllocated - 1)
subindex++;
else
subindex = -1;
@@ -2084,7 +2084,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
&& dat->icon_hide_on_avatar
&& !dat->icon_draw_on_avatar_space
&& has_avatar
- && !Drawing->image_is_special) {
+ && !Drawing->bImageIsSpecial) {
// Don't have to draw, but has to keep the empty space?
if ((left && !dat->row_align_left_items_to_left) || (!left && !dat->row_align_right_items_to_right)) {
RECT rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos, left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE);
@@ -2096,7 +2096,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
if (Drawing->type == CLCIT_CONTACT
&& dat->icon_hide_on_avatar
&& dat->icon_draw_on_avatar_space
- && (!Drawing->image_is_special || !has_avatar ||
+ && (!Drawing->bImageIsSpecial || !has_avatar ||
(dat->avatars_draw_overlay
&& dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
&& GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < _countof(g_pAvatarOverlayIcons)
@@ -2160,7 +2160,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
case ITEM_EXTRA_ICONS: //////////////////////////////////////////////////////////////////////////////////////////////
// Draw extra icons
- if (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0) {
+ if (!Drawing->nSubContacts || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0) {
int iImage;
int count = 0;
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 46fc22fb79..1899349d80 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -252,7 +252,7 @@ void cliBeginRenameSelection(HWND hwnd, ClcData *dat)
return;
int indent, subindent;
- if (contact->type == CLCIT_CONTACT && contact->isSubcontact)
+ if (contact->type == CLCIT_CONTACT && contact->nSubContacts)
subindent = dat->subIndent;
else
subindent = 0;
@@ -411,7 +411,7 @@ int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt)
if (!mir_strcmp(contact->proto, META_PROTO))
return DROPTARGET_ONMETACONTACT;
- if (contact->isSubcontact)
+ if (contact->nSubContacts)
return DROPTARGET_ONSUBCONTACT;
return DROPTARGET_ONCONTACT;
}
@@ -645,18 +645,18 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
dat->bUseWindowsColours = false; // because it's missing in the options
}
-int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat, BOOL bExpand)
+int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat)
{
KillTimer(hwnd, TIMERID_SUBEXPAND);
- if (contact->type != CLCIT_CONTACT || contact->SubAllocated == 0 || contact->SubExpanded == bExpand || !db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT))
+ if (contact->type != CLCIT_CONTACT || contact->iSubAllocated == 0 || contact->bSubExpanded || !db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT))
return 0;
- contact->SubExpanded = bExpand;
- db_set_b(contact->hContact, "CList", "Expanded", contact->SubExpanded);
+ contact->bSubExpanded = true;
+ db_set_b(contact->hContact, "CList", "Expanded", contact->bSubExpanded);
dat->bNeedsResort = true;
pcli->pfnSortCLC(hwnd, dat, 1);
cliRecalcScrollBar(hwnd, dat);
- return contact->SubExpanded;
+ return contact->bSubExpanded;
}
int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
@@ -701,10 +701,10 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
}
}
}
- if (contact->type == CLCIT_CONTACT && contact->SubAllocated) {
- if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || contact->SubExpanded) {
+ if (contact->type == CLCIT_CONTACT && contact->iSubAllocated) {
+ if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || contact->bSubExpanded) {
int i = 0;
- for (i = 0; i < contact->SubAllocated; i++) {
+ for (i = 0; i < contact->iSubAllocated; i++) {
ClcContact *subcontact = &(contact->subcontacts[i]);
bool found;
@@ -720,15 +720,15 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
- if (!contact->SubExpanded)
- ExpandMetaContact(hwnd, contact, dat, 1);
+ if (!contact->bSubExpanded)
+ ExpandMetaContact(hwnd, contact, dat);
return pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex + SubCount + i + 1);
}
}
}
}
- if (contact->type == CLCIT_CONTACT && contact->SubAllocated && contact->SubExpanded)
- SubCount += contact->SubAllocated;
+ if (contact->type == CLCIT_CONTACT && contact->iSubAllocated && contact->bSubExpanded)
+ SubCount += contact->iSubAllocated;
group->scanIndex++;
}
return -1;
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index 2f226d528b..38d843c130 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -172,7 +172,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item)
case TC_STATUS:
if ((contact->type == CLCIT_GROUP && !dat->row_hide_group_icon) ||
(contact->type == CLCIT_CONTACT && contact->iImage != -1 &&
- !(dat->icon_hide_on_avatar && dat->avatars_show && (hasAvatar || (!hasAvatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)) && !contact->image_is_special))) {
+ !(dat->icon_hide_on_avatar && dat->avatars_show && (hasAvatar || (!hasAvatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)) && !contact->bImageIsSpecial))) {
pCell->h = ICON_HEIGHT;
pCell->w = ICON_HEIGHT;
}
@@ -199,7 +199,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item)
case TC_EXTRA: // Draw extra icons
if (contact->type == CLCIT_CONTACT &&
- (!contact->isSubcontact || db_get_b(NULL, "CLC", "MetaHideExtra", SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0)) {
+ (!contact->nSubContacts || db_get_b(NULL, "CLC", "MetaHideExtra", SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0)) {
BOOL hasExtra = FALSE;
int width = 0;
for (int k = 0; k < dat->extraColumnsCount; k++)
@@ -225,7 +225,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item)
case TC_EXTRA8:
case TC_EXTRA9:
if (contact->type == CLCIT_CONTACT &&
- (!contact->isSubcontact || db_get_b(NULL, "CLC", "MetaHideExtra", SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0)) {
+ (!contact->nSubContacts || db_get_b(NULL, "CLC", "MetaHideExtra", SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0)) {
int eNum = pCell->type - TC_EXTRA1;
if (eNum < dat->extraColumnsCount)
if (contact->iExtraImage[eNum] != EMPTY_EXTRA_ICON || !dat->MetaIgnoreEmptyExtra) {
@@ -445,8 +445,8 @@ void RowHeights_CalcRowHeights(ClcData *dat, HWND hwnd)
// increment by subcontacts
if (group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP) {
- if (group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta) {
- if (subindex < group->cl.items[group->scanIndex]->SubAllocated - 1)
+ if (group->cl.items[group->scanIndex]->bSubExpanded && dat->expandMeta) {
+ if (subindex < group->cl.items[group->scanIndex]->iSubAllocated - 1)
subindex++;
else
subindex = -1;
@@ -517,7 +517,7 @@ int RowHeights_GetRowHeight(ClcData *dat, HWND hwnd, ClcContact *contact, int it
// Icon size
if (!dat->icon_ignore_size_for_row_height) {
if (contact->type == CLCIT_GROUP ||
- (contact->type == CLCIT_CONTACT && contact->iImage != -1 && !(dat->icon_hide_on_avatar && dat->avatars_show && contact->avatar_data != NULL && !contact->image_is_special))) {
+ (contact->type == CLCIT_CONTACT && contact->iImage != -1 && !(dat->icon_hide_on_avatar && dat->avatars_show && contact->avatar_data != NULL && !contact->bImageIsSpecial))) {
height = max(height, ICON_HEIGHT);
}
}