1
0
Fork 0
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:
David McKnight 2007-05-25 15:47:55 +00:00
parent 3ae44379d8
commit 14be9af209

View file

@ -2103,7 +2103,11 @@ public class SystemView extends SafeTreeViewer
if (!hasChildren) if (!hasChildren)
{ {
// make the src the parent of the src // make the src the parent of the src
src = adapter.getParent(src); Object srcParent = adapter.getParent(src);
if (srcParent != null)
{
src = srcParent;
}
} }
else else
{ {
@ -2126,13 +2130,15 @@ public class SystemView extends SafeTreeViewer
Object srcParent = adapter.getParent(src); // get parent before we query Object srcParent = adapter.getParent(src); // get parent before we query
// because if after query src doesn't exist, // because if after query src doesn't exist,
// we can't get parent // we can't get parent
if (srcParent != null)
src = ss.getObjectWithAbsoluteName(key); {
hasChildren = adapter.hasChildren((IAdaptable)src); src = ss.getObjectWithAbsoluteName(key);
if (!hasChildren) hasChildren = adapter.hasChildren((IAdaptable)src);
{ if (!hasChildren)
// make the src the parent of the src {
src = srcParent; // make the src the parent of the src
src = srcParent;
}
} }
} }
catch (Exception e) catch (Exception e)