[maemo-commits] [maemo-commits] r8515 - projects/haf/branches/hildon-fm/1.x/hildon-fm
From: www-data at stage.maemo.org www-data at stage.maemo.orgDate: Thu Nov 30 18:32:09 EET 2006
- Previous message: [maemo-commits] r8514 - projects/haf/branches/hildon-fm/1.x/hildon-fm
- Next message: [maemo-commits] r8516 - projects/haf/branches/hildon-fm/1.x/hildon-fm
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: marivoll Date: 2006-11-30 18:32:08 +0200 (Thu, 30 Nov 2006) New Revision: 8515 Modified: projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.c projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.h Log: * hildon-fm/hildon-file-system-obex.h (struct _HildonFileSystemObex): Added binding_id member. * hildon-fm/hildon-file-system-obex.c (bonding_changed): New, for triggering a rescan. (hildon_file_system_obex_init): Connect it to the file system settings. (hildon_file_system_obex_finalize): Disconnect it. Modified: projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.c =================================================================== --- projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.c 2006-11-30 16:29:00 UTC (rev 8514) +++ projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.c 2006-11-30 16:32:08 UTC (rev 8515) @@ -82,10 +82,22 @@ } static void +bonding_changed (GObject *settings, GParamSpec *param, gpointer data) +{ + HildonFileSystemObex *obex = HILDON_FILE_SYSTEM_OBEX (data); + + obex->has_children = FALSE; + g_signal_emit_by_name (data, "rescan"); +} + +static void hildon_file_system_obex_init (HildonFileSystemObex *device) { + HildonFileSystemSettings *fs_settings; HildonFileSystemSpecialLocation *location; + fs_settings = _hildon_file_system_settings_get_instance (); + location = HILDON_FILE_SYSTEM_SPECIAL_LOCATION (device); location->compatibility_type = HILDON_FILE_SYSTEM_MODEL_GATEWAY; location->fixed_icon = g_strdup ("qgn_list_filesys_divc_cls"); @@ -93,11 +105,29 @@ location->failed_access_message = NULL; device->has_children = FALSE; + + device->bonding_handler_id = + g_signal_connect (fs_settings, + "notify::bonding-changed", + G_CALLBACK (bonding_changed), + device); } static void hildon_file_system_obex_finalize (GObject *obj) { + HildonFileSystemObex *obex; + HildonFileSystemSettings *fs_settings; + + obex = HILDON_FILE_SYSTEM_OBEX (obj); + fs_settings = _hildon_file_system_settings_get_instance (); + if (g_signal_handler_is_connected (fs_settings, + obex->bonding_handler_id)) + { + g_signal_handler_disconnect (fs_settings, + obex->bonding_handler_id); + } + G_OBJECT_CLASS (hildon_file_system_obex_parent_class)->finalize (obj); } Modified: projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.h =================================================================== --- projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.h 2006-11-30 16:29:00 UTC (rev 8514) +++ projects/haf/branches/hildon-fm/1.x/hildon-fm/hildon-file-system-obex.h 2006-11-30 16:32:08 UTC (rev 8515) @@ -52,6 +52,7 @@ { HildonFileSystemRemoteDevice parent_instance; gboolean has_children; + gint bonding_handler_id; }; struct _HildonFileSystemObexClass
- Previous message: [maemo-commits] r8514 - projects/haf/branches/hildon-fm/1.x/hildon-fm
- Next message: [maemo-commits] r8516 - projects/haf/branches/hildon-fm/1.x/hildon-fm
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]