/soc/2012/michael/android: 127ddfc3ff99: Added nodeAliased metho...

Michael Zangl michael at soc.pidgin.im
Tue Aug 7 07:13:35 EDT 2012


Changeset: 127ddfc3ff9997a63154ed1ad4690857e6f86ca8
Author:	 Michael Zangl <michael at soc.pidgin.im>
Date:	 2012-08-07 13:12 +0200
Branch:	 soc.2012.android
URL: http://hg.pidgin.im/soc/2012/michael/android/rev/127ddfc3ff99

Description:

Added nodeAliased method for listener and fixed that the root node of blist has siblings that need to be added to the list.

diffstat:

 android/workspace/im.pidgin.libpurple.testclient/src/im/pidgin/libpurple/testclient/blist/BlistAdapter.java |  16 +++++++--
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (38 lines):

diff --git a/android/workspace/im.pidgin.libpurple.testclient/src/im/pidgin/libpurple/testclient/blist/BlistAdapter.java b/android/workspace/im.pidgin.libpurple.testclient/src/im/pidgin/libpurple/testclient/blist/BlistAdapter.java
--- a/android/workspace/im.pidgin.libpurple.testclient/src/im/pidgin/libpurple/testclient/blist/BlistAdapter.java
+++ b/android/workspace/im.pidgin.libpurple.testclient/src/im/pidgin/libpurple/testclient/blist/BlistAdapter.java
@@ -38,8 +38,8 @@ public class BlistAdapter extends BaseAd
 		this.viewController = viewController;
 		PurpleInstance instance = viewController.getPurple();
 		blist = instance.getBlist();
-		reloadGroups(blist.getRoot());
-		
+		PurpleBlistNode root = blist.getRoot();
+		reloadGroups(root);
 		blist.addBlistListener(this);
 	}
 
@@ -59,8 +59,11 @@ public class BlistAdapter extends BaseAd
 	private void reloadGroups(PurpleBlistNode root) {
 		groups.clear();
 
-		if (root != null) {
-			addGroups(root);
+		
+		PurpleBlistNode current = root;
+		while (current != null) {
+			addGroups(current);
+			current = current.getNextSibling();
 		}
 		recomputeOffsets();
 	}
@@ -175,4 +178,9 @@ public class BlistAdapter extends BaseAd
 		notifyDataChangeAsync();
 	}
 
+	@Override
+	public void nodeAliasChanged(PurpleBlistNode node) {
+		notifyDataChangeAsync();
+	}
+
 }



More information about the Commits mailing list