Re: [Tracker] Mining completed notifications for removable devices



On Fri, Jun 15, 2012 at 10:20 PM, Sam Thursfield <ssssam gmail com> wrote:
Hi all

I've been working on some code this week to add a 'DeviceComplete'
signal to the FS miner, which will emit a signal when the crawling of
a specific removable device has been complete.

I'll push the branch next week, after tidying it up a bit, but I
thought I'd mention it now - in part because I'm aware Felipe is doing
some work on removable devices as well and I want to make sure we stay
coordinated !

The use case is simple; you want to update a UI with all the data a
removable device contains, as soon as it's available. It's possible to
do it gradually with GraphUpdated as the data appears, but in practice
this is going to hammer DBus and the UI code and it's nice to be able
to just query everything once it's available instead.

I've seen people connecting to Miner.Progress to get the status of USB
crawling, and I don't think I need to explain why this is so nasty.

Internally, it's implemented by associating each GFile with its mount,
and keeping a counter on the mount of how many files have been
processed. It might not sound nice but it's working pretty well in
practice :) Associating the mount with the GFile also allows us to
remove things from the processing queues right away when they are on a
USB that has been removed, instead of waiting for extraction errors
and logging lots of errors.


I pushed branch: wip/removable-device-completed

I'm still not certain how useful this feature will be. Maybe it could
be useful in combination to the work Felipe is working on?

Either way, some useful stuff has come out of it: I did various work
on the functional tests, including adding a fake GVolumeMonitor which
can be controlled by the functional tests over DBus to simulate mounts
and unmounts, and a new test that uses it. That should keep the
removable device support in better shape in the future.

Thanks
Sam



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]