From f06d22d6f01e657ebbc0c8ef082739cd468e47b5 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> Date: Sun, 11 Feb 2024 02:09:18 +0000 Subject: Infra: Capitalisation Consistency (#6296) * Rename Ryujinx.UI.Common * Rename Ryujinx.UI.LocaleGenerator * Update in Files AboutWindow * Configuration State * Rename projects * Ryujinx/UI * Fix build * Main remaining inconsistencies * HLE.UI Namespace * HLE.UI Files * Namespace * Ryujinx.UI.Common.Configuration.UI * Ryujinx.UI.Common,Configuration.UI Files * More instances --- .../SystemInfo/LinuxSystemInfo.cs | 85 ---------------------- 1 file changed, 85 deletions(-) delete mode 100644 src/Ryujinx.Ui.Common/SystemInfo/LinuxSystemInfo.cs (limited to 'src/Ryujinx.Ui.Common/SystemInfo/LinuxSystemInfo.cs') diff --git a/src/Ryujinx.Ui.Common/SystemInfo/LinuxSystemInfo.cs b/src/Ryujinx.Ui.Common/SystemInfo/LinuxSystemInfo.cs deleted file mode 100644 index 5f1ab541..00000000 --- a/src/Ryujinx.Ui.Common/SystemInfo/LinuxSystemInfo.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Ryujinx.Common.Logging; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Runtime.Versioning; - -namespace Ryujinx.Ui.Common.SystemInfo -{ - [SupportedOSPlatform("linux")] - class LinuxSystemInfo : SystemInfo - { - internal LinuxSystemInfo() - { - string cpuName = GetCpuidCpuName(); - - if (cpuName == null) - { - var cpuDict = new Dictionary(StringComparer.Ordinal) - { - ["model name"] = null, - ["Processor"] = null, - ["Hardware"] = null, - }; - - ParseKeyValues("/proc/cpuinfo", cpuDict); - - cpuName = cpuDict["model name"] ?? cpuDict["Processor"] ?? cpuDict["Hardware"] ?? "Unknown"; - } - - var memDict = new Dictionary(StringComparer.Ordinal) - { - ["MemTotal"] = null, - ["MemAvailable"] = null, - }; - - ParseKeyValues("/proc/meminfo", memDict); - - // Entries are in KiB - ulong.TryParse(memDict["MemTotal"]?.Split(' ')[0], NumberStyles.Integer, CultureInfo.InvariantCulture, out ulong totalKiB); - ulong.TryParse(memDict["MemAvailable"]?.Split(' ')[0], NumberStyles.Integer, CultureInfo.InvariantCulture, out ulong availableKiB); - - CpuName = $"{cpuName} ; {LogicalCoreCount} logical"; - RamTotal = totalKiB * 1024; - RamAvailable = availableKiB * 1024; - } - - private static void ParseKeyValues(string filePath, Dictionary itemDict) - { - if (!File.Exists(filePath)) - { - Logger.Error?.Print(LogClass.Application, $"File \"{filePath}\" not found"); - - return; - } - - int count = itemDict.Count; - - using StreamReader file = new(filePath); - - string line; - while ((line = file.ReadLine()) != null) - { - string[] kvPair = line.Split(':', 2, StringSplitOptions.TrimEntries); - - if (kvPair.Length < 2) - { - continue; - } - - string key = kvPair[0]; - - if (itemDict.TryGetValue(key, out string value) && value == null) - { - itemDict[key] = kvPair[1]; - - if (--count <= 0) - { - break; - } - } - } - } - } -} -- cgit v1.2.3