From 9eacd2b25aff2aa47df439d51c77234395659def Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Wed, 20 Mar 2019 19:33:59 -0400 Subject: [PATCH] Rename delegate methods to better reflect purpose --- Persephone/Controllers/NotificationsController.swift | 4 ++-- Persephone/MPDClient/Extensions/MPDClient+Idle.swift | 4 ++-- Persephone/MPDClient/Protocols/Delegate.swift | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Persephone/Controllers/NotificationsController.swift b/Persephone/Controllers/NotificationsController.swift index a2fea50..555712f 100644 --- a/Persephone/Controllers/NotificationsController.swift +++ b/Persephone/Controllers/NotificationsController.swift @@ -36,11 +36,11 @@ class NotificationsController: MPDClientDelegate { ) } - func willUpdateDatabase(mpdClient: MPDClient) { + func willStartDatabaseUpdate(mpdClient: MPDClient) { sendNotification(name: Notification.databaseUpdateStarted) } - func didUpdateDatabase(mpdClient: MPDClient) { + func didFinishDatabaseUpdate(mpdClient: MPDClient) { sendNotification(name: Notification.databaseUpdateFinished) } diff --git a/Persephone/MPDClient/Extensions/MPDClient+Idle.swift b/Persephone/MPDClient/Extensions/MPDClient+Idle.swift index 003dd48..68de625 100644 --- a/Persephone/MPDClient/Extensions/MPDClient+Idle.swift +++ b/Persephone/MPDClient/Extensions/MPDClient+Idle.swift @@ -52,9 +52,9 @@ extension MPDClient { self.fetchStatus() if self.status?.updating ?? false { - self.delegate?.willUpdateDatabase(mpdClient: self) + self.delegate?.willStartDatabaseUpdate(mpdClient: self) } else { - self.delegate?.didUpdateDatabase(mpdClient: self) + self.delegate?.didFinishDatabaseUpdate(mpdClient: self) } } if !mpdIdle.isEmpty { diff --git a/Persephone/MPDClient/Protocols/Delegate.swift b/Persephone/MPDClient/Protocols/Delegate.swift index 67e24ce..90282c5 100644 --- a/Persephone/MPDClient/Protocols/Delegate.swift +++ b/Persephone/MPDClient/Protocols/Delegate.swift @@ -15,8 +15,8 @@ protocol MPDClientDelegate { func didUpdateState(mpdClient: MPDClient, state: MPDClient.Status.State) func didUpdateTime(mpdClient: MPDClient, total: UInt, elapsedMs: UInt) - func willUpdateDatabase(mpdClient: MPDClient) - func didUpdateDatabase(mpdClient: MPDClient) + func willStartDatabaseUpdate(mpdClient: MPDClient) + func didFinishDatabaseUpdate(mpdClient: MPDClient) func didUpdateQueue(mpdClient: MPDClient, queue: [MPDClient.Song]) func didUpdateQueuePos(mpdClient: MPDClient, song: Int)