mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 521264 - Don't use file.exists() when not necessary - browser/base part; r=dietrich
This commit is contained in:
parent
94bbb956a8
commit
f04bd3c6d8
@ -2213,8 +2213,12 @@ var gLastOpenDirectory = {
|
||||
return this._lastDir;
|
||||
},
|
||||
set path(val) {
|
||||
if (!val || !val.exists() || !val.isDirectory())
|
||||
try {
|
||||
if (!val || !val.isDirectory())
|
||||
return;
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
this._lastDir = val.clone();
|
||||
|
||||
// Don't save the last open directory pref inside the Private Browsing mode
|
||||
@ -2239,8 +2243,11 @@ function BrowserOpenFileWindow()
|
||||
fp.displayDirectory = gLastOpenDirectory.path;
|
||||
|
||||
if (fp.show() == nsIFilePicker.returnOK) {
|
||||
if (fp.file && fp.file.exists())
|
||||
gLastOpenDirectory.path = fp.file.parent.QueryInterface(Ci.nsILocalFile);
|
||||
try {
|
||||
if (fp.file)
|
||||
gLastOpenDirectory.path = fp.file.parent.QueryInterface(Ci.nsILocalFile);
|
||||
} catch(e) {
|
||||
}
|
||||
openTopWin(fp.fileURL.spec);
|
||||
}
|
||||
} catch (ex) {
|
||||
|
@ -75,8 +75,11 @@ function deleteLocalstore() {
|
||||
var directoryService = Components.classes[nsIDirectoryServiceContractID]
|
||||
.getService(nsIProperties);
|
||||
var localstoreFile = directoryService.get("LStoreS", Components.interfaces.nsIFile);
|
||||
if (localstoreFile.exists())
|
||||
try {
|
||||
localstoreFile.remove(false);
|
||||
} catch(e) {
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
function disableAddons() {
|
||||
|
Loading…
Reference in New Issue
Block a user