Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolson committed Mar 3, 2024
1 parent cb9e018 commit a4d0753
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions PVLibrary/PVLibrary/Importer/Services/GameImporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ public extension GameImporter {
// If we have a matching game from a multi-match above, use that, or run a query by path and see if there's a match there

// For multi-cd games, make the most inert version of the filename
var similiarName = RomDatabase.sharedInstance.altName(path, systemIdentifier: system.identifier)
let similarName = RomDatabase.sharedInstance.altName(path, systemIdentifier: system.identifier)
if let existingGame = maybeGame ?? // found a match above?
RomDatabase.sharedInstance.getGamesCache()[partialPath] ??
RomDatabase.sharedInstance.getGamesCache()[similiarName],
Expand Down Expand Up @@ -1161,7 +1161,7 @@ public extension GameImporter {
return game
}

public func getArtwork(forGame game: PVGame) -> PVGame {
func getArtwork(forGame game: PVGame) -> PVGame {
var url = game.originalArtworkURL
if url.isEmpty {
return game
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ final class PVGameLibraryViewController: GCEventViewController, UITextFieldDeleg
let resetAlert = UIAlertController(title: "Reset core?", message: "Are you sure you want to reset \(game.title) to no longer default to use \(coreName)?", preferredStyle: .alert)
resetAlert.preferredContentSize = CGSize(width: 300, height: 150)
resetAlert.popoverPresentationController?.sourceView = sender
resetAlert.popoverPresentationController?.sourceRect = sender.bounds ?? UIScreen.main.bounds
resetAlert.popoverPresentationController?.sourceRect = sender.bounds
resetAlert.addAction(UIAlertAction(title: NSLocalizedString("Cancel", comment: "Cancel"), style: .cancel, handler: nil))
resetAlert.addAction(UIAlertAction(title: "Yes", style: .destructive, handler: { _ in
try! RomDatabase.sharedInstance.writeTransaction {
Expand Down Expand Up @@ -1192,7 +1192,7 @@ final class PVGameLibraryViewController: GCEventViewController, UITextFieldDeleg
let alert = UIAlertController(title: nil, message: "URL copied to clipboard.", preferredStyle: .alert)
alert.preferredContentSize = CGSize(width: 300, height: 150)
alert.popoverPresentationController?.sourceView = sender
alert.popoverPresentationController?.sourceRect = sender.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = sender.bounds
self.present(alert, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {
alert.dismiss(animated: true, completion: nil)
Expand Down Expand Up @@ -1354,7 +1354,7 @@ final class PVGameLibraryViewController: GCEventViewController, UITextFieldDeleg
let alert = UIAlertController(title: "Rename", message: "Enter a new name for \(game.title):", preferredStyle: .alert)
alert.preferredContentSize = CGSize(width: 300, height: 150)
alert.popoverPresentationController?.sourceView = sender
alert.popoverPresentationController?.sourceRect = sender.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = sender.bounds
alert.addTextField(configurationHandler: { (_ textField: UITextField) -> Void in
textField.placeholder = game.title
textField.text = game.title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ extension GameLaunchingViewController where Self: UIViewController {
if let biosInfo = additionalBios[file],
let md5=biosInfo.keys.first,
let size=biosInfo[md5] {
var bios=PVBIOS(withSystem: system, descriptionText: file, expectedMD5: md5, expectedSize: size, expectedFilename: file)
let bios=PVBIOS(withSystem: system, descriptionText: file, expectedMD5: md5, expectedSize: size, expectedFilename: file)
bios.optional=false
entries.append(bios.asDomain())
}
Expand Down
2 changes: 1 addition & 1 deletion Provenance/NewUI/Consoles/ConsoleGamesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct BiosRowView: SwiftUI.View {
Image(systemName: "exclamationmark.triangle.fill")
.foregroundColor(Color.yellow)
.font(.system(size: 12, weight: .light))
case let .mismatch(_):
case .mismatch(_):
Text("Mismatch")
.font(.system(size: 12))
.foregroundColor(Color.red)
Expand Down
14 changes: 7 additions & 7 deletions Provenance/Settings/PVSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ final class PVSettingsViewController: QuickTableViewController {
let alert = UIAlertController(title: "Theme", message: "", preferredStyle: .actionSheet)
alert.popoverPresentationController?.barButtonItem = self.navigationItem.leftBarButtonItem
alert.popoverPresentationController?.sourceView = self.tableView
alert.popoverPresentationController?.sourceRect = self.tableView.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = self.tableView.bounds
ThemeOptions.themes.forEach { mode in
let modeLabel = mode == .auto ? mode.description + " (\(systemMode))" : mode.description
let action = UIAlertAction(title: modeLabel, style: .default, handler: { _ in
Expand Down Expand Up @@ -663,7 +663,7 @@ final class PVSettingsViewController: QuickTableViewController {
message: "Check your network connection or settings and free up ports: 80, 81.",
preferredStyle: .alert)
alert.popoverPresentationController?.sourceView = tableView
alert.popoverPresentationController?.sourceRect = tableView.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = tableView.bounds
alert.preferredContentSize = CGSize(width: 500, height: 150)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (_: UIAlertAction) -> Void in
}))
Expand All @@ -674,7 +674,7 @@ final class PVSettingsViewController: QuickTableViewController {
message: "Your device needs to be connected to a WiFi network to continue!",
preferredStyle: .alert)
alert.popoverPresentationController?.sourceView = tableView
alert.popoverPresentationController?.sourceRect = tableView.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = tableView.bounds
alert.preferredContentSize = CGSize(width: 500, height: 150)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (_: UIAlertAction) -> Void in
}))
Expand All @@ -690,7 +690,7 @@ final class PVSettingsViewController: QuickTableViewController {
""",
preferredStyle: .alert)
alert.popoverPresentationController?.sourceView = tableView
alert.popoverPresentationController?.sourceRect = tableView.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = tableView.bounds
alert.preferredContentSize = CGSize(width: 500, height: 300)
alert.addAction(UIAlertAction(title: "Yes",
style: .default,
Expand All @@ -712,7 +712,7 @@ final class PVSettingsViewController: QuickTableViewController {
""",
preferredStyle: .alert)
alert.popoverPresentationController?.sourceView = tableView
alert.popoverPresentationController?.sourceRect = tableView.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = tableView.bounds
alert.preferredContentSize = CGSize(width: 500, height: 300)
alert.addAction(UIAlertAction(title: "Yes",
style: .default,
Expand All @@ -738,7 +738,7 @@ final class PVSettingsViewController: QuickTableViewController {
""",
preferredStyle: .alert)
alert.popoverPresentationController?.sourceView = tableView
alert.popoverPresentationController?.sourceRect = tableView.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = tableView.bounds
alert.preferredContentSize = CGSize(width: 500, height: 300)
alert.addAction(UIAlertAction(title: "Yes",
style: .default,
Expand All @@ -761,7 +761,7 @@ final class PVSettingsViewController: QuickTableViewController {
""",
preferredStyle: .alert)
alert.popoverPresentationController?.sourceView = tableView
alert.popoverPresentationController?.sourceRect = tableView.bounds ?? UIScreen.main.bounds
alert.popoverPresentationController?.sourceRect = tableView.bounds
alert.preferredContentSize = CGSize(width: 500, height: 150)
alert.addAction(UIAlertAction(title: NSLocalizedString("Yes", comment: ""),
style: .default,
Expand Down

0 comments on commit a4d0753

Please sign in to comment.