From acd7d39f7fa7d868d95abda956347cd8496b32e0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 17 Aug 2010 01:16:43 +0200 Subject: Correctly expand new groups Also, changed some ints to longs to silence compiler warnings --- src/gui/Roster.vala | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gui/Roster.vala b/src/gui/Roster.vala index 75e6631..ade3161 100644 --- a/src/gui/Roster.vala +++ b/src/gui/Roster.vala @@ -56,8 +56,8 @@ public class Roster { start_conversation(contact.jid + "/" + res.key); }); - rosterView.model.row_inserted.connect((path, iter) => { - Idle.add(() => {rosterView.expand_to_path(path); return false;}); + rosterView.model.row_has_child_toggled.connect((path, iter) => { + rosterView.expand_row(path, true); }); Gtk.TreeViewColumn contactColumn = new Gtk.TreeViewColumn.with_attributes(null, new CellRendererContact(), "data", 0, null); @@ -246,7 +246,7 @@ public class Roster { assert_not_reached(); } - private int child_iter_index(Gtk.TreeIter iter) { + private long child_iter_index(Gtk.TreeIter iter) { for(int index = 0; index < childIters.size; ++index) { if(childIters[index].stamp != iter.stamp) continue; @@ -264,14 +264,14 @@ public class Roster { return childIters.size-1; } - private Gtk.TreeIter get_nth_child_iter(int n) { - return childIters[n]; + private Gtk.TreeIter get_nth_child_iter(long n) { + return childIters[(int)n]; } private Gtk.TreeIter? get_child_iter(Gtk.TreeIter iter) { assert(iter.stamp == stamp && iter.user_data == this); - if((int)iter.user_data3 != -1) - return get_nth_child_iter((int)iter.user_data3); + if((long)iter.user_data3 != -1) + return get_nth_child_iter((long)iter.user_data3); else return null; } @@ -348,7 +348,7 @@ public class Roster { Gtk.TreePath subpath = new Gtk.TreePath(); - if((int)iter.user_data3 != -1) { + if((long)iter.user_data3 != -1) { Gtk.TreeIter subiter = get_child_iter(iter); subpath = get_child_model(iter).get_path(subiter); } @@ -359,7 +359,7 @@ public class Roster { public void get_value(Gtk.TreeIter iter, int column, out Value value) { assert (column == 0 && iter.stamp == stamp && iter.user_data == this); - if((int)iter.user_data3 == -1) { + if((long)iter.user_data3 == -1) { value = Value(typeof(String)); value.take_object(iter.user_data2 as String); } @@ -405,7 +405,7 @@ public class Roster { public bool iter_next(ref Gtk.TreeIter iter) { assert(iter.stamp == stamp && iter.user_data == this); - if((int)iter.user_data3 == -1) { + if((long)iter.user_data3 == -1) { bool next = false; foreach(String group in groupModels.keys) { if(next) { @@ -448,7 +448,7 @@ public class Roster { public bool iter_parent(out Gtk.TreeIter iter, Gtk.TreeIter child) { assert(child.stamp == stamp && child.user_data == this); - if((int)child.user_data3 == -1) { + if((long)child.user_data3 == -1) { iter.stamp = -1; return false; } -- cgit v1.2.3