[FOSS-GPS] Re: Download-progress callbacks in osm-gps-map

Joshua Judson Rosen rozzin at geekspace.com
Sun May 16 09:28:49 EDT 2010


John Stowers <john.stowers.lists at gmail.com> writes:
> On Sat, 2010-05-15 at 16:33 -0400, Joshua Judson Rosen wrote:
> > Sander van Grieken <sander at 3v8.net> writes:
> > > On Friday 14 May 2010 14:04:34 John Stowers wrote:
> > > > Sander van Grieken <sander at 3v8.net> writes:
> > > > >
> > > > > - There seems to be no callback for download-progress-reporting
> > > > > (number of threads, queue depth). I'd hate to ditch the visual
> > > > > download feedback foxtrot currently has.
> > > > 
> > > > No callbacks is by design, the number of queued tiles is exposed as a
> > > > gobject property (tiles-queued). It can be polled at whatever frequency
> > > > the UI wishes (see python demo for example).
> > > 
> > > Well I actually meant signals instead of callbacks, but fair enough,
> > > this should suffice.  Is it also possible to inspect currently
> > > running download threads, and is there a way to cancel the queue?
> > 
> > Actually, shouldn't it be possible to listen for a "notify::tiles-queued"
> > GObject signal?
> 
> Possibly, I am not sure if I call g_object_set() with the tile value
> internally (as this triggers the signal emission) or just update the
> value of the private instance variable directly.
> 
> I suspect I do the former. If this is a problem then I could change to
> ensure that I set the property through the GObject machinery.

Looking it over, "tiles-queued" isn't even settable: but that makes
sense--I don't know what it would even mean to set something like that.

I believe you just need to include a call to g_object_notify() wherever
you're doing something that may change the reported value.

cf. attached patch.

-- 
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Provide-a-notify-signal-for-OsmGpsMap-s-tiles-que.patch
Type: text/x-diff
Size: 1612 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/foss-gps/attachments/20100516/10a7470a/0001-Provide-a-notify-signal-for-OsmGpsMap-s-tiles-que.bin


More information about the FOSS-GPS mailing list