mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
in refresh remote, only change to use parent of a leaf if the parent exists
This commit is contained in:
parent
3ae44379d8
commit
14be9af209
1 changed files with 14 additions and 8 deletions
|
@ -2103,7 +2103,11 @@ public class SystemView extends SafeTreeViewer
|
|||
if (!hasChildren)
|
||||
{
|
||||
// make the src the parent of the src
|
||||
src = adapter.getParent(src);
|
||||
Object srcParent = adapter.getParent(src);
|
||||
if (srcParent != null)
|
||||
{
|
||||
src = srcParent;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2126,13 +2130,15 @@ public class SystemView extends SafeTreeViewer
|
|||
Object srcParent = adapter.getParent(src); // get parent before we query
|
||||
// because if after query src doesn't exist,
|
||||
// we can't get parent
|
||||
|
||||
src = ss.getObjectWithAbsoluteName(key);
|
||||
hasChildren = adapter.hasChildren((IAdaptable)src);
|
||||
if (!hasChildren)
|
||||
if (srcParent != null)
|
||||
{
|
||||
// make the src the parent of the src
|
||||
src = srcParent;
|
||||
src = ss.getObjectWithAbsoluteName(key);
|
||||
hasChildren = adapter.hasChildren((IAdaptable)src);
|
||||
if (!hasChildren)
|
||||
{
|
||||
// make the src the parent of the src
|
||||
src = srcParent;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Add table
Reference in a new issue