ocarina: Better way to scroll to current song

I should use get_attrs() and then use the first result in the list,
rather than using the cur_id variable.  cur_id is not set in the case of
loading a file.
This commit is contained in:
Bryan Schumaker 2011-05-28 15:50:57 -04:00
parent 114ac13c7a
commit 466b0a2c5b
1 changed files with 2 additions and 2 deletions

View File

@ -95,8 +95,8 @@ class ListView(gtk.TreeView):
self.thaw()
def goto(self, *args):
id = libsaria.sources.cur_id
if id == None or id == -1: # Bad id
id = libsaria.sources.get_attrs("id")[0]
if id == -1: # Bad id
return
vis = self.get_visible_rect()
if vis[3] == 0: # The widget hasn't been realized yet