Rename Id to ID.

This commit is contained in:
Brent Simmons 2024-04-16 19:37:53 -07:00
parent 814097504c
commit dad6c1f884
8 changed files with 30 additions and 30 deletions

View File

@ -80,7 +80,7 @@
<cocoa key="scriptingName"/>
</property>
<property name="id" code="ID " type="text" access="r" description="The unique id of the account">
<cocoa key="uniqueId"/>
<cocoa key="uniqueID"/>
</property>
<property name="accountType" code="ATyp" type="account type" access="r" description="The type of the account">
<cocoa key="accountType"/>
@ -109,7 +109,7 @@
<cocoa key="name"/>
</property>
<property name="id" code="ID " type="text" access="r" description="The unique id of the feed">
<cocoa key="uniqueId"/>
<cocoa key="uniqueID"/>
</property>
<property name="url" code="URL " type="text" access="r" description="The type of the feed">
<cocoa key="url"/>
@ -140,7 +140,7 @@
<cocoa key="name"/>
</property>
<property name="id" code="ID " type="text" access="r" description="The unique id of the author">
<cocoa key="uniqueId"/>
<cocoa key="uniqueID"/>
</property>
<property name="url" code="URL " type="text" access="r" description="url for the author">
<cocoa key="url"/>
@ -160,7 +160,7 @@
<cocoa key="name"/>
</property>
<property name="id" code="ID " type="integer" access="r" description="The unique id of the account">
<cocoa key="uniqueId"/>
<cocoa key="uniqueID"/>
</property>
<property name="opml representation" code="OPML" type="text" access="r" description="OPML representation for the folder">
<cocoa key="opmlRepresentation"/>
@ -173,7 +173,7 @@
<class name="article" code="Arcl" plural="articles" description="An article in a feed">
<cocoa class="ScriptableArticle"/>
<property name="id" code="ID " type="text" access="r" description="The unique id of the article as set by the feed">
<cocoa key="uniqueId"/>
<cocoa key="uniqueID"/>
</property>
<property name="title" code="titl" type="text" access="r" description="The article title">
<cocoa key="title"/>

View File

@ -12,7 +12,7 @@ import Articles
import Core
@objc(ScriptableAccount)
@MainActor class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
@MainActor class ScriptableAccount: NSObject, UniqueIDScriptingObject, ScriptingObjectContainer {
let account:Account
init (_ account:Account) {
@ -52,12 +52,12 @@ import Core
return "accounts"
}
// MARK: --- UniqueIdScriptingObject protocol ---
// MARK: --- UniqueIDScriptingObject protocol ---
// I am not sure if account should prefer to be specified by name or by ID
// but in either case it seems like the accountID would be used as the keydata, so I chose ID
@objc(uniqueId)
var scriptingUniqueId:Any {
@objc(uniqueID)
var scriptingUniqueID:Any {
return account.accountID
}

View File

@ -11,7 +11,7 @@ import Account
import Articles
@objc(ScriptableArticle)
class ScriptableArticle: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
class ScriptableArticle: NSObject, UniqueIDScriptingObject, ScriptingObjectContainer {
let article:Article
let container:ScriptingObjectContainer
@ -33,13 +33,13 @@ class ScriptableArticle: NSObject, UniqueIdScriptingObject, ScriptingObjectConta
return "articles"
}
// MARK: --- UniqueIdScriptingObject protocol ---
// MARK: --- UniqueIDScriptingObject protocol ---
// articles have id in the NetNewsWire database and id in the feed
// article.uniqueID here is the feed unique id
@objc(uniqueId)
var scriptingUniqueId:Any {
@objc(uniqueID)
var scriptingUniqueID:Any {
return article.uniqueID
}

View File

@ -11,7 +11,7 @@ import Account
import Articles
@objc(ScriptableAuthor)
class ScriptableAuthor: NSObject, UniqueIdScriptingObject {
class ScriptableAuthor: NSObject, UniqueIDScriptingObject {
let author:Author
let container:ScriptingObjectContainer
@ -38,10 +38,10 @@ class ScriptableAuthor: NSObject, UniqueIdScriptingObject {
return "authors"
}
// MARK: --- UniqueIdScriptingObject protocol ---
// MARK: --- UniqueIDScriptingObject protocol ---
@objc(uniqueId)
var scriptingUniqueId:Any {
@objc(uniqueID)
var scriptingUniqueID:Any {
return author.authorID
}

View File

@ -12,7 +12,7 @@ import Account
import Articles
@objc(ScriptableFeed)
@objcMembers class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
@objcMembers class ScriptableFeed: NSObject, UniqueIDScriptingObject, ScriptingObjectContainer {
let feed:Feed
let container:ScriptingObjectContainer
@ -39,12 +39,12 @@ import Articles
return "feeds"
}
// MARK: --- UniqueIdScriptingObject protocol ---
// MARK: --- UniqueIDScriptingObject protocol ---
// I am not sure if account should prefer to be specified by name or by ID
// but in either case it seems like the accountID would be used as the keydata, so I chose ID
@objc(uniqueId)
@MainActor var scriptingUniqueId:Any {
@objc(uniqueID)
@MainActor var scriptingUniqueID:Any {
return feed.feedID
}

View File

@ -12,7 +12,7 @@ import Articles
import Core
@objc(ScriptableFolder)
@MainActor class ScriptableFolder: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
@MainActor class ScriptableFolder: NSObject, UniqueIDScriptingObject, ScriptingObjectContainer {
let folder:Folder
let container:ScriptingObjectContainer
@ -34,13 +34,13 @@ import Core
return "folders"
}
// MARK: --- UniqueIdScriptingObject protocol ---
// MARK: --- UniqueIDScriptingObject protocol ---
// I am not sure if account should prefer to be specified by name or by ID
// but in either case it seems like the accountID would be used as the keydata, so I chose ID
@objc(uniqueId)
var scriptingUniqueId:Any {
@objc(uniqueID)
var scriptingUniqueID:Any {
return folder.folderID
}

View File

@ -17,6 +17,6 @@ protocol NamedScriptingObject: ScriptingObject {
var name:String { get }
}
protocol UniqueIdScriptingObject: ScriptingObject {
var scriptingUniqueId:Any { get }
protocol UniqueIDScriptingObject: ScriptingObject {
var scriptingUniqueID:Any { get }
}

View File

@ -26,11 +26,11 @@ extension ScriptingObjectContainer {
return specifier
}
func makeFormUniqueIDScriptObjectSpecifier(forObject object:UniqueIdScriptingObject) -> NSScriptObjectSpecifier? {
func makeFormUniqueIDScriptObjectSpecifier(forObject object:UniqueIDScriptingObject) -> NSScriptObjectSpecifier? {
let containerClassDescription = self.scriptingClassDescription
let containerScriptObjectSpecifier = self.objectSpecifier
let scriptingKey = object.scriptingKey
let uniqueID = object.scriptingUniqueId
let uniqueID = object.scriptingUniqueID
let specifier = NSUniqueIDSpecifier(containerClassDescription:containerClassDescription,
containerSpecifier:containerScriptObjectSpecifier, key:scriptingKey, uniqueID: uniqueID)
return specifier