Re: updated_deep_count_in_progress can not get file size




You have said what has already been bothering me. Initially, I wished to left all the things to deep counting, but I found that if I do not call nautilus_file_recompute_deep_count explicitly, the disk space a directory used will not be updated after calling nautilus_file_get_deep_counts, if I add/remove files to/from a directory. So I need to call nautilus_file_recompute_deep_count when necessary.
 
 
Your suggestion is exellent to me, for I do not know there is a way to stop deep counting after it begins...But I still worry that the total time a mouse stayed on a file icon (which is the time nautilus popup a tooltip and the time nautilus have to count deep) would be too short for big directory to complete a deep counting. I noticed that windows seemed to be "deep counting" background, for the next time you pointed mouse to a big directory it often show up total size immediately.
 
 
So the questions I am dealing now are as below:

1. When to start a deep counting recomputing? to update a big directory contents changes?
           I am trying to filter NautilusFile "changed" signal into a new signal somewhat like "disk_space_changed" signal to represent file add/remove/size changed, which might be the chance a big directory should recompute deep counting. The NautilusFile "changed" signal is too often, and seemed useless to me.
 

2. When to stop a deep counting recomputing, if necessary ?
            To let it finished anyway in background, or to stop it every time the mouse move away from the file icon? Could deep counting restart where the last deep counting was stopped? There is some caching inside deep counting itself, since deep counting is always much faster than the last computing, but directly caching it might be faster and simpler.
Best Regards!   Gao Long

Christian Neumair <cneumair gnome org> 写道:
El mié, 07-05-2008 a las 22:31 +0800, Gaolong escribió:
> I try to avoid too much deep counting by caching the results as
> metadata in directories, and invalidate the metadata by recompute deep
> counting at proper time. The proper time maybe when a NautilusFile is
> added, removed or changed.

I think this should work already, cf. nautilus-directory-async.c:

deep_count_start
deep_count_stop
lacks_deep_count

You will have to ensure that a deep count file info request is
installed / removed when popping up / down a tooltip.

nautilus_file_monitor_add()
nautilus_file_monitor_remove()
nautilus_file_call_when_ready()
nautilus_file_cancel_call_when_ready()

are the relevant functions.

best regards,
Christian

--
Christian Neumair



雅虎邮箱,您的终生邮箱!

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