rind: Use tree paths when working with the filter model
We already have the filtered path, so it doesn't take too much work to convert it to the child path and look up the corresponding node. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
545854ca35
commit
e116b7a784
|
@ -18,8 +18,8 @@ class NodeTreeModel(GObject.GObject, Gtk.TreeModel):
|
|||
curds.notify.register("playlist-changed", self.on_playlist_changed, queue=True)
|
||||
|
||||
def can_select_path(self, selection, model, path, current):
|
||||
child = model.convert_iter_to_child_iter(model.get_iter(path))
|
||||
plist = self.iter_playlist(child)
|
||||
child = model.convert_path_to_child_path(path)
|
||||
plist = curds.playlist.Root.get_node(child)
|
||||
return isinstance(plist, curds.Playlist)
|
||||
|
||||
def do_get_column_type(self, col):
|
||||
|
@ -136,9 +136,8 @@ class NodeTreeModel(GObject.GObject, Gtk.TreeModel):
|
|||
def on_selection_changed(self, selection):
|
||||
(model, rows) = selection.get_selected_rows()
|
||||
if len(rows) > 0:
|
||||
iter = model.get_iter(rows[0])
|
||||
child = model.convert_iter_to_child_iter(iter)
|
||||
plist = self.iter_playlist(child)
|
||||
child = model.convert_path_to_child_path(rows[0])
|
||||
plist = curds.playlist.Root.get_node(child)
|
||||
playlist.PlistModel.set_playlist(plist)
|
||||
|
||||
def playlist_iter(self, plist):
|
||||
|
|
Loading…
Reference in New Issue