[rhythmbox] grilo: delete display page when source is removed
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] grilo: delete display page when source is removed
- Date: Sat, 7 Jun 2014 08:28:33 +0000 (UTC)
commit 3ac891ed5cc93b2d1cd574b9e393fe8b6a080483
Author: Florian Will <florian will gmail com>
Date: Tue Jun 3 20:47:11 2014 +0200
grilo: delete display page when source is removed
plugins/grilo/rb-grilo-plugin.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/plugins/grilo/rb-grilo-plugin.c b/plugins/grilo/rb-grilo-plugin.c
index 5794b69..1ad072e 100644
--- a/plugins/grilo/rb-grilo-plugin.c
+++ b/plugins/grilo/rb-grilo-plugin.c
@@ -154,6 +154,19 @@ ignore:
}
static void
+grilo_source_removed_cb (GrlRegistry *registry, GrlSource *grilo_source, RBGriloPlugin *plugin)
+{
+ RBSource *source;
+
+ source = g_hash_table_lookup (plugin->sources, grilo_source);
+
+ if (source) {
+ rb_display_page_delete_thyself (RB_DISPLAY_PAGE (source));
+ g_hash_table_remove (plugin->sources, grilo_source);
+ }
+}
+
+static void
playing_song_changed_cb (RBShellPlayer *player, RhythmDBEntry *entry, RBGriloPlugin *plugin)
{
const char *uri;
@@ -199,6 +212,7 @@ impl_activate (PeasActivatable *plugin)
grl_init (0, NULL);
pi->registry = grl_registry_get_default ();
g_signal_connect (pi->registry, "source-added", G_CALLBACK (grilo_source_added_cb), pi);
+ g_signal_connect (pi->registry, "source-removed", G_CALLBACK (grilo_source_removed_cb), pi);
if (grl_registry_load_all_plugins (pi->registry, &error) == FALSE) {
g_warning ("Failed to load Grilo plugins: %s", error->message);
g_clear_error (&error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]