From 6282f3a4dd2c61da9667e434202614030684def5 Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Sun, 21 Jan 2001 23:21:11 +0000 Subject: [PATCH] If folders have META:title attribute, then use it as the name of the folder. NetPositive feature matching. Thanks to Takashi Toyoshima for the patch. Bug #65185. r=cls --- rdf/datasource/src/nsFileSystemDataSource.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rdf/datasource/src/nsFileSystemDataSource.cpp b/rdf/datasource/src/nsFileSystemDataSource.cpp index fc4168cc3363..4143768f1722 100644 --- a/rdf/datasource/src/nsFileSystemDataSource.cpp +++ b/rdf/datasource/src/nsFileSystemDataSource.cpp @@ -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