Commit 0d77105a authored by Marinus Schraal's avatar Marinus Schraal

views: Remove redundant GLib.idle_add calls

parent 41a77b1e
......@@ -257,6 +257,8 @@ class Grilo(GObject.GObject):
@log
def populate_album_songs(self, album, callback, count=-1):
if album.get_source() == 'grl-tracker-source':
GLib.idle_add(self.populate_items,
Query.album_songs(album.get_id()), 0, callback, count)
self.populate_items(Query.album_songs(album.get_id()), 0, callback, count)
else:
source = self.sources[album.get_source()]
......@@ -267,7 +269,10 @@ class Grilo(GObject.GObject):
@log
def populate_playlist_songs(self, playlist, callback, count=-1):
self.populate_items(Query.playlist_songs(playlist.get_id()), 0, callback, count)
if self.tracker:
GLib.idle_add(self.populate_items,
Query.playlist_songs(playlist.get_id()), 0, callback,
count)
@log
def populate_custom_query(self, query, callback, count=-1, data=None):
......
......@@ -124,7 +124,7 @@ class AlbumsView(BaseView):
@log
def populate(self):
self.window._init_loading_notification()
GLib.idle_add(grilo.populate_albums, self._offset, self._add_item)
grilo.populate_albums(self._offset, self._add_item)
@log
def get_selected_tracks(self, callback):
......
......@@ -168,7 +168,7 @@ class ArtistsView(BaseView):
@log
def populate(self):
self.window._init_loading_notification()
GLib.idle_add(grilo.populate_artists, self._offset, self._add_item)
grilo.populate_artists(self._offset, self._add_item)
@log
def _on_header_bar_toggled(self, button):
......
......@@ -374,7 +374,7 @@ class PlaylistView(BaseView):
self.view.set_model(None)
self.model.clear()
self.songs_count = 0
GLib.idle_add(grilo.populate_playlist_songs, playlist, self._add_item)
grilo.populate_playlist_songs(playlist, self._add_item)
# disable delete button if current playlist is a smart playlist
if self.current_playlist_is_protected():
......@@ -525,8 +525,7 @@ class PlaylistView(BaseView):
@log
def populate(self):
self.playlists_model.clear()
GLib.idle_add(grilo.populate_playlists, self._offset,
self._add_playlist_item)
grilo.populate_playlists(self._offset, self._add_playlist_item)
@log
def get_selected_tracks(self, callback):
......
......@@ -223,7 +223,7 @@ class SongsView(BaseView):
def populate(self):
self._init = True
self.window._init_loading_notification()
GLib.idle_add(grilo.populate_songs, self._offset, self._add_item)
grilo.populate_songs(self._offset, self._add_item)
@log
def get_selected_tracks(self, callback):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment