Re: What to return in async transfer callbacks?



On Mon, 2005-09-26 at 09:47 +0200, Matthias Kaeppler wrote:
> Hi,
> 
> I am using gnome-vfs to transfer files asynchronously. At least with the 
> async transfer function, you can connect two callback functions, one 
> which is polled with progress update and one which is called whenever 
> user interaction is required (or an error occured).
> 
> The latter (I think the slot is called on_progress_sync), returns a 
> guint. But which values do I have to return when I handle a query in 
> this callback? Let's say I'm trying to overwrite a file which is already 
> present. Then this function is called. Okay, I handle the error and then 
> what? I have no idea how the return value is supposed to look like. I 
> tried to return OK on several occasions, which immediately aborted the 
> transfer (again, no idea why).
> 
> Weird enough, my code even compiles when I don't return anything! (at 
> this point I have to mention that I am using the C++ bindings to 
> gnome-vfs, so this may not be true for C code). I don't even get a warning.
> 
> Same questions apply to that other callback. Help/hints much appreciated.

This whole API is less than ideal, and not much documented. Try reading
nautilus/libnautilus-private/nautilus-file-operations.c to see how its
used.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an uncontrollable bohemian matador searching for his wife's true killer. 
She's a strong-willed winged doctor with a birthmark shaped like Liberty's 
torch. They fight crime! 




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