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; const nsNativeFileSpec nativeSpec = (const nsNativeFileSpec &)i;
if (!isVisible(nativeSpec)) continue; if (!isVisible(nativeSpec)) continue;
nsFilePath filePath(nativeSpec); nsFileURL fileURL(nativeSpec);
char *childURL = filePath; const char *childURL = fileURL.GetAsString();
if (childURL != nsnull) if (childURL != nsnull)
{ {
nsAutoString pathname("file://"); nsAutoString pathname(childURL);
pathname += childURL;
if (nativeSpec.IsDirectory()) if (nativeSpec.IsDirectory())
{ {
pathname += "/"; pathname += "/";
} }
char *filename = pathname.ToNewCString(); char *filename = pathname.ToNewCString();
nsIRDFResource *file; if (filename)
gRDFService->GetResource(filename, (nsIRDFResource **)&file); {
nameArray->AppendElement(file); nsIRDFResource *file;
delete filename; gRDFService->GetResource(filename, (nsIRDFResource **)&file);
nameArray->AppendElement(file);
delete []filename;
}
} }
} }
return(NS_OK); return(NS_OK);