Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #2308

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 similarName = 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()[similarName],
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 @@ -327,6 +327,7 @@ extension GameLaunchingViewController where Self: UIViewController {
let size = biosInfo[md5] {
let bios = PVBIOS(withSystem: system, descriptionText: file, expectedMD5: md5, expectedSize: size, expectedFilename: file)
bios.optional = false

entries.append(bios.asDomain())
}
})
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 @@ -680,7 +680,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 @@ -691,7 +691,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 @@ -707,7 +707,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 @@ -729,7 +729,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 @@ -755,7 +755,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 @@ -778,7 +778,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
Loading