+ _loadData: function loadData(name, store, type) {
+ try {
+ let file = storage.infoPath.child(name);
+ if (file.exists()) {
+ let data = file.read();
+ let result = JSON.parse(data);
+ if (result instanceof type)
+ return result;
+ }
+ }
+ catch (e) {
+ util.reportError(e);
+ }
+ },
+
+ _saveData: function saveData(obj) {
+ if (obj.privateData && storage.privateMode)
+ return;
+ if (obj.store && storage.infoPath)
+ storage.infoPath.child(obj.name).write(obj.serial);
+ },
+
+ storeForSession: function storeForSession(key, val) {
+ if (val)
+ this.session[key] = sessionGlobal.JSON.parse(JSON.stringify(val));
+ else
+ delete this.dactylSession[key];
+ },
+
+ infoPath: Class.Memoize(() =>
+ File(IO.runtimePath.replace(/,.*/, ""))
+ .child("info").child(config.profileName)),
+
+ exists: function exists(key) this.infoPath.child(key).exists(),
+
+ remove: function remove(key) {
+ if (this.exists(key)) {
+ if (this[key] && this[key].timer)
+ this[key].timer.flush();
+ delete this[key];
+ delete this.keys[key];
+ this.infoPath.child(key).remove(false);
+ }
+ },