mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Rename occurrences of completionHandler to completion.
This commit is contained in:
@@ -31,8 +31,8 @@ public struct SyncDatabase {
|
||||
|
||||
// MARK: - API
|
||||
|
||||
public func insertStatuses(_ statuses: [SyncStatus], completionHandler: VoidCompletionBlock? = nil) {
|
||||
syncStatusTable.insertStatuses(statuses, completionHandler: completionHandler)
|
||||
public func insertStatuses(_ statuses: [SyncStatus], completion: VoidCompletionBlock? = nil) {
|
||||
syncStatusTable.insertStatuses(statuses, completion: completion)
|
||||
}
|
||||
|
||||
public func selectForProcessing() -> [SyncStatus] {
|
||||
@@ -43,12 +43,12 @@ public struct SyncDatabase {
|
||||
return syncStatusTable.selectPendingCount()
|
||||
}
|
||||
|
||||
public func resetSelectedForProcessing(_ articleIDs: [String], completionHandler: VoidCompletionBlock? = nil) {
|
||||
syncStatusTable.resetSelectedForProcessing(articleIDs, completionHandler: completionHandler)
|
||||
public func resetSelectedForProcessing(_ articleIDs: [String], completion: VoidCompletionBlock? = nil) {
|
||||
syncStatusTable.resetSelectedForProcessing(articleIDs, completion: completion)
|
||||
}
|
||||
|
||||
public func deleteSelectedForProcessing(_ articleIDs: [String], completionHandler: VoidCompletionBlock? = nil) {
|
||||
syncStatusTable.deleteSelectedForProcessing(articleIDs, completionHandler: completionHandler)
|
||||
public func deleteSelectedForProcessing(_ articleIDs: [String], completion: VoidCompletionBlock? = nil) {
|
||||
syncStatusTable.deleteSelectedForProcessing(articleIDs, completion: completion)
|
||||
}
|
||||
|
||||
// MARK: - Suspend and Resume (for iOS)
|
||||
|
||||
@@ -57,10 +57,10 @@ struct SyncStatusTable: DatabaseTable {
|
||||
return count
|
||||
}
|
||||
|
||||
func resetSelectedForProcessing(_ articleIDs: [String], completionHandler: VoidCompletionBlock? = nil) {
|
||||
func resetSelectedForProcessing(_ articleIDs: [String], completion: VoidCompletionBlock? = nil) {
|
||||
guard !queue.isSuspended else {
|
||||
if let handler = completionHandler {
|
||||
callVoidCompletionBlock(handler)
|
||||
if let completion = completion {
|
||||
callVoidCompletionBlock(completion)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -69,16 +69,16 @@ struct SyncStatusTable: DatabaseTable {
|
||||
let placeholders = NSString.rs_SQLValueList(withPlaceholders: UInt(articleIDs.count))!
|
||||
let updateSQL = "update syncStatus set selected = false where articleID in \(placeholders)"
|
||||
database.executeUpdate(updateSQL, withArgumentsIn: parameters)
|
||||
if let handler = completionHandler {
|
||||
callVoidCompletionBlock(handler)
|
||||
if let completion = completion {
|
||||
callVoidCompletionBlock(completion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func deleteSelectedForProcessing(_ articleIDs: [String], completionHandler: VoidCompletionBlock? = nil) {
|
||||
func deleteSelectedForProcessing(_ articleIDs: [String], completion: VoidCompletionBlock? = nil) {
|
||||
guard !queue.isSuspended else {
|
||||
if let handler = completionHandler {
|
||||
callVoidCompletionBlock(handler)
|
||||
if let completion = completion {
|
||||
callVoidCompletionBlock(completion)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -87,24 +87,24 @@ struct SyncStatusTable: DatabaseTable {
|
||||
let placeholders = NSString.rs_SQLValueList(withPlaceholders: UInt(articleIDs.count))!
|
||||
let deleteSQL = "delete from syncStatus where articleID in \(placeholders)"
|
||||
database.executeUpdate(deleteSQL, withArgumentsIn: parameters)
|
||||
if let handler = completionHandler {
|
||||
callVoidCompletionBlock(handler)
|
||||
if let completion = completion {
|
||||
callVoidCompletionBlock(completion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func insertStatuses(_ statuses: [SyncStatus], completionHandler: VoidCompletionBlock? = nil) {
|
||||
func insertStatuses(_ statuses: [SyncStatus], completion: VoidCompletionBlock? = nil) {
|
||||
guard !queue.isSuspended else {
|
||||
if let handler = completionHandler {
|
||||
callVoidCompletionBlock(handler)
|
||||
if let completion = completion {
|
||||
callVoidCompletionBlock(completion)
|
||||
}
|
||||
return
|
||||
}
|
||||
queue.runInTransaction { database in
|
||||
let statusArray = statuses.map { $0.databaseDictionary() }
|
||||
self.insertRows(statusArray, insertType: .orReplace, in: database)
|
||||
if let handler = completionHandler {
|
||||
callVoidCompletionBlock(handler)
|
||||
if let completion = completion {
|
||||
callVoidCompletionBlock(completion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user