1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-05 16:15:25 +02:00

[148978] fix so that empty folders show as having been queried on linux clients

This commit is contained in:
David McKnight 2006-11-27 16:09:37 +00:00
parent 5deeba081e
commit 94e0ef912d
2 changed files with 17 additions and 2 deletions

View file

@ -45,6 +45,7 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemMessageObject;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.ISystemResourceSet;
import org.eclipse.rse.core.model.SystemChildrenContentsType;
import org.eclipse.rse.core.model.SystemMessageObject;
import org.eclipse.rse.core.model.SystemWorkspaceResourceSet;
import org.eclipse.rse.core.subsystems.ISubSystem;
@ -522,6 +523,11 @@ public class SystemViewRemoteFileAdapter
{
AbstractTreeViewer atv = (AbstractTreeViewer) getViewer();
isOpen = atv.getExpandedState(element);
if (!isOpen)
{
if (!hasChildren(element))
isOpen = true;
}
}
if (file.isRoot())
return RSEUIPlugin.getDefault().getImageDescriptor(isOpen ? ISystemIconConstants.ICON_SYSTEM_ROOTDRIVEOPEN_ID : ISystemIconConstants.ICON_SYSTEM_ROOTDRIVE_ID);
@ -784,6 +790,13 @@ public class SystemViewRemoteFileAdapter
hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance());
}
}
else
{
// check that the children are actually there
Object[] contents = file.getContents(RemoteChildrenContentsType.getInstance());
if (!file.isStale() && contents != null && contents.length == 0 )
hasChildren = false;
}
return hasChildren;
}

View file

@ -860,8 +860,10 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
if (filter == null) {
filter = "*"; //$NON-NLS-1$
}
if (con != null && con.length > 0)
// DKM - consider all containers so that we can tell if an empty one
// has been queried before (i.e. via IRemoteFile[0] as it's contents vs null)
// if (con != null && con.length > 0)
{
isContainer = true;
}