View Issue Details

IDProjectCategoryView StatusLast Update
0027571LazarusLCLpublic2015-03-01 14:13
ReporterAnton Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86OSWin32 
Product Version1.5 (SVN) 
Target Version1.4 
Summary0027571: ShellTreeView does not show files in folders without subfolders
DescriptionAfter r47815 ShellTreeView does not show (in connected ShellListView) files of the deepest folder (that has no subfolders). Due to ugly check (shellctrls.pas:862) it shows files in the parent folder.
Steps To ReproduceNew application, shelltreeview + shelllistview (connected), run and select the folder that contains only files in shelltreeview.
TagsNo tags attached.
Fixed in Revisionr48056, r48063
LazTarget1.4
WidgetsetWin32/Win64
Attached Files

Activities

Bart Broersma

2015-03-01 00:02

developer   ~0081520

Sorry, messed up the logic.
Please test and close if OK.

Bart Broersma

2015-03-01 10:58

developer   ~0081528

> Due to ugly check (shellctrls.pas:862)
Would you mind not trying to insult the developers with such remarks in future please?
"Due to probably wrong check (shellctrls.pas:862)" would have been so much nicer ;-)

Anyway: thanks for spotting the error and the exact location.

Anton

2015-03-01 11:11

reporter   ~0081529

Thanks, r48056 fixed my particular case but it is not the solution in general.
If ShellTreeView.ObjectTypes contains [otNonFolders] then after trying to expand empty folder when expand sign disappears, connected shellListview begins to display content of parent folder (but should show nothing).
Why DirectoryExistsUTF8(GetPathFromNode(ANode)) cannot be used to determine IsDirectory?
I'll wait before close this issue.

Bart Broersma

2015-03-01 13:19

developer   ~0081533

You are right.
I tried to avoid yet another call to the filesystem, but did not notice that HasChildren changes to False in the scenario you described.

Fixed as suggested.

Leaves us with another "problem".
What if folder has been removed in the meantime?
IsDirectory will be false, and as a result it will show parentdirectory.
It should however raise an exception.
At this point in time we cannot know if the selected node in fact was a folder to begin with.

Anton

2015-03-01 14:13

reporter   ~0081538

Thank you, Bart!
Deletion of directory is another issue.
As far as I know at least in Windows there tools to monitoring filesystem changes. I have not ever used them so I don't know a lot. Maybe such tools can be used to solve problem with removing folder in the meantime.

Issue History

Date Modified Username Field Change
2015-02-28 22:30 Anton New Issue
2015-02-28 23:48 Bart Broersma Assigned To => Bart Broersma
2015-02-28 23:48 Bart Broersma Status new => assigned
2015-03-01 00:02 Bart Broersma Fixed in Revision => r48056
2015-03-01 00:02 Bart Broersma LazTarget => 1.4
2015-03-01 00:02 Bart Broersma Note Added: 0081520
2015-03-01 00:02 Bart Broersma Status assigned => resolved
2015-03-01 00:02 Bart Broersma Resolution open => fixed
2015-03-01 00:02 Bart Broersma Target Version => 1.4
2015-03-01 10:58 Bart Broersma Note Added: 0081528
2015-03-01 11:11 Anton Note Added: 0081529
2015-03-01 13:19 Bart Broersma Fixed in Revision r48056 => r48056, r48063
2015-03-01 13:19 Bart Broersma Note Added: 0081533
2015-03-01 14:13 Anton Note Added: 0081538
2015-03-01 14:13 Anton Status resolved => closed