From a7d4c4912dc0797d11dad6e7a7b9c5809620dcd4 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 27 Jan 2025 22:40:31 -0800 Subject: [PATCH] Rename AppImage.accountImage to the less redundant AppImage.account. --- .../Accounts/AccountsReaderAPIWindowController.swift | 8 ++++---- Shared/AppImage.swift | 2 +- Shared/Extensions/SmallIconProvider.swift | 2 +- iOS/Account/CloudKitAccountViewController.swift | 2 +- iOS/Account/FeedbinAccountViewController.swift | 2 +- iOS/Account/LocalAccountViewController.swift | 2 +- iOS/Account/NewsBlurAccountViewController.swift | 2 +- iOS/Account/ReaderAPIAccountViewController.swift | 8 ++++---- iOS/Inspector/AccountInspectorViewController.swift | 2 +- iOS/Settings/AddAccountViewController.swift | 8 ++++---- iOS/Settings/SettingsViewController.swift | 2 +- iOS/ShareExtension/ShareFolderPickerController.swift | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift b/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift index 101b6b831..3fc7365a4 100644 --- a/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift +++ b/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift @@ -39,23 +39,23 @@ final class AccountsReaderAPIWindowController: NSWindowController { if let accountType = accountType { switch accountType { case .freshRSS: - titleImageView.image = AppImage.accountImage(.freshRSS) + titleImageView.image = AppImage.account(.freshRSS) titleLabel.stringValue = NSLocalizedString("Sign in to your FreshRSS account.", comment: "FreshRSS") noAccountTextField.stringValue = NSLocalizedString("Don’t have a FreshRSS instance?", comment: "No FreshRSS") createAccountButton.title = NSLocalizedString("Find out more", comment: "No FreshRSS Button") apiURLTextField.placeholderString = NSLocalizedString("fresh.rss.net/api/greader.php", comment: "FreshRSS API Helper") case .inoreader: - titleImageView.image = AppImage.accountImage(.inoreader) + titleImageView.image = AppImage.account(.inoreader) titleLabel.stringValue = NSLocalizedString("Sign in to your InoReader account.", comment: "InoReader") gridView.row(at: 2).isHidden = true noAccountTextField.stringValue = NSLocalizedString("Don’t have an InoReader account?", comment: "No InoReader") case .bazQux: - titleImageView.image = AppImage.accountImage(.bazQux) + titleImageView.image = AppImage.account(.bazQux) titleLabel.stringValue = NSLocalizedString("Sign in to your BazQux account.", comment: "BazQux") gridView.row(at: 2).isHidden = true noAccountTextField.stringValue = NSLocalizedString("Don’t have a BazQux account?", comment: "No BazQux") case .theOldReader: - titleImageView.image = AppImage.accountImage(.theOldReader) + titleImageView.image = AppImage.account(.theOldReader) titleLabel.stringValue = NSLocalizedString("Sign in to your The Old Reader account.", comment: "The Old Reader") gridView.row(at: 2).isHidden = true noAccountTextField.stringValue = NSLocalizedString("Don’t have a The Old Reader account?", comment: "No OldReader") diff --git a/Shared/AppImage.swift b/Shared/AppImage.swift index 9b0654186..c2733be9c 100644 --- a/Shared/AppImage.swift +++ b/Shared/AppImage.swift @@ -18,7 +18,7 @@ struct AppImage { // MARK: - Account - static func accountImage(_ accountType: AccountType) -> RSImage? { + static func account(_ accountType: AccountType) -> RSImage? { switch accountType { case .onMyMac: AppImage.accountLocal diff --git a/Shared/Extensions/SmallIconProvider.swift b/Shared/Extensions/SmallIconProvider.swift index 42a07d3f7..c0c7dc7e9 100644 --- a/Shared/Extensions/SmallIconProvider.swift +++ b/Shared/Extensions/SmallIconProvider.swift @@ -18,7 +18,7 @@ protocol SmallIconProvider { extension Account: SmallIconProvider { var smallIcon: IconImage? { - if let image = AppImage.accountImage(type) { + if let image = AppImage.account(type) { return IconImage(image) } return nil diff --git a/iOS/Account/CloudKitAccountViewController.swift b/iOS/Account/CloudKitAccountViewController.swift index 08b1aedf1..36e7cbdcc 100644 --- a/iOS/Account/CloudKitAccountViewController.swift +++ b/iOS/Account/CloudKitAccountViewController.swift @@ -57,7 +57,7 @@ final class CloudKitAccountViewController: UITableViewController { override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { if section == 0 { let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView - headerView.imageView.image = AppImage.accountImage(.cloudKit) + headerView.imageView.image = AppImage.account(.cloudKit) return headerView } else { return super.tableView(tableView, viewForHeaderInSection: section) diff --git a/iOS/Account/FeedbinAccountViewController.swift b/iOS/Account/FeedbinAccountViewController.swift index 7ddb9050c..1a057d208 100644 --- a/iOS/Account/FeedbinAccountViewController.swift +++ b/iOS/Account/FeedbinAccountViewController.swift @@ -59,7 +59,7 @@ final class FeedbinAccountViewController: UITableViewController { override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { if section == 0 { let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView - headerView.imageView.image = AppImage.accountImage(.feedbin) + headerView.imageView.image = AppImage.account(.feedbin) return headerView } else { return super.tableView(tableView, viewForHeaderInSection: section) diff --git a/iOS/Account/LocalAccountViewController.swift b/iOS/Account/LocalAccountViewController.swift index 29fd1e74e..47b910ce4 100644 --- a/iOS/Account/LocalAccountViewController.swift +++ b/iOS/Account/LocalAccountViewController.swift @@ -46,7 +46,7 @@ final class LocalAccountViewController: UITableViewController { override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { if section == 0 { let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView - headerView.imageView.image = AppImage.accountImage(.onMyMac) + headerView.imageView.image = AppImage.account(.onMyMac) return headerView } else { return super.tableView(tableView, viewForHeaderInSection: section) diff --git a/iOS/Account/NewsBlurAccountViewController.swift b/iOS/Account/NewsBlurAccountViewController.swift index f3972f776..be819d690 100644 --- a/iOS/Account/NewsBlurAccountViewController.swift +++ b/iOS/Account/NewsBlurAccountViewController.swift @@ -58,7 +58,7 @@ final class NewsBlurAccountViewController: UITableViewController { override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { if section == 0 { let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView - headerView.imageView.image = AppImage.accountImage(.newsBlur) + headerView.imageView.image = AppImage.account(.newsBlur) return headerView } else { return super.tableView(tableView, viewForHeaderInSection: section) diff --git a/iOS/Account/ReaderAPIAccountViewController.swift b/iOS/Account/ReaderAPIAccountViewController.swift index 4329f1ed9..1c00b1771 100644 --- a/iOS/Account/ReaderAPIAccountViewController.swift +++ b/iOS/Account/ReaderAPIAccountViewController.swift @@ -210,13 +210,13 @@ final class ReaderAPIAccountViewController: UITableViewController { if let accountType = accountType { switch accountType { case .bazQux: - return AppImage.accountImage(.bazQux) + return AppImage.account(.bazQux) case .inoreader: - return AppImage.accountImage(.inoreader) + return AppImage.account(.inoreader) case .theOldReader: - return AppImage.accountImage(.theOldReader) + return AppImage.account(.theOldReader) case .freshRSS: - return AppImage.accountImage(.freshRSS) + return AppImage.account(.freshRSS) default: return nil } diff --git a/iOS/Inspector/AccountInspectorViewController.swift b/iOS/Inspector/AccountInspectorViewController.swift index 88f5f9a9d..9f072ae3e 100644 --- a/iOS/Inspector/AccountInspectorViewController.swift +++ b/iOS/Inspector/AccountInspectorViewController.swift @@ -169,7 +169,7 @@ extension AccountInspectorViewController { if section == 0 { let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView - headerView.imageView.image = AppImage.accountImage(account.type) + headerView.imageView.image = AppImage.account(account.type) return headerView } else { return super.tableView(tableView, viewForHeaderInSection: section) diff --git a/iOS/Settings/AddAccountViewController.swift b/iOS/Settings/AddAccountViewController.swift index 8b080d201..d7181af06 100644 --- a/iOS/Settings/AddAccountViewController.swift +++ b/iOS/Settings/AddAccountViewController.swift @@ -127,17 +127,17 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe switch indexPath.section { case AddAccountSections.local.rawValue: cell.comboNameLabel?.text = AddAccountSections.local.sectionContent[indexPath.row].localizedAccountName() - cell.comboImage?.image = AppImage.accountImage(.onMyMac) + cell.comboImage?.image = AppImage.account(.onMyMac) case AddAccountSections.icloud.rawValue: cell.comboNameLabel?.text = AddAccountSections.icloud.sectionContent[indexPath.row].localizedAccountName() - cell.comboImage?.image = AppImage.accountImage(AddAccountSections.icloud.sectionContent[indexPath.row]) + cell.comboImage?.image = AppImage.account(AddAccountSections.icloud.sectionContent[indexPath.row]) if AppDefaults.isDeveloperBuild || AccountManager.shared.accounts.contains(where: { $0.type == .cloudKit }) { cell.isUserInteractionEnabled = false cell.comboNameLabel?.isEnabled = false } case AddAccountSections.web.rawValue: cell.comboNameLabel?.text = AddAccountSections.web.sectionContent[indexPath.row].localizedAccountName() - cell.comboImage?.image = AppImage.accountImage(AddAccountSections.web.sectionContent[indexPath.row]) + cell.comboImage?.image = AppImage.account(AddAccountSections.web.sectionContent[indexPath.row]) let type = AddAccountSections.web.sectionContent[indexPath.row] if (type == .feedly || type == .inoreader) && AppDefaults.isDeveloperBuild { cell.isUserInteractionEnabled = false @@ -145,7 +145,7 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe } case AddAccountSections.selfhosted.rawValue: cell.comboNameLabel?.text = AddAccountSections.selfhosted.sectionContent[indexPath.row].localizedAccountName() - cell.comboImage?.image = AppImage.accountImage(AddAccountSections.selfhosted.sectionContent[indexPath.row]) + cell.comboImage?.image = AppImage.account(AddAccountSections.selfhosted.sectionContent[indexPath.row]) default: return cell diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index 423edbe8b..313c2c847 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -121,7 +121,7 @@ final class SettingsViewController: UITableViewController { let acctCell = tableView.dequeueReusableCell(withIdentifier: "SettingsComboTableViewCell", for: indexPath) as! SettingsComboTableViewCell acctCell.applyThemeProperties() let account = sortedAccounts[indexPath.row] - acctCell.comboImage?.image = AppImage.accountImage(account.type) + acctCell.comboImage?.image = AppImage.account(account.type) acctCell.comboNameLabel?.text = account.nameForDisplay cell = acctCell } diff --git a/iOS/ShareExtension/ShareFolderPickerController.swift b/iOS/ShareExtension/ShareFolderPickerController.swift index b7faa4de6..ceea68435 100644 --- a/iOS/ShareExtension/ShareFolderPickerController.swift +++ b/iOS/ShareExtension/ShareFolderPickerController.swift @@ -46,7 +46,7 @@ final class ShareFolderPickerController: UITableViewController { }() if let account = container as? ExtensionAccount { - cell.icon.image = AppImage.accountImage(account.type) + cell.icon.image = AppImage.account(account.type) } else { cell.icon.image = AppAssets.folderImage.image }