misc: Small code improvements.

This commit is contained in:
Evan Husted 2024-10-14 15:03:09 -05:00
parent 5f6d9eef6b
commit b2a35ecf6c
6 changed files with 71 additions and 112 deletions

View file

@ -8,10 +8,8 @@ namespace Ryujinx.UI.Common.Helper
public static string ActiveApplicationTitle(ProcessResult activeProcess, string applicationVersion, string pauseString = "")
{
if (activeProcess == null)
{
return String.Empty;
}
return string.Empty;
string titleNameSection = string.IsNullOrWhiteSpace(activeProcess.Name) ? string.Empty : $" {activeProcess.Name}";
string titleVersionSection = string.IsNullOrWhiteSpace(activeProcess.DisplayVersion) ? string.Empty : $" v{activeProcess.DisplayVersion}";
string titleIdSection = $" ({activeProcess.ProgramIdText.ToUpper()})";
@ -19,12 +17,9 @@ namespace Ryujinx.UI.Common.Helper
string appTitle = $"Ryujinx {applicationVersion} -{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}";
if (!string.IsNullOrEmpty(pauseString))
{
appTitle += $" ({pauseString})";
}
return appTitle;
return !string.IsNullOrEmpty(pauseString)
? appTitle + $" ({pauseString})"
: appTitle;
}
}
}