-nowplayingd (0.2-1~unreleased1) fremantle; urgency=low
+nowplayingd (0.2-1~unreleased3) fremantle; urgency=low
* Added bugtracker (mailto me)
* Fix postinst/99nowplayingd to use dsmetool -f, which does NOT reboot
device if nowplayingd for some reason goes to segfault loop. Now
it just silently stops trying to respawn it.
+ * Added cleanup functions for mafw and notify
+ * Added dependency to dsme, due dsmetool used in scripts
- -- Tuomo Tanskanen <tumi@tumi.fi> Tue, 02 Mar 2010 09:28:51 +0200
+ -- Tuomo Tanskanen <tumi@tumi.fi> Tue, 02 Mar 2010 14:23:40 +0200
nowplayingd (0.1-2) fremantle; urgency=low
}
}
-static gboolean close_notification( gpointer n )
-{
- notify_notification_close( NOTIFY_NOTIFICATION( n ), NULL );
-
- return FALSE;
-}
-
static void metadata_callback(
const MafwRenderer *self G_GNUC_UNUSED,
const gchar *object_id G_GNUC_UNUSED,
"open_mp_now_playing",
G_TYPE_NONE, NULL,
-1 );
-
+
+ notify_notification_set_timeout( NOTIFY_NOTIFICATION( n ), 4500 /* 4.5s */ );
notify_notification_show( NOTIFY_NOTIFICATION( n ), NULL );
- g_timeout_add_seconds( 5, close_notification, n );
}
static void state_changed_cb(
}
}
+static void renderer_removed_cb(
+ const MafwRegistry *registry2 G_GNUC_UNUSED,
+ GObject *renderer,
+ gconstpointer user_data G_GNUC_UNUSED)
+{
+ if ( MAFW_IS_RENDERER( renderer ) ) {
+ const gchar *name = mafw_extension_get_name( MAFW_EXTENSION( renderer ) );
+
+ if ( !strcmp( name, WANTED_RENDERER ) ) {
+ g_signal_handlers_disconnect_by_func( renderer, G_CALLBACK( state_changed_cb ), NULL );
+ }
+ }
+}
+
static void renderer_added_cb(
const MafwRegistry *registry2 G_GNUC_UNUSED,
GObject *renderer,
}
}
+static void mafw_deinit( void )
+{
+ GList *renderers = NULL;
+
+ g_signal_handlers_disconnect_by_func( registry, G_CALLBACK( renderer_removed_cb ), NULL );
+ renderers = mafw_registry_get_renderers( registry );
+ while ( renderers ) {
+ renderer_removed_cb( registry, G_OBJECT( renderers->data ), NULL );
+ renderers = g_list_next( renderers );
+ }
+}
+
static void mafw_init( void )
{
GList *renderers = NULL;
g_main_loop_unref( loop );
+ mafw_deinit();
+
mafw_shared_deinit();
+ notify_uninit();
+
return EXIT_SUCCESS;
}