From 07066c2299aae83c90136fdf244f9bd7822d40e6 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 21 Sep 2020 10:53:23 -0700 Subject: [PATCH] Change location of Extra INI ROOT_FOLDER remap --- SabreTools.Library/DatFiles/DatFile.cs | 4 ---- SabreTools.Library/Filtering/ExtraIniItem.cs | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index 187d2271..c4539b9a 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -784,10 +784,6 @@ namespace SabreTools.Library.DatFiles string key = mapping.Key; List machineNames = mapping.Value; - // If we have the root folder, assume boolean - if (string.Equals(key, "ROOT_FOLDER")) - key = "true"; - // Loop through the machines and add the new mappings foreach (string machine in machineNames) { diff --git a/SabreTools.Library/Filtering/ExtraIniItem.cs b/SabreTools.Library/Filtering/ExtraIniItem.cs index 851d8b35..6705257a 100644 --- a/SabreTools.Library/Filtering/ExtraIniItem.cs +++ b/SabreTools.Library/Filtering/ExtraIniItem.cs @@ -76,6 +76,12 @@ namespace SabreTools.Library.Filtering string key = ir.Section; string value = ir.Line.Trim(); + // If the section is "ROOT_FOLDER", then we use the value "true" instead. + // This is done because some INI files use the name of the file as the + // category to be assigned to the items included. + if (key == "ROOT_FOLDER") + key = "true"; + // Ensure the key exists if (!Mappings.ContainsKey(key)) Mappings[key] = new List();