soc.2009.vulture: 9b72429f: Make sure parent blist node is shown bef...

gdick at soc.pidgin.im gdick at soc.pidgin.im
Sat Jun 20 16:30:48 EDT 2009


-----------------------------------------------------------------
Revision: 9b72429f61b4380bcf79151ab18dab3eccb5a215
Ancestor: 364de04f0e591ac5889b8378191e992abfcc9c05
Author: gdick at soc.pidgin.im
Date: 2009-06-19T16:03:00
Branch: im.pidgin.soc.2009.vulture
URL: http://d.pidgin.im/viewmtn/revision/info/9b72429f61b4380bcf79151ab18dab3eccb5a215

Modified files:
        vulture/purpleblist.c vulture/purpleblist.h

ChangeLog: 

Make sure parent blist node is shown before children.

-------------- next part --------------
============================================================
--- vulture/purpleblist.c	8a621aeccdfb079faf9c6c469169a0e99d2d81ed
+++ vulture/purpleblist.c	c6d8e121f93f1b43f86539d7b192ec924f7e84c3
@@ -49,6 +49,7 @@ void PurpleBlistNewNode(PurpleBlistNode 
 
 	VULTURE_BLIST_NODE *lpvbn = (VULTURE_BLIST_NODE*)(lpblistnode->ui_data = g_new(VULTURE_BLIST_NODE, 1));
 
+	lpvbn->lpblistnode = lpblistnode;
 	lpvbn->szNodeText = NULL;
 	lpvbn->hti = NULL;
 	lpvbn->lRefCount = 1;
@@ -67,8 +68,6 @@ void PurpleBlistUpdateNode(PurpleBuddyLi
 {
 	VULTURE_BLIST_NODE *lpvbn;
 
-	UNREFERENCED_PARAMETER(lpbuddylist);
-
 	if(!lpblistnode)
 		return;
 
@@ -113,6 +112,10 @@ void PurpleBlistUpdateNode(PurpleBuddyLi
 		/* TODO: We should probably be less willing to give up. */
 		if(lpvbn->szNodeText)
 		{
+			/* If out parent isn't showing, show it first. */
+			if(lpvbn->lpvbnParent && !lpvbn->lpvbnParent->hti)
+				PurpleBlistUpdateNode(lpbuddylist, lpvbn->lpvbnParent->lpblistnode);
+
 			VultureBListNodeAddRef(lpvbn);
 			VulturePostUIMessage(g_hwndMain, VUIMSG_UPDATEBLISTNODE, lpvbn);
 		}
============================================================
--- vulture/purpleblist.h	abe0a563ec78440945f1d95893f867b2134afb72
+++ vulture/purpleblist.h	4b08869ad7f594ac3de578dbb753447e4c9f538a
@@ -33,6 +33,7 @@ typedef struct _VULTURE_BLIST_NODE
 
 typedef struct _VULTURE_BLIST_NODE
 {
+	PurpleBlistNode			*lpblistnode;
 	LPTSTR				szNodeText;
 	HTREEITEM			hti;
 	struct _VULTURE_BLIST_NODE	*lpvbnParent;


More information about the Commits mailing list