mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-07 08:41:02 +02:00
Tweak GetCpuName code
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Ryujinx.UI.Common.SystemInfo
|
|||||||
{
|
{
|
||||||
internal WindowsSystemInfo()
|
internal WindowsSystemInfo()
|
||||||
{
|
{
|
||||||
CpuName = $"{GetCpuidCpuName() ?? GetCpuName()} ; {LogicalCoreCount} logical";
|
CpuName = $"{GetCpuidCpuName() ?? GetCpuNameFromRegistry()} ; {LogicalCoreCount} logical";
|
||||||
(RamTotal, RamAvailable) = GetMemoryStats();
|
(RamTotal, RamAvailable) = GetMemoryStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,13 +27,6 @@ namespace Ryujinx.UI.Common.SystemInfo
|
|||||||
return (0, 0);
|
return (0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetCpuName()
|
|
||||||
{
|
|
||||||
string cpuName = GetCpuNameFromRegistry();
|
|
||||||
|
|
||||||
return !string.IsNullOrEmpty(cpuName) ? cpuName : Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")?.Trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetCpuNameFromRegistry()
|
private static string GetCpuNameFromRegistry()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -46,7 +39,8 @@ namespace Ryujinx.UI.Common.SystemInfo
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Error?.Print(LogClass.Application, $"Registry CPU name lookup failed: {ex.Message}");
|
Logger.Error?.Print(LogClass.Application, $"Registry CPU name lookup failed: {ex.Message}");
|
||||||
return null;
|
|
||||||
|
return Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")?.Trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user