From e45aabd03cf216922db91bca2594a1a6ce79f3a1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 16 Jun 2015 20:33:18 -0400 Subject: [PATCH] Special handling of objects class for SyncedSettings (Though maybe it should just be renamed Zotero.Settings, since non-synced settings aren't used much and are just handled via DB queries.) --- chrome/content/zotero/xpcom/data/dataObjectUtilities.js | 2 ++ chrome/content/zotero/xpcom/syncedSettings.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/dataObjectUtilities.js b/chrome/content/zotero/xpcom/data/dataObjectUtilities.js index d7bb3b305..9d2722dec 100644 --- a/chrome/content/zotero/xpcom/data/dataObjectUtilities.js +++ b/chrome/content/zotero/xpcom/data/dataObjectUtilities.js @@ -69,6 +69,8 @@ Zotero.DataObjectUtilities = { "getObjectsClassForObjectType": function(objectType) { + if (objectType == 'setting') objectType = 'syncedSetting'; + var objectTypePlural = this.getObjectTypePlural(objectType); var className = objectTypePlural[0].toUpperCase() + objectTypePlural.substr(1); return Zotero[className] diff --git a/chrome/content/zotero/xpcom/syncedSettings.js b/chrome/content/zotero/xpcom/syncedSettings.js index fcb638387..02d1b088c 100644 --- a/chrome/content/zotero/xpcom/syncedSettings.js +++ b/chrome/content/zotero/xpcom/syncedSettings.js @@ -31,6 +31,9 @@ Zotero.SyncedSettings = (function () { // Public methods // var module = { + idColumn: "setting", + table: "syncedSettings", + get: Zotero.Promise.coroutine(function* (libraryID, setting) { var sql = "SELECT value FROM syncedSettings WHERE setting=? AND libraryID=?"; var json = yield Zotero.DB.valueQueryAsync(sql, [setting, libraryID]);