If folders have META:title attribute, then use it as the name of the folder. NetPositive feature matching.

Thanks to Takashi Toyoshima <toyoshim@be-in.org> for the patch.
Bug #65185. r=cls
This commit is contained in:
cls%seawood.org 2001-01-21 23:21:11 +00:00
parent 459b9e06dc
commit 6282f3a4dd

View File

@ -1475,9 +1475,10 @@ FileSystemDataSource::GetName(nsIRDFResource *source, nsIRDFLiteral **aResult)
nsFilePath path(url);
nsFileSpec spec(path);
// if (spec.IsFile() && (!spec.IsHidden()))
if (spec.IsFile())
if (spec.IsFile() || spec.IsDirectory())
{
const char *nativeURI = spec.GetNativePathCString();
rv = NS_ERROR_FAILURE;
if (nativeURI)
{
BFile bf(nativeURI, B_READ_ONLY);
@ -1491,13 +1492,15 @@ FileSystemDataSource::GetName(nsIRDFResource *source, nsIRDFLiteral **aResult)
{
beNameAttr[len] = '\0';
name = NS_ConvertUTF8toUCS2(beNameAttr);
rv = NS_OK;
}
}
}
}
else if (spec.IsDirectory())
{
name = NS_ConvertUTF8toUCS2(spec.GetLeafName());
if (NS_OK != rv)
{
name = NS_ConvertUTF8toUCS2(spec.GetLeafName());
rv = NS_OK;
}
}
}
#endif