зеркало из https://github.com/mozilla/gecko-dev.git
Use nsFileURL instead of nsFilePath to get file URL.
This commit is contained in:
Родитель
32e3e22a86
Коммит
68b5fd27ca
|
@ -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);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче