Summary: | A DeviceAutoMountHint attribute should be added to udisks | ||
---|---|---|---|
Product: | udisks | Reporter: | ayan george <ayan> |
Component: | detection | Assignee: | David Zeuthen (not reading bugmail) <zeuthen> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Patch 1/4 - src/device-private.c
Patch 2/4 - src/device-private.h Patch 3/4 - data/org.freedesktop.UDisks.Device.xml Patch 4/4 - src/device.c |
Description
ayan george
2011-06-21 11:32:24 UTC
Created attachment 48260 [details] [review] Patch 1/4 - src/device-private.c Created attachment 48261 [details] [review] Patch 2/4 - src/device-private.h Created attachment 48262 [details] [review] Patch 3/4 - data/org.freedesktop.UDisks.Device.xml Created attachment 48263 [details] [review] Patch 4/4 - src/device.c Note: it doesn't make any sense to split this into four patches since - it breaks compilation if patches are in the wrong order (and in this case they are) - it breaks bisectability - one logical change is one commit, nothing more, nothing less (In reply to comment #3) > Created an attachment (id=48262) [details] > Patch 3/4 - data/org.freedesktop.UDisks.Device.xml + An empty string is interpreted to mean "never". We definitely don't want this - I'm replacing it with An empty string is interpreted to mean that there is no hint - the desktop auto-mounter should make its own decision of whether to auto-mount the device. The patches don't include additions to the udisks(7) man page. I'm adding this <varlistentry> <term><option>UDISKS_AUTOMOUNT_HINT</option></term> <listitem><para> A variable to influence whether a device should be automounted. Possible values include "always" (to hint that a device should always be automounted) and "never" (to hint that a device should never be automounted). Note that this is only a hint - the auto-mounter might not honor it. </para></listitem> </varlistentry> (In reply to comment #1) > Created an attachment (id=48260) [details] > Patch 1/4 - src/device-private.c + if (G_UNLIKELY (g_strcmp0(device->priv->device_auto_mount_hint,value))) - missing space between g_strcmp0 and opening parenthesis - missing space after comma - improper use of int as a boolean - you want to use != 0 explicitly I've changed it to this if (G_UNLIKELY (g_strcmp0 (device->priv->device_auto_mount_hint, value) != 0)) (In reply to comment #4) > Created an attachment (id=48263) [details] > Patch 4/4 - src/device.c + const char *auto_mount_hint = ""; We generally don't mix initializers and declarations. I've moved this down to before the if. I've also changed this to gchar (the rest of the code isn't consistent with char vs gchar yet so I don't blame you for using char). OK, pushed two patches http://cgit.freedesktop.org/udisks/commit/?id=858adbac9dce63da52764b2d2157bc7782b304a5 http://cgit.freedesktop.org/udisks/commit/?id=ce27a0f7e45cd66b18fcbfe1c8f38ef9e8d4e903 Thanks for your contributions. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.