Use nsFileURL instead of nsFilePath to get file URL.

This commit is contained in:
rjc%netscape.com 1999-03-13 09:25:46 +00:00
Родитель 32e3e22a86
Коммит 68b5fd27ca
1 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -869,21 +869,23 @@ GetFolderList(nsIRDFResource *source, nsVoidArray **array /* out */)
{
const nsNativeFileSpec nativeSpec = (const nsNativeFileSpec &)i;
if (!isVisible(nativeSpec)) continue;
nsFilePath filePath(nativeSpec);
char *childURL = filePath;
nsFileURL fileURL(nativeSpec);
const char *childURL = fileURL.GetAsString();
if (childURL != nsnull)
{
nsAutoString pathname("file://");
pathname += childURL;
nsAutoString pathname(childURL);
if (nativeSpec.IsDirectory())
{
pathname += "/";
}
char *filename = pathname.ToNewCString();
nsIRDFResource *file;
gRDFService->GetResource(filename, (nsIRDFResource **)&file);
nameArray->AppendElement(file);
delete filename;
if (filename)
{
nsIRDFResource *file;
gRDFService->GetResource(filename, (nsIRDFResource **)&file);
nameArray->AppendElement(file);
delete []filename;
}
}
}
return(NS_OK);