aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ryujinx.Common/SystemInfo/LinuxSystemInfo.cs4
-rw-r--r--Ryujinx.Common/SystemInfo/MacOSSystemInfo.cs (renamed from Ryujinx.Common/SystemInfo/MacOSSysteminfo.cs)4
-rw-r--r--Ryujinx.Common/SystemInfo/SystemInfo.cs29
-rw-r--r--Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs4
4 files changed, 15 insertions, 26 deletions
diff --git a/Ryujinx.Common/SystemInfo/LinuxSystemInfo.cs b/Ryujinx.Common/SystemInfo/LinuxSystemInfo.cs
index c729ab3d..f067083e 100644
--- a/Ryujinx.Common/SystemInfo/LinuxSystemInfo.cs
+++ b/Ryujinx.Common/SystemInfo/LinuxSystemInfo.cs
@@ -5,12 +5,12 @@ using System.Runtime.Versioning;
namespace Ryujinx.Common.SystemInfo
{
[SupportedOSPlatform("linux")]
- internal class LinuxSysteminfo : SystemInfo
+ internal class LinuxSystemInfo : SystemInfo
{
public override string CpuName { get; }
public override ulong RamSize { get; }
- public LinuxSysteminfo()
+ public LinuxSystemInfo()
{
CpuName = File.ReadAllLines("/proc/cpuinfo").Where(line => line.StartsWith("model name")).ToList()[0].Split(":")[1].Trim();
RamSize = ulong.Parse(File.ReadAllLines("/proc/meminfo")[0].Split(":")[1].Trim().Split(" ")[0]) * 1024;
diff --git a/Ryujinx.Common/SystemInfo/MacOSSysteminfo.cs b/Ryujinx.Common/SystemInfo/MacOSSystemInfo.cs
index 1cf18ca0..ec069ca4 100644
--- a/Ryujinx.Common/SystemInfo/MacOSSysteminfo.cs
+++ b/Ryujinx.Common/SystemInfo/MacOSSystemInfo.cs
@@ -8,7 +8,7 @@ using Ryujinx.Common.Logging;
namespace Ryujinx.Common.SystemInfo
{
[SupportedOSPlatform("macos")]
- internal class MacOSSysteminfo : SystemInfo
+ internal class MacOSSystemInfo : SystemInfo
{
public override string CpuName { get; }
public override ulong RamSize { get; }
@@ -65,7 +65,7 @@ namespace Ryujinx.Common.SystemInfo
return res;
}
- public MacOSSysteminfo()
+ public MacOSSystemInfo()
{
ulong ramSize = 0;
diff --git a/Ryujinx.Common/SystemInfo/SystemInfo.cs b/Ryujinx.Common/SystemInfo/SystemInfo.cs
index 9ab1419c..feb6b8f8 100644
--- a/Ryujinx.Common/SystemInfo/SystemInfo.cs
+++ b/Ryujinx.Common/SystemInfo/SystemInfo.cs
@@ -1,4 +1,5 @@
-using System.Runtime.InteropServices;
+using System;
+using System.Runtime.InteropServices;
namespace Ryujinx.Common.SystemInfo
{
@@ -7,35 +8,23 @@ namespace Ryujinx.Common.SystemInfo
public virtual string OsDescription => $"{RuntimeInformation.OSDescription} ({RuntimeInformation.OSArchitecture})";
public virtual string CpuName => "Unknown";
public virtual ulong RamSize => 0;
-
- public string RamSizeInMB
- {
- get
- {
- if (RamSize == 0)
- {
- return "Unknown";
- }
-
- return $"{RamSize / 1024 / 1024} MB";
- }
- }
+ public string RamSizeInMB => (RamSize == 0) ? "Unknown" : $"{RamSize / 1024 / 1024} MB";
public static SystemInfo Instance { get; }
static SystemInfo()
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ if (OperatingSystem.IsWindows())
{
- Instance = new WindowsSysteminfo();
+ Instance = new WindowsSystemInfo();
}
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ else if (OperatingSystem.IsLinux())
{
- Instance = new LinuxSysteminfo();
+ Instance = new LinuxSystemInfo();
}
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ else if (OperatingSystem.IsMacOS())
{
- Instance = new MacOSSysteminfo();
+ Instance = new MacOSSystemInfo();
}
else
{
diff --git a/Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs b/Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs
index 1b048c8e..479dd25f 100644
--- a/Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs
+++ b/Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs
@@ -7,12 +7,12 @@ using System.Runtime.Versioning;
namespace Ryujinx.Common.SystemInfo
{
[SupportedOSPlatform("windows")]
- internal class WindowsSysteminfo : SystemInfo
+ internal class WindowsSystemInfo : SystemInfo
{
public override string CpuName { get; }
public override ulong RamSize { get; }
- public WindowsSysteminfo()
+ public WindowsSystemInfo()
{
bool wmiNotAvailable = false;