Make chooseDirectory return a file URL string, like chooseFile does.

This commit is contained in:
sfraser%netscape.com 1999-08-24 01:01:38 +00:00
Родитель a08cd467b9
Коммит 93c5e37bce
2 изменённых файлов: 9 добавлений и 4 удалений

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

@ -68,8 +68,8 @@ interface nsIFileSpecWithUI : nsIFileSpec
, in string extraFilterTitle
, in string extraFilter
);
string chooseFile(in string title);
void chooseDirectory(in string title);
string chooseFile(in string title);
string chooseDirectory(in string title);
};
%{C++

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

@ -165,7 +165,7 @@ Clean:
} // nsFileSpecWithUIImpl::chooseInputFile
//----------------------------------------------------------------------------------------
NS_IMETHODIMP nsFileSpecWithUIImpl::chooseDirectory(const char *title)
NS_IMETHODIMP nsFileSpecWithUIImpl::chooseDirectory(const char *title, char **_retval)
//----------------------------------------------------------------------------------------
{
if (!mBaseFileSpec)
@ -181,6 +181,11 @@ NS_IMETHODIMP nsFileSpecWithUIImpl::chooseDirectory(const char *title)
nsFileSpec spec;
if (fileWidget->GetFolder(nsnull, title, spec) != nsFileDlgResults_OK)
rv = NS_FILE_FAILURE;
return mBaseFileSpec->setFromFileSpec(spec);
rv = mBaseFileSpec->setFromFileSpec(spec);
if (NS_FAILED(rv))
return rv;
return GetURLString(_retval);
} // nsFileSpecWithUIImpl::chooseDirectory