Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public void Unload()
".m4a",
".mp3",
".ogg",
".opus",
".wav",
".wma",
};
Expand Down
2 changes: 1 addition & 1 deletion src/modules/poweraccent/PowerAccent.Core/Languages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ private static string[] GetDefaultLetterKeyIT(LetterKey letter)
return letter switch
{
LetterKey.VK_A => new[] { "à" },
LetterKey.VK_E => new[] { "è", "é", "ə", "€" },
LetterKey.VK_E => new[] { "è", "é" },
LetterKey.VK_I => new[] { "ì", "í" },
LetterKey.VK_O => new[] { "ò", "ó" },
LetterKey.VK_U => new[] { "ù", "ú" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,20 +589,33 @@ private void LoadMachineMatrixString()

if (!string.IsNullOrEmpty(Settings.Properties.MachinePool?.Value))
{
List<string> availableMachines = new List<string>();

// Format of this field is "NAME1:ID1,NAME2:ID2,..."
// Load the available machines
// Build a deduplicated list of available machine names so that a machine
// registered under multiple IDs doesn't produce duplicate layout slots.
var seenPool = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
List<string> availableMachines = new List<string>();
foreach (string availableMachineIdPair in Settings.Properties.MachinePool.Value.Split(","))
{
string availableMachineName = availableMachineIdPair.Split(':')[0];
availableMachines.Add(availableMachineName);
if (seenPool.Add(availableMachineName))
{
availableMachines.Add(availableMachineName);
}
}

// Start by removing the machines from the matrix that are no longer available to pick.
// Remove machines from the matrix that are no longer available, and clear
// any duplicate entries that may have been persisted in earlier versions.
var seenInMatrix = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
for (int i = 0; i < loadMachineMatrixString.Count; i++)
{
if (!availableMachines.Contains(loadMachineMatrixString[i]))
if (string.IsNullOrEmpty(loadMachineMatrixString[i]))
{
continue;
}

bool stillAvailable = availableMachines.Contains(loadMachineMatrixString[i], StringComparer.OrdinalIgnoreCase);
bool firstOccurrence = seenInMatrix.Add(loadMachineMatrixString[i]);
if (!stillAvailable || !firstOccurrence)
{
editedTheMatrix = true;
loadMachineMatrixString[i] = string.Empty;
Expand All @@ -612,7 +625,7 @@ private void LoadMachineMatrixString()
// If an available machine is not in the matrix already, fill it in the first available spot.
foreach (string availableMachineName in availableMachines)
{
if (!loadMachineMatrixString.Contains(availableMachineName))
if (!loadMachineMatrixString.Contains(availableMachineName, StringComparer.OrdinalIgnoreCase))
{
int availableIndex = loadMachineMatrixString.FindIndex(name => string.IsNullOrEmpty(name));
if (availableIndex >= 0)
Expand Down
Loading