[haiku-development] Re: DiskUsage scan abortion

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 03 Mar 2011 10:20:39 +0100

On 03.03.2011 04:28, Clemens wrote:
On Thu, 03 Mar 2011 15:56:36 +1300, Philippe Saint-Pierre
<stpere@xxxxxxxxx> wrote:

Hi everyone,

I would like to get your opinion on this topic. I'm currently
implementing
scan abortion in DiskUsage and I have a dilemma. Here are my options
about
what could happen when invoking the abortion :

1. When you click abort during a scan, the scanned data is discarded and
you don't get a pieview. (easiest)
2. When you click abort during a scan, the already collected data is
shown
in a pieview.. so you get an incomplete view (2a would be to put some
hint
to remind the view is incomplete)
3. Before starting a scan, you copy the old data, scan, if you happen to
abort, revert to the old data.

Currently, I have version 2 implemented and working. While 3 seems like
more elaborate, it seems quite heavy and expensive to copy the data
before
starting the scan (which is already slow)

Any input? (or other options I didn't consider yet?)


I'm in favour of 1. because 2. (as you mentioned) shows an incomplete view.

If you like to make it really neat make it asynchronous and on demand.
For example, start with the home folder as a inner circle with a "? MiB"
label and around this circle all direct subfolders also marked with a
"?" and maybe also with the folder name. Now you start scanning all
subfolders in home. After scanning the complete home folder update the
view and continue with the rest of the file system. While scanning all
subfolders the user should be able to click on a subfolder with a "?" to
make it the new middle circle and scan this folder first. In this way
you can navigate to the folder you are interested in and don't have to
wait till the complete volume is scanned. The implementation could be
quite tricky to not lose track about scanned and unscanned folder but it
should be very nice and faster for the user!
A rescan would trigger a rescan starting with the current selected folder.

The problem with this approach is that scanning works from leaf to root. I.e. to be able to display the size of the home folder, you have to first scan every sub-folder and all their sub-sub-folders. However, I think this could work: Display the pie view right when scanning starts (i.e. always), but without the known proportions. It should be very quick to know how many subfolders a folder has, and this can work from root to leaf. Display each subfolder with equal size and question marks as Clemens suggests. The scanning happens in the background and updates each folder as results pour in. Once the size of all subfolders is known, the proportions can be updated. Now, when the user double clicks a subfolder to zoom into it, you can abort the scan process if it is not currently inside any of the sub-folders of the zoomed in folder, and switch to continue scanning there. This could be done by making the scanning work like a queue, initially scheduling one scan job per folder, and resorting the queue on demand according to the user actions. One problem with this approach is that DiskUsage will not necessarily display all subfolders, i.e. if a sub-folder is too insignificant in size, it will be left out (IIRC). However, this could be simply changed to display as many subfolders with unknown size as can fit around the pie, perhaps with one pie piece labeled "..." to indicate there are more subfolders than shown. This would disappear when view is updated after all sizes are known.

Best regards,
-Stephan

Other related posts: