summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/links.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-30 20:10:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-30 20:10:41 +0000
commit916709315ea2044a31adfc0e5b2809fe712358f3 (patch)
treef9aa0dbe9507dd3a36b5167a83608ba9765ed5a4 /protocols/Gadu-Gadu/src/links.cpp
parent8d3522f82f331954a495275a0e23402906d9bb9a (diff)
- major cleanup of GG avatar code
- fix for hangup on exit git-svn-id: http://svn.miranda-ng.org/main/trunk@5198 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/links.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/links.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp
index 8b78eb73dc..fafaf05c48 100644
--- a/protocols/Gadu-Gadu/src/links.cpp
+++ b/protocols/Gadu-Gadu/src/links.cpp
@@ -41,12 +41,10 @@ static INT_PTR gg_menuchoose(WPARAM wParam, LPARAM lParam)
static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam)
{
char *arg = (char*)lParam;
- list_t l = g_Instances;
- GGPROTO *gg = NULL;
uin_t uin;
int items = 0;
- if (list_count(l) == 0)
+ if (g_Instances.getCount() == 0)
return 0;
if (arg == NULL)
@@ -63,20 +61,20 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam)
if (!uin)
return 1;
- for (; l; l = l->next) {
- GGPROTO *gginst = (GGPROTO*)l->data;
+ GGPROTO *gg = NULL;
+ for (int i=0; i < g_Instances.getCount(); i++) {
+ gg = g_Instances[i];
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS;
- if (gginst->m_iStatus > ID_STATUS_OFFLINE) {
+ if (gg->m_iStatus > ID_STATUS_OFFLINE) {
++items;
- gg = (GGPROTO*)l->data;
mi.flags |= CMIM_ICON;
mi.hIcon = LoadSkinnedProtoIcon(gg->m_szModuleName, gg->m_iStatus);
}
else mi.flags |= CMIF_HIDDEN;
- Menu_ModifyItem(gginst->hInstanceMenuItem, &mi);
+ Menu_ModifyItem(gg->hInstanceMenuItem, &mi);
if (mi.hIcon)
Skin_ReleaseIcon(mi.hIcon);
}
@@ -156,7 +154,7 @@ void GGPROTO::links_instance_init()
TMO_MenuItem tmi = { sizeof(tmi) };
tmi.flags = CMIF_TCHAR;
tmi.ownerdata = this;
- tmi.position = list_count(g_Instances);
+ tmi.position = g_Instances.getCount();
tmi.ptszName = m_tszUserName;
hInstanceMenuItem = (HGENMENU)CallService(MO_ADDNEWMENUITEM, (WPARAM)hInstanceMenu, (LPARAM)&tmi);
}