View Issue Details

IDProjectCategoryView StatusLast Update
0026088LazarusLCLpublic2015-12-09 10:51
ReporterNguyen Tien Trung KienAssigned ToBart Broersma 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version13.10
Product Version1.2.0Product Build 
Target Version1.6Fixed in Version1.6 
Summary0026088: TShellTreeView.SetPath() doesn't work correctly
DescriptionIn my project in my attachment, I tried to execute this instruction: ShellTreeView1.Path:='/usr/share/'; (by clicking into a button) but nothing happened.
Steps To ReproducePlease open my attachment, build the project and click to a button 'Hahaha' to see the strange behavior.
TagsNo tags attached.
Fixed in Revisionr44839, r50648
LazTarget1.6
Widgetset
Attached Files

Activities

Nguyen Tien Trung Kien

2014-04-28 17:45

reporter  

shell_tree_view_bug.zip (2,206 bytes)

Bart Broersma

2014-04-28 17:53

developer   ~0074645

At that point in time, what is the value of the property Root?
The "Path" must be a subfolder of Root or else it will fail (by design).

Bart

Bart Broersma

2014-04-28 20:13

developer   ~0074646

Last edited: 2014-04-28 20:13

View 2 revisions

Please test and close if OK.

Nguyen Tien Trung Kien

2014-05-14 18:15

reporter   ~0074998

Thank you for your help. I'm sorry because of my late reply. I have only one more question. I used the following code and it is OK:

ShellTreeView1.Root := '/usr/';
ShellTreeView1.Path := '/usr/share/lazarus';

but the following code is not

ShellTreeView1.Root := '/';
ShellTreeView1.Path := '/usr/share/lazarus';

Folder '/' obiously contain '/usr/share/lazarus'. What makes the different behaviors between two above code?

Bart Broersma

2014-05-16 19:07

developer   ~0075029

I cannot reproduce that.

See attached (slightly altered) sample project.

First I set Root to /usr
Then I set Path to /usr/share/gnome

It outputs for me:

--------------------------------
SetRoot(/usr)
Root = /usr
Path = /usr/
OK
--------------------------------
--------------------------------
SetPath(/usr/share/gnome)
Path = /usr/share/gnome
Root = /usr
OK
--------------------------------

and the correct folder gets selected in the treeview.


Then I set Root to /
and then Path to /usr/local/lib/fpc

It gives this output:

--------------------------------
SetRoot(/)
Root = /
Path = /
OK
--------------------------------
--------------------------------
SetPath(/usr/local/lib/fpc)
Path = /usr/local/lib/fpc
Root = /
OK

Again it correctlly selects the appropriate folder in the treeview.

Bart Broersma

2014-05-16 19:09

developer  

project1.zip (2,519 bytes)

Bart Broersma

2014-06-19 18:22

developer   ~0075796

No feedback.

Alexander Koblov

2015-11-07 11:34

reporter  

bug.txz (61,744 bytes)

Alexander Koblov

2015-11-07 11:36

reporter   ~0087177

Last edited: 2015-11-07 11:38

View 2 revisions

I can confirm that it does not work under Linux:

Root = /
Path = /usr/share

Lazarus 1.4.4. See simple attached project. Press "Button1", nothing happened.

Bart Broersma

2015-12-02 13:22

developer   ~0087746

Last edited: 2015-12-02 13:22

View 2 revisions

Can you please test with trunk?
I cannot reproduce the issue (se my notes above).

Alexander Koblov

2015-12-02 19:28

reporter   ~0087762

Last edited: 2015-12-02 19:28

View 2 revisions

Checked with latest Lazarus trunk. It does not work. Output from your test project:

--------------------------------
SetRoot(/)
Root = /
Path = /
OK
--------------------------------
--------------------------------
SetPath(/usr/share)
Path = /
Root = /
OK
--------------------------------

I debug the code and found that it is because on the line

>>> IsRelPath := (FQRootPath = '') or TryCreateRelativePath(AValue, FQRootPath, False, True, RelPath);

path converted from absolute to relative but later at the line

>>>if RootIsAbsolute then sl.Delete(0);

code thinks that path is absolute and remove first path element. So later it cannot find correct node. If I remove above line then works as expected.

Bart Broersma

2015-12-02 23:59

developer   ~0087765

Last edited: 2015-12-03 18:46

View 2 revisions

Confirmed.
Happens on Windows too.

Commenting out "if RootIsAbsolute then sl.Delete(0);" seems to resolve.
I cannot remember anymore why this line is there.
Nor can I figure out why it worked before and now stopped working.
The whole bloody thing is a beast.

Bart Broersma

2015-12-05 17:45

developer   ~0087803

I have no idea why I wrote that line in question.
I commented it out.

Please test thoroughly and close if (finally OK).

Alexander Koblov

2015-12-09 05:24

reporter   ~0087850

I checked with Linux and Windows with several "Root" and "Path". Works fine for me. But I can't close issue because I am not initial reporter.

Issue History

Date Modified Username Field Change
2014-04-28 17:45 Nguyen Tien Trung Kien New Issue
2014-04-28 17:45 Nguyen Tien Trung Kien File Added: shell_tree_view_bug.zip
2014-04-28 17:53 Bart Broersma Note Added: 0074645
2014-04-28 17:53 Bart Broersma LazTarget => -
2014-04-28 17:53 Bart Broersma Status new => feedback
2014-04-28 20:13 Bart Broersma Fixed in Revision => r44839
2014-04-28 20:13 Bart Broersma Note Added: 0074646
2014-04-28 20:13 Bart Broersma Status feedback => resolved
2014-04-28 20:13 Bart Broersma Resolution open => fixed
2014-04-28 20:13 Bart Broersma Assigned To => Bart Broersma
2014-04-28 20:13 Bart Broersma Note Edited: 0074646 View Revisions
2014-05-14 18:15 Nguyen Tien Trung Kien Note Added: 0074998
2014-05-14 20:15 Bart Broersma Status resolved => assigned
2014-05-14 20:15 Bart Broersma Resolution fixed => reopened
2014-05-16 19:07 Bart Broersma Note Added: 0075029
2014-05-16 19:07 Bart Broersma Status assigned => feedback
2014-05-16 19:09 Bart Broersma File Added: project1.zip
2014-06-19 18:22 Bart Broersma Note Added: 0075796
2014-06-19 18:22 Bart Broersma Status feedback => resolved
2014-06-19 18:22 Bart Broersma Resolution reopened => fixed
2015-11-07 11:34 Alexander Koblov File Added: bug.txz
2015-11-07 11:36 Alexander Koblov Note Added: 0087177
2015-11-07 11:38 Alexander Koblov Note Edited: 0087177 View Revisions
2015-12-02 13:21 Bart Broersma Status resolved => assigned
2015-12-02 13:21 Bart Broersma Resolution fixed => reopened
2015-12-02 13:22 Bart Broersma Note Added: 0087746
2015-12-02 13:22 Bart Broersma Status assigned => feedback
2015-12-02 13:22 Bart Broersma Note Edited: 0087746 View Revisions
2015-12-02 19:28 Alexander Koblov Note Added: 0087762
2015-12-02 19:28 Alexander Koblov Note Edited: 0087762 View Revisions
2015-12-02 23:09 Bart Broersma Status feedback => assigned
2015-12-02 23:59 Bart Broersma Note Added: 0087765
2015-12-03 18:46 Bart Broersma Note Edited: 0087765 View Revisions
2015-12-05 17:45 Bart Broersma Fixed in Revision r44839 => r44839, r50648
2015-12-05 17:45 Bart Broersma LazTarget - => 1.6
2015-12-05 17:45 Bart Broersma Note Added: 0087803
2015-12-05 17:45 Bart Broersma Status assigned => resolved
2015-12-05 17:45 Bart Broersma Fixed in Version => 1.6
2015-12-05 17:45 Bart Broersma Resolution reopened => fixed
2015-12-05 17:45 Bart Broersma Target Version => 1.6
2015-12-09 05:24 Alexander Koblov Note Added: 0087850
2015-12-09 10:51 Bart Broersma Status resolved => closed