=== modified file 'unity-private/places/places-volume-child-controller.vala' --- old/unity-private/places/places-volume-child-controller.vala 2010-09-22 13:49:14 +0000 +++ new/unity-private/places/places-volume-child-controller.vala 2010-11-17 12:35:40 +0000 @@ -78,17 +78,27 @@ } try { volume.mount.begin (0, null, null); - - mount = volume.get_mount (); - if (mount is Mount) - AppInfo.launch_default_for_uri (mount.get_root ().get_uri (), null); - else - warning (error_msg + "Unable to mount"); - - } catch (Error e) { - warning (error_msg + e.message); - } - + /* It seems impossible to connect a callback to this asynchronous + method. As a work around, monitor mounts added… */ + VolumeMonitor.get ().mount_added.connect (on_mount_added); + } catch (Error e) { + warning (error_msg + e.message); + } + } + } + + private void on_mount_added (Mount mount) + { + if (mount.get_volume () == volume) + { + // Stop monitoring, we’re done with the asynchronous mount operation. + VolumeMonitor.get ().mount_added.disconnect (this.on_mount_added); + try { + AppInfo.launch_default_for_uri (mount.get_root ().get_uri (), null); + } catch (Error e) { + string error_msg = @"Cannot open volume '$(volume.get_name ())': "; + warning (error_msg + e.message); + } } }