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 715167 - Support multiple filesystem sources, one per device
Support multiple filesystem sources, one per device
Status: RESOLVED OBSOLETE
Product: grilo
Classification: Other
Component: plugins
git master
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-25 15:03 UTC by Philip Withnall
Modified: 2018-09-24 09:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
TEST: Set per-device-source (1.09 KB, patch)
2015-09-02 11:32 UTC, Bastien Nocera
reviewed Details | Review

Description Philip Withnall 2013-11-25 15:03:53 UTC
It would be nice to be able to present removable media (e.g. USB sticks) as separate top-level GrlSources. To do so, the grl-filesystem plugin would need to support instantiating multiple sources which track the mounted filesystems.

This would make the filesystem plugin more closely match, e.g., the UPnP plugin, where each UPnP device is listed as a separate GrlSource.
Comment 1 Juan A. Suarez Romero 2013-11-25 15:30:50 UTC
This feature is implemented in the Tracker plugin.

There's an configuration option named "per-device-source" that does precisely that.
Comment 2 Philip Withnall 2013-11-26 10:15:57 UTC
OK. Would it make sense to implement it in the filesystem plugin as well?
Comment 3 Juan A. Suarez Romero 2013-11-26 11:04:21 UTC
I think it wouldn't hurt :)
Comment 4 Bastien Nocera 2014-01-15 13:03:25 UTC
You should be able to do this already by creating new grl-filesystem sources yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses it to show a "Recent" filesystem. Is that enough?
Comment 5 Philip Withnall 2014-01-15 22:31:06 UTC
(In reply to comment #4)
> You should be able to do this already by creating new grl-filesystem sources
> yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses
> it to show a "Recent" filesystem. Is that enough?

I can see how to set the base URI for the filesystem plugin in the config, but I can’t see how to create multiple instances of GrlFilesystemSource. Even creating it manually with g_object_new(), the chosen_uris have to be set by code with access to GrlFilesystemSourcePrivate.

(https://git.gnome.org/browse/grilo-plugins/tree/src/filesystem/grl-filesystem.c#n171)

If there is a way to do it, it sounds like a reasonable workaround. Implementing per-device-source in the filesystem plugin itself, though, means that the client doesn’t have to care about filesystem mount monitoring, which is nice.
Comment 6 Bastien Nocera 2014-01-16 10:52:09 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > You should be able to do this already by creating new grl-filesystem sources
> > yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses
> > it to show a "Recent" filesystem. Is that enough?
> 
> I can see how to set the base URI for the filesystem plugin in the config, but
> I can’t see how to create multiple instances of GrlFilesystemSource. Even
> creating it manually with g_object_new(), the chosen_uris have to be set by
> code with access to GrlFilesystemSourcePrivate.

https://git.gnome.org/browse/grilo/tree/tools/grilo-test-ui/main.c#n1693

> (https://git.gnome.org/browse/grilo-plugins/tree/src/filesystem/grl-filesystem.c#n171)
> 
> If there is a way to do it, it sounds like a reasonable workaround.
> Implementing per-device-source in the filesystem plugin itself, though, means
> that the client doesn’t have to care about filesystem mount monitoring, which
> is nice.

We already have an Optical Media plugin. With some additional patches (in bug 703619) it won't show anything but DVDs or disc images. Not sure that's what you're after.
Comment 7 Philip Withnall 2014-01-16 23:06:27 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > You should be able to do this already by creating new grl-filesystem sources
> > > yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses
> > > it to show a "Recent" filesystem. Is that enough?
> > 
> > I can see how to set the base URI for the filesystem plugin in the config, but
> > I can’t see how to create multiple instances of GrlFilesystemSource. Even
> > creating it manually with g_object_new(), the chosen_uris have to be set by
> > code with access to GrlFilesystemSourcePrivate.
> 
> https://git.gnome.org/browse/grilo/tree/tools/grilo-test-ui/main.c#n1693

Aah, missed that. Thanks!

> > (https://git.gnome.org/browse/grilo-plugins/tree/src/filesystem/grl-filesystem.c#n171)
> > 
> > If there is a way to do it, it sounds like a reasonable workaround.
> > Implementing per-device-source in the filesystem plugin itself, though, means
> > that the client doesn’t have to care about filesystem mount monitoring, which
> > is nice.
> 
> We already have an Optical Media plugin. With some additional patches (in bug
> 703619) it won't show anything but DVDs or disc images. Not sure that's what
> you're after.

More after some way of displaying USB sticks separately, so I think the filesystem plugin is more appropriate. It’s quite low priority at the moment though.
Comment 8 Juan A. Suarez Romero 2014-01-20 09:56:05 UTC
As it is implemented right now, if you set several base-uris in the filesystem plugin, it will create one source with those uris as the top-level elements.

Not sure if this is what you are suggesting, but we could add a config option so instead of showing one source with all those uris, create one source per each top-level uri.

The problem is that it is the application who needs to set up all the base-uris, and once they are set up, they can't be changed during the execution.

The other option is to cherry-pick some patches from Optical Media, and create one source per each plugged device.
Comment 9 Philip Withnall 2014-01-21 23:40:51 UTC
(In reply to comment #8)
> The other option is to cherry-pick some patches from Optical Media, and create
> one source per each plugged device.

That would make sense, coupled with a ‘per-device-source’ option like in the Tracker plugin.

Basically the goal is to display each GrlSource as a different icon in a grid, and to display removable media (USB sticks, CDs, etc.) separately from the main filesystem — as different icons in the grid. So that means having separate sources for removable media, not just one source with several top-level elements. So Bastien’s workaround isn’t quite appropriate for this use case. :-(

As I said, this is pretty low priority at the moment, so it’ll be a while until I get a chance to come up with a patch.
Comment 10 Bastien Nocera 2015-09-02 11:32:19 UTC
Created attachment 310484 [details] [review]
TEST: Set per-device-source
Comment 11 Bastien Nocera 2015-09-02 11:45:58 UTC
(In reply to Philip Withnall from comment #9)
> (In reply to comment #8)
> > The other option is to cherry-pick some patches from Optical Media, and create
> > one source per each plugged device.
> 
> That would make sense, coupled with a ‘per-device-source’ option like in the
> Tracker plugin.
> 
> Basically the goal is to display each GrlSource as a different icon in a
> grid, and to display removable media (USB sticks, CDs, etc.) separately from
> the main filesystem — as different icons in the grid.

I don't see how enumerating sources is that much different from enumerating items inside a source, if you know that the source behaves in a particular way.

In any case, I wouldn't mind:
- making grl-filesystem create one source per configured root
- exposing enough information in grl-optical-media for applications to avoid setting up duplicate roots in grl-filesystem

> So that means having
> separate sources for removable media, not just one source with several
> top-level elements. So Bastien’s workaround isn’t quite appropriate for this
> use case. :-(

Note that I tried to use the per-device-source config option in the tracker plugin in comment 10, but it doesn't create any sources for my films SD card.
Comment 12 Bastien Nocera 2015-09-23 10:51:52 UTC
Comment on attachment 310484 [details] [review]
TEST: Set per-device-source

Mark as reviewed so it disappears from the patch review list.
Comment 13 GNOME Infrastructure Team 2018-09-24 09:23:55 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/grilo/issues/34.