mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 827237 - Wifi: ap list in settings is empty. r=bent
This commit is contained in:
parent
aaec3a9556
commit
25cb6654aa
@ -111,6 +111,11 @@ SettingsLock.prototype = {
|
||||
}
|
||||
};
|
||||
}
|
||||
checkKeyRequest.onerror = function(event) {
|
||||
if (!request.error) {
|
||||
Services.DOMRequest.fireError(request, checkKeyRequest.error.name)
|
||||
}
|
||||
};
|
||||
}
|
||||
break;
|
||||
case "get":
|
||||
|
@ -55,10 +55,21 @@ SettingsServiceLock.prototype = {
|
||||
let message = info.message;
|
||||
if(typeof(value) == 'object')
|
||||
debug("object name:" + name + ", val: " + JSON.stringify(value));
|
||||
req = store.put({ settingName: name, settingValue: value });
|
||||
let checkKeyRequest = store.get(name);
|
||||
|
||||
checkKeyRequest.onsuccess = function (event) {
|
||||
let defaultValue;
|
||||
if (event.target.result) {
|
||||
defaultValue = event.target.result.defaultValue;
|
||||
} else {
|
||||
defaultValue = null;
|
||||
if (DEBUG) debug("MOZSETTINGS-SET-WARNING: " + key + " is not in the database.\n");
|
||||
}
|
||||
|
||||
req = store.put({ settingName: name, defaultValue: defaultValue, userValue: value });
|
||||
|
||||
req.onsuccess = function() {
|
||||
debug("set on success");
|
||||
if (DEBUG) debug("set on success");
|
||||
lock._open = true;
|
||||
if (callback)
|
||||
callback.handle(name, value);
|
||||
@ -71,6 +82,9 @@ SettingsServiceLock.prototype = {
|
||||
};
|
||||
|
||||
req.onerror = function(event) { callback ? callback.handleError(event.target.errorMessage) : null; };
|
||||
}
|
||||
|
||||
checkKeyRequest.onerror = function(event) { callback ? callback.handleError(event.target.errorMessage) : null; };
|
||||
break;
|
||||
case "get":
|
||||
req = store.mozGetAll(name);
|
||||
@ -83,7 +97,11 @@ SettingsServiceLock.prototype = {
|
||||
if (event.target.result.length > 1) {
|
||||
debug("Warning: overloaded setting:" + name);
|
||||
}
|
||||
callback.handle(name, event.target.result[0].settingValue);
|
||||
let result = event.target.result[0];
|
||||
let value = result.userValue !== undefined
|
||||
? result.userValue
|
||||
: result.defaultValue;
|
||||
callback.handle(name, value);
|
||||
} else
|
||||
callback.handle(name, null);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user