diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-10 16:38:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-10 16:38:37 +0000 |
commit | 5bedc7c584439c4b2cf01e605c044746674003e4 (patch) | |
tree | 3103c3c16254e7ed9c42a3fcf908562a8b6dfbc8 /plugins/Clist_mw | |
parent | 9239c8833dbe27e5257b043a7ca2e90288a9fedb (diff) |
- fix for uninitialized variables;
- code cleaning in clists
git-svn-id: http://svn.miranda-ng.org/main/trunk@2274 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw')
-rw-r--r-- | plugins/Clist_mw/src/clc.cpp | 37 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clcidents.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clcitems.cpp | 4 |
3 files changed, 27 insertions, 18 deletions
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index 0dfd111c39..fe30336531 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -140,8 +140,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L break;
case INTM_ICONCHANGED:
- { struct ClcContact *contact = NULL;
- ClcGroup *group = NULL;
+ {
int recalcScrollBar = 0,shouldShow;
HANDLE hSelItem = NULL;
struct ClcContact *selcontact = NULL;
@@ -157,7 +156,10 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L status = cacheEntry->status;
shouldShow = (GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_SHOWHIDDEN || !cacheEntry->bIsHidden) && (!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline || CallService(MS_CLIST_GETCONTACTICON,wParam,0) != LOWORD(lParam)); //this means an offline msg is flashing, so the contact should be shown
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL)) {
+
+ ClcContact *contact;
+ ClcGroup *group;
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
hSelItem = pcli->pfnContactToHItem(selcontact);
@@ -196,7 +198,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L } }
if (hSelItem) {
ClcGroup *selgroup;
- if (FindItem(hwnd,dat,hSelItem,&selcontact,&selgroup,NULL))
+ if ( FindItem(hwnd,dat,hSelItem,&selcontact,&selgroup,NULL))
dat->selection = GetRowsPriorTo(&dat->list,selgroup,List_IndexOf((SortedList*)&selgroup->cl, selcontact));
else
dat->selection = -1;
@@ -207,12 +209,15 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L goto LBL_Exit;
}
case INTM_STATUSMSGCHANGED:
- { struct ClcContact *contact = NULL;
- ClcGroup *group = NULL;
+ {
DBVARIANT dbv;
- if (!(dat->style&CLS_SHOWSTATUSMESSAGES)) break;
- if (FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL) && contact != NULL) {
+ if (!(dat->style & CLS_SHOWSTATUSMESSAGES))
+ break;
+
+ ClcContact *contact;
+ ClcGroup *group;
+ if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL) && contact != NULL) {
contact->flags &= ~CONTACTF_STATUSMSG;
if (!DBGetContactSettingTString((HANDLE)wParam, "CList", "StatusMsg", &dbv)) {
int j;
@@ -237,6 +242,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L RecalcScrollBar(hwnd,dat);
goto LBL_Exit;
}
+
case WM_TIMER:
if (wParam == TIMERID_DELAYEDREPAINT) {
KillTimer(hwnd,TIMERID_DELAYEDREPAINT);
@@ -263,15 +269,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L stopStatusUpdater = 1;
break;
}
- {
- LRESULT res = saveContactListControlWndProc(hwnd, msg, wParam, lParam);
- switch (msg) {
- case WM_CREATE:
- mir_forkthread(StatusUpdaterThread,0);
- break;
- }
- return res;
+
+ LRESULT res = saveContactListControlWndProc(hwnd, msg, wParam, lParam);
+ switch (msg) {
+ case WM_CREATE:
+ mir_forkthread(StatusUpdaterThread,0);
+ break;
}
+ return res;
LBL_Exit:
return DefWindowProc(hwnd, msg, wParam, lParam);
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index 275a7316b0..8c254fef90 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -231,6 +231,10 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont }
group->scanIndex++;
}
+
+ if (isVisible) *isVisible = FALSE;
+ if (contact) *contact = NULL;
+ if (subgroup) *subgroup = NULL;
return 0;
}
#define CacheArrSize 255
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index 40d048d601..5935022209 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -187,9 +187,9 @@ static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group return group->cl.items[i];
}
-void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline)
+void AddContactToTree(HWND hwnd, ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline)
{
- if (FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
+ if ( FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
return;
pClcCacheEntry cacheEntry = GetContactFullCacheEntry(hContact);
|