After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580779 - Remove hard-coded eject in media-keys
Remove hard-coded eject in media-keys
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on: 594649
Blocks:
 
 
Reported: 2009-04-29 17:29 UTC by Bastien Nocera
Modified: 2010-03-11 17:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Replace "eject" spawn with GIO code (4.50 KB, patch)
2010-03-09 14:25 UTC, Bastien Nocera
reviewed Details | Review
Replace "eject" spawn with GIO code (4.89 KB, patch)
2010-03-10 10:21 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2009-04-29 17:29:01 UTC
Should be pretty straight forward to do with gvfs.

Get a list of volumes, check which is the first one that can be ejected, and call g_volume_eject on it.
Comment 1 Bin Li 2009-06-23 06:38:02 UTC
Bastien,

 What's status the bug now? I'm interesting in this issue.

 Any ideas to do it?
Comment 2 Bastien Nocera 2009-06-23 06:49:53 UTC
You'll need to list the drives connected to the computer using g_volume_monitor_get_connected_drives() and for each one, check whether they can be ejected using g_volume_can_eject() (and are an optical drive, though you can leave that one out for now, as it would be pretty hard to do right now).

Then call g_volume_eject() on the drive, and dismiss the popup after calling g_volume_eject_finish().

To test, disable the media-keys plugin in GConf, and launch test-media-keys in the plugins/media-keys directory.
Comment 3 Bastien Nocera 2010-03-09 14:25:30 UTC
Created attachment 155649 [details] [review]
Replace "eject" spawn with GIO code
Comment 4 Jens Granseuer 2010-03-09 17:10:09 UTC
Review of attachment 155649 [details] [review]:

::: plugins/media-keys/gsd-media-keys-manager.c
@@ -587,3 @@
 
-        command = gconf_client_get_string (manager->priv->conf_client,
-                                           GCONF_MISC_DIR "/eject_command",

Is the key in the schema? If so, we should remove it.

@@ -592,3 @@
-                execute (manager, command, FALSE, FALSE);
-        } else {
-                execute (manager, EJECT_COMMAND, FALSE, FALSE);

EJECT_COMMAND should go, too.
Comment 5 Bastien Nocera 2010-03-09 17:12:09 UTC
(In reply to comment #4)
> Review of attachment 155649 [details] [review]:
> 
> ::: plugins/media-keys/gsd-media-keys-manager.c
> @@ -587,3 @@
> 
> -        command = gconf_client_get_string (manager->priv->conf_client,
> -                                           GCONF_MISC_DIR "/eject_command",
> 
> Is the key in the schema? If so, we should remove it.

It's not.

> @@ -592,3 @@
> -                execute (manager, command, FALSE, FALSE);
> -        } else {
> -                execute (manager, EJECT_COMMAND, FALSE, FALSE);
> 
> EJECT_COMMAND should go, too.

Good point, will do.
Comment 6 Bastien Nocera 2010-03-10 10:21:25 UTC
Created attachment 155716 [details] [review]
Replace "eject" spawn with GIO code
Comment 7 Bastien Nocera 2010-03-11 17:14:50 UTC
Attachment 155716 [details] pushed as 325f4f4 - Replace "eject" spawn with GIO code