Skip to content

Commit cdd8616

Browse files
committed
re-open folders: check for exact path match before comparing inodes
1 parent 2ebfc93 commit cdd8616

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

code/FileTreeTable.cpp

+20-3
Original file line numberDiff line numberDiff line change
@@ -3341,15 +3341,32 @@ FileTreeTable::RestoreDirState
33413341
}
33423342

33433343
const JSize count = itsFileTreeList->GetItemCount(); // changes after Open()
3344+
3345+
bool found = false;
33443346
for (JIndex j=1; j<=count; j++)
33453347
{
3346-
const JString& n = (itsFileTreeList->GetDirEntry(j))->GetFullName();
3347-
if (JSameDirEntry(n, full))
3348+
const JString& n = itsFileTreeList->GetDirEntry(j)->GetFullName();
3349+
if (n == full)
33483350
{
33493351
itsFileTreeList->Open(j);
3352+
found = true;
33503353
break;
33513354
}
33523355
}
3356+
3357+
if (!found)
3358+
{
3359+
for (JIndex j=1; j<=count; j++)
3360+
{
3361+
const JString& n = itsFileTreeList->GetDirEntry(j)->GetFullName();
3362+
if (JSameDirEntry(n, full))
3363+
{
3364+
itsFileTreeList->Open(j);
3365+
found = true;
3366+
break;
3367+
}
3368+
}
3369+
}
33533370
}
33543371
}
33553372

@@ -3373,7 +3390,7 @@ FileTreeTable::SaveDirState
33733390
if (itsFileTreeList->IsOpen(i))
33743391
{
33753392
names.Append(JConvertToRelativePath(
3376-
(itsFileTreeList->GetDirEntry(i))->GetFullName(), basePath));
3393+
itsFileTreeList->GetDirEntry(i)->GetFullName(), basePath));
33773394
}
33783395
}
33793396

release/doc/ChangeLog.html

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ <h1>System G: Changes from previous versions</h1>
1313
<p>Please submit all suggestions and bugs via <a href="https://github.com/jafl/jx_application_framework/issues">github</a>.</p>
1414
<hr>
1515

16+
<h2>3.0.4</h2>
17+
18+
<ul>
19+
<li>Fixed edge case related to symlinks when restoring state of open sub-directories.</li>
20+
</ul>
21+
22+
1623
<h2>3.0.3</h2>
1724

1825
<ul>

systemg.jcc

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ F
210210
F
211211
# build settings
212212
1
213-
T
213+
F
214214
"systemg"
215215
"${LIB_DEPS}"
216216
"make -k all"

0 commit comments

Comments
 (0)