Skip Menu |

This queue is for tickets about the Tk-Wizard CPAN distribution.

Report information
The Basics
Id: 44856
Status: resolved
Priority: 0/
Queue: Tk-Wizard

People
Owner: Nobody in particular
Requestors: MTHURN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.149
Fixed in: (no value)



Subject: bugfix and improvement for dirselect
At line 209 of FileSystem.pm, it says ($d) =~ /^(\w+:)/; I think the point is to delete the slash or backslash off of the drive letter, but the above statement does not accomplish that. Instead, I think $d = $1 if ($d =~ /^(\w+:)/); is better. I noticed this when I was trying to improve the dirtree mechanism... Instead of calling $dirs->configure(-directory => $d) when adding directories to the tree, we should call $dirs->add_to_tree($d, $d) The reason is, when you call configure, it tries to navigate to that directory at the moment of insertion, and it tries to read all the contents of that directory at the moment of insertion. This can be an extremely time-consuming process in case the directory is shared over the network -- and the wizard window freezes until the dirtree is completely built. If we call add_to_tree, it does not do any pre-loading of the folder contents, and the wizard window finishes drawing very quickly. In addition, the DirTree widget does not allow you to add an item that already exists in the tree. This happens with the wizard because before adding all the $_drives, the current folder has already been added. This can be worked around by wrapping the calls to add_to_tree in an eval. To summarize, I recommend changing lines 214, 218, and 223 of FileSystem.pm so that they call eval { $dirs->add_to_tree($d, $d) }
Attached is a copy of FileSystem.pm from Tk-Wizard-2.149 that has these changes

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #44856] bugfix and improvement for dirselect
Date: Wed, 08 Apr 2009 18:20:59 +0100
To: bug-Tk-Wizard [...] rt.cpan.org
From: Lee Goddard <200812 [...] leegoddard.net>
Show quoted text
> At line 209 of FileSystem.pm, it says > > ($d) =~ /^(\w+:)/; > > I think the point is to delete the slash or backslash off of the drive > letter, but the above statement does not accomplish that. Instead, I think >
Could be, I'll have a look, thanks. Show quoted text
> $dirs->configure(-directory => $d) > > when adding directories to the tree, we should call > > $dirs->add_to_tree($d, $d) >
Excellent, thanks: it knew it was slow at the time I coded it, but could see no other way. Will update the module. Thanks Lee
In the next release, many thanks. -- lgoddard at cpan org http://www.LeeGoddard.net