Re: What to return in async transfer callbacks?



On Tue, 2005-09-27 at 16:12 +0200, Matthias Kaeppler wrote:
> Alexander Larsson wrote:
> > The async callback is called "periodically" to let you change the
> > progress bar in the ui, and when there is a need to ask the user how to
> > progress (e.g. overwrite?).
> Wait a second. You mean, the callback which is called to report progress 
> is also responsible for user interaction? Because, I am handling user 
> interaction in the first callback, not in the one updating the 
> progressbar-dialog, and it works (I am not yet opening any dialogs 
> though, just printing to the standard output).
> 
> This would mean, that the sync callback is also called when user 
> interaction is required. Besides, I also noticed that it's called way 
> more often than just after each transfer, even when no user interaction 
> is required.

If you're copying a directory with a million small files in it, then
progress_sync_callback will be called a million times, with the source
and target filename for each file. progress_update_callback however,
will at most be called every 100 msecs for progress updates. Both are
called when you need user interaction, but its better to use the async
one.

In short, unless you want to know the exact operation taking place in
the operation just ignore the sync callback.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an oversexed guitar-strumming househusband for the 21st century. She's a 
beautiful extravagent journalist who dreams of becoming Elvis. They fight 
crime! 




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