From: Ivan Frade Date: Wed, 27 Jan 2010 12:20:14 +0000 (+0200) Subject: Same lazy loading of the view for the strings. X-Git-Tag: mussorgsky-0.5-1~21 X-Git-Url: http://vcs.maemo.org/git/?p=mussorgsky;a=commitdiff_plain;h=765ad2d79bbe7f856d43934be5029493b978648b Same lazy loading of the view for the strings. Now the pannel appears really fast with huge data sets --- diff --git a/src/album_art_panel.py b/src/album_art_panel.py index 63b3150..005b9a5 100644 --- a/src/album_art_panel.py +++ b/src/album_art_panel.py @@ -27,8 +27,7 @@ class MussorgskyAlbumArtPanel (hildon.StackableWindow): for p in album_artists: if (not p[0]): continue - t = ("".join (["", escape_html (p[0]),"\n", - escape_html(p[1]), ""]), None, p[1], p[0], False) + t = (None, None, p[1], p[0], False) self.model.append (t) print "Populate model (DONE):", time.time () @@ -66,8 +65,14 @@ class MussorgskyAlbumArtPanel (hildon.StackableWindow): self.set_app_menu (menu) def album_art_cell_data_cb (self, column, cell, model, iter): - pixbuf, album, not_first_time = model.get (iter, 1, 3, 4) + text, pixbuf, artist, album, not_first_time = model.get (iter, 0, 1, 2, 3, 4) if (not_first_time): + if (text == None): + print "Setting text", album + text = "".join (["", escape_html (album),"\n", + escape_html(artist), ""]) + model.set (iter, 0, text) + if (pixbuf == None): #print "Calling album art cell data cb", model.get (iter, 3) album_art_path = getCoverArtThumbFileName (album) @@ -108,7 +113,7 @@ class MussorgskyAlbumArtPanel (hildon.StackableWindow): if __name__ == "__main__": import random - artists_albums = [("Artist %d the greatest bolero singer in the universe" % i, "Album <%d>" % i) for i in range (0, 10000)] + artists_albums = [("Artist %d the greatest bolero singer in the universe" % i, "Album <%d>" % i) for i in range (0, 100)] # Overwrite the get thumb path for testing def local_file (path):