Fix typo renamed to "NeedsProton" (#440)

Update platform.rs scope name

Update platform.rs trait name

Update heroic_platform.rs trait

Update gog_platform.rs trait

Update itch_game.rs trait

Update platform.rs trait

Update origin_platform.rs traits

Update epic_platform.rs trait

Update platform.rs traits

Update heroic_platform.rs trait

Update gog_platform.rs traits

Update itch_game.rs trait

Remove space.
This commit is contained in:
guylamar2006
2025-02-24 21:53:55 +01:00
committed by GitHub
parent 553eb85155
commit c90191bf0f
9 changed files with 19 additions and 19 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
use crate::platforms::{ use crate::platforms::{
load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsPorton, ShortcutToImport, load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsProton, ShortcutToImport,
}; };
use super::{get_egs_manifests, settings::EpicGamesLauncherSettings, ManifestItem}; use super::{get_egs_manifests, settings::EpicGamesLauncherSettings, ManifestItem};
@@ -19,7 +19,7 @@ impl FromSettingsString for EpicPlatform {
} }
} }
impl NeedsPorton<EpicPlatform> for ManifestItem { impl NeedsProton<EpicPlatform> for ManifestItem {
fn needs_proton(&self, _platform: &EpicPlatform) -> bool { fn needs_proton(&self, _platform: &EpicPlatform) -> bool {
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
return true; return true;
+2 -2
View File
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::platforms::{ use crate::platforms::{
load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsPorton, ShortcutToImport, load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsProton, ShortcutToImport,
}; };
use super::FlatpakSettings; use super::FlatpakSettings;
@@ -25,7 +25,7 @@ impl From<FlatpakApp> for ShortcutOwned {
} }
} }
impl NeedsPorton<FlatpakPlatform> for FlatpakApp { impl NeedsProton<FlatpakPlatform> for FlatpakApp {
fn needs_proton(&self, _platform: &FlatpakPlatform) -> bool { fn needs_proton(&self, _platform: &FlatpakPlatform) -> bool {
false false
} }
+2 -2
View File
@@ -1,7 +1,7 @@
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use crate::platforms::{ use crate::platforms::{
load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsPorton, ShortcutToImport, load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsProton, ShortcutToImport,
}; };
use super::{ use super::{
@@ -163,7 +163,7 @@ fn get_games_from_game_folders(game_folders: Vec<PathBuf>) -> Vec<(GogGame, Path
games games
} }
impl NeedsPorton<GogPlatform> for GogShortcut { impl NeedsProton<GogPlatform> for GogShortcut {
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
fn needs_proton(&self, _platform: &GogPlatform) -> bool { fn needs_proton(&self, _platform: &GogPlatform) -> bool {
true true
+2 -2
View File
@@ -2,7 +2,7 @@ use serde::Deserialize;
use super::{HeroicGame, HeroicGameType, HeroicSettings}; use super::{HeroicGame, HeroicGameType, HeroicSettings};
use crate::platforms::{load_settings, FromSettingsString, GamesPlatform}; use crate::platforms::{load_settings, FromSettingsString, GamesPlatform};
use crate::platforms::{to_shortcuts, NeedsPorton, ShortcutToImport}; use crate::platforms::{to_shortcuts, NeedsProton, ShortcutToImport};
use std::collections::HashMap; use std::collections::HashMap;
use std::path::Path; use std::path::Path;
@@ -86,7 +86,7 @@ impl HeroicPlatform {
} }
} }
impl NeedsPorton<HeroicPlatform> for HeroicGameType { impl NeedsProton<HeroicPlatform> for HeroicGameType {
#[cfg(not(target_family = "unix"))] #[cfg(not(target_family = "unix"))]
fn needs_proton(&self, _platform: &HeroicPlatform) -> bool { fn needs_proton(&self, _platform: &HeroicPlatform) -> bool {
false false
+2 -2
View File
@@ -3,7 +3,7 @@ use std::path::Path;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use steam_shortcuts_util::{shortcut::ShortcutOwned, Shortcut}; use steam_shortcuts_util::{shortcut::ShortcutOwned, Shortcut};
use crate::platforms::NeedsPorton; use crate::platforms::NeedsProton;
use super::ItchPlatform; use super::ItchPlatform;
@@ -38,7 +38,7 @@ impl From<ItchGame> for ShortcutOwned {
} }
} }
impl NeedsPorton<ItchPlatform> for ItchGame { impl NeedsProton<ItchPlatform> for ItchGame {
fn needs_proton(&self, _platform: &ItchPlatform) -> bool { fn needs_proton(&self, _platform: &ItchPlatform) -> bool {
self.executable.ends_with("exe") self.executable.ends_with("exe")
} }
+3 -3
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::platforms::{GamesPlatform, FromSettingsString, load_settings, GogShortcut, NeedsPorton}; use crate::platforms::{GamesPlatform, FromSettingsString, load_settings, GogShortcut, NeedsProton};
#[derive(Clone)] #[derive(Clone)]
pub struct MiniGalaxyPlatform { pub struct MiniGalaxyPlatform {
@@ -25,7 +25,7 @@ impl Default for Settings{
} }
impl NeedsPorton<MiniGalaxyPlatform> for GogShortcut{ impl NeedsProton<MiniGalaxyPlatform> for GogShortcut{
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
fn needs_proton(&self, _platform: &MiniGalaxyPlatform) -> bool { fn needs_proton(&self, _platform: &MiniGalaxyPlatform) -> bool {
//TODO check if we can do better than just always true //TODO check if we can do better than just always true
@@ -117,4 +117,4 @@ fn get_default_folder_string() -> String {
fn get_default_folder_path() -> eyre::Result<std::path::PathBuf> { fn get_default_folder_path() -> eyre::Result<std::path::PathBuf> {
let home = std::env::var("HOME")?; let home = std::env::var("HOME")?;
Ok(std::path::Path::new(&home).join("GOG Games")) Ok(std::path::Path::new(&home).join("GOG Games"))
} }
+2 -2
View File
@@ -1,5 +1,5 @@
use crate::platforms::{ use crate::platforms::{
load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsPorton, ShortcutToImport, load_settings, to_shortcuts, FromSettingsString, GamesPlatform, NeedsProton, ShortcutToImport,
}; };
use nom::bytes::complete::take_until; use nom::bytes::complete::take_until;
use std::{ use std::{
@@ -14,7 +14,7 @@ pub struct OriginPlatform {
pub settings: OriginSettings, pub settings: OriginSettings,
} }
impl NeedsPorton<OriginPlatform> for OriginGame { impl NeedsProton<OriginPlatform> for OriginGame {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
fn needs_proton(&self, _platform: &OriginPlatform) -> bool { fn needs_proton(&self, _platform: &OriginPlatform) -> bool {
false false
+2 -2
View File
@@ -35,7 +35,7 @@ pub(crate) fn to_shortcuts<T, P>(
) -> eyre::Result<Vec<ShortcutToImport>> ) -> eyre::Result<Vec<ShortcutToImport>>
where where
T: Into<ShortcutOwned>, T: Into<ShortcutOwned>,
T: NeedsPorton<P>, T: NeedsProton<P>,
{ {
let shortcuts = into_shortcuts?; let shortcuts = into_shortcuts?;
let mut shortcut_info = vec![]; let mut shortcut_info = vec![];
@@ -73,7 +73,7 @@ where
Ok(shortcut_info) Ok(shortcut_info)
} }
pub trait NeedsPorton<P> { pub trait NeedsProton<P> {
fn needs_proton(&self, platform: &P) -> bool; fn needs_proton(&self, platform: &P) -> bool;
fn create_symlinks(&self, platform: &P) -> bool; fn create_symlinks(&self, platform: &P) -> bool;
+2 -2
View File
@@ -7,7 +7,7 @@ use crate::platforms::load_settings;
use crate::platforms::to_shortcuts_simple; use crate::platforms::to_shortcuts_simple;
use crate::platforms::FromSettingsString; use crate::platforms::FromSettingsString;
use crate::platforms::GamesPlatform; use crate::platforms::GamesPlatform;
use crate::platforms::NeedsPorton; use crate::platforms::NeedsProton;
use crate::platforms::ShortcutToImport; use crate::platforms::ShortcutToImport;
use super::{game::UplayGame, settings::UplaySettings}; use super::{game::UplayGame, settings::UplaySettings};
@@ -17,7 +17,7 @@ pub struct UplayPlatform {
pub settings: UplaySettings, pub settings: UplaySettings,
} }
impl NeedsPorton<UplayPlatform> for UplayGame { impl NeedsProton<UplayPlatform> for UplayGame {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
fn needs_proton(&self, _platform: &UplayPlatform) -> bool { fn needs_proton(&self, _platform: &UplayPlatform) -> bool {
false false