mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 854299 - Part 5. Make nsHelperAppDlg.promptForSaveToFileAsync actually async. r=bz
This commit is contained in:
parent
27cdff0dfc
commit
94fd7555bf
@ -279,14 +279,9 @@ nsUnknownContentTypeDialog.prototype = {
|
||||
.getService(Components.interfaces.nsIDownloadManager);
|
||||
picker.displayDirectory = dnldMgr.userDownloadsDirectory;
|
||||
|
||||
// The last directory preference may not exist, which will throw.
|
||||
try {
|
||||
var lastDir = gDownloadLastDir.getFile(aLauncher.source);
|
||||
if (isUsableDirectory(lastDir))
|
||||
gDownloadLastDir.getFileAsync(aLauncher.source, function LastDirCallback(lastDir) {
|
||||
if (lastDir && isUsableDirectory(lastDir))
|
||||
picker.displayDirectory = lastDir;
|
||||
}
|
||||
catch (ex) {
|
||||
}
|
||||
|
||||
if (picker.show() == nsIFilePicker.returnCancel) {
|
||||
// null result means user cancelled.
|
||||
@ -316,7 +311,7 @@ nsUnknownContentTypeDialog.prototype = {
|
||||
result = this.validateLeafName(newDir, result.leafName, null);
|
||||
}
|
||||
aLauncher.saveDestinationAvailable(result);
|
||||
return;
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user