fixed race condition on profile change

This commit is contained in:
Martin Wagner 2020-08-13 17:01:46 +02:00
parent 0be454a8d7
commit 8ba053921e

View File

@ -1553,7 +1553,7 @@ class AlbumIconView(Gtk.IconView):
def populate(self, artists): def populate(self, artists):
self.stop_flag=False self.stop_flag=False
# prepare albmus list # prepare albmus list
self.store.clear() GLib.idle_add(self.store.clear)
if len(artists) > 1: if len(artists) > 1:
self.set_markup_column(2) self.set_markup_column(2)
else: else:
@ -1822,6 +1822,7 @@ class Browser(Gtk.Paned):
return self.search.started() return self.search.started()
def back_to_album(self, *args): # TODO def back_to_album(self, *args): # TODO
def callback():
try: # since this can still be running when the connection is lost, various exceptions can occur try: # since this can still be running when the connection is lost, various exceptions can occur
song=ClientHelper.song_to_first_str_dict(self.client.wrapped_call("currentsong")) song=ClientHelper.song_to_first_str_dict(self.client.wrapped_call("currentsong"))
try: try:
@ -1854,6 +1855,7 @@ class Browser(Gtk.Paned):
self.album_view.scroll_to_selected_album() self.album_view.scroll_to_selected_album()
except: except:
pass pass
GLib.idle_add(callback)
def on_search_toggled(self, widget): def on_search_toggled(self, widget):
if widget.get_active(): if widget.get_active():