Skip to content
Merged
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
19 changes: 9 additions & 10 deletions src/Files.App/Services/Windows/WindowsIniService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ public List<IniSectionDataItem> GetData(string filePath)
return [];
}

// Get sections
var sections = lines
.Where(line => line.StartsWith('[') && line.EndsWith(']'));

// Get section line indexes
// Get section line indexes directly to handle duplicate section names
List<int> sectionLineIndexes = [];
foreach (var section in sections)
sectionLineIndexes.Add(lines.IndexOf(section));
for (int i = 0; i < lines.Count; i++)
{
if (lines[i].StartsWith('[') && lines[i].EndsWith(']'))
sectionLineIndexes.Add(i);
}

List<IniSectionDataItem> dataItems = [];

Expand All @@ -42,10 +41,10 @@ public List<IniSectionDataItem> GetData(string filePath)

var count =
index + 1 == sectionLineIndexes.Count
? (lines.Count - 1) - sectionIndex
: sectionLineIndexes[index + 1] - sectionIndex;
? lines.Count - sectionIndex - 1
: sectionLineIndexes[index + 1] - sectionIndex - 1;

if (count == 0)
if (count <= 0)
continue;

var range = lines.GetRange(sectionIndex + 1, count);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/Shells/ModernShellPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</Grid.RowDefinitions>

<Image
Grid.RowSpan="2"
Grid.RowSpan="3"
HorizontalAlignment="{x:Bind ShellViewModel.FolderBackgroundImageHorizontalAlignment, Mode=OneWay}"
VerticalAlignment="{x:Bind ShellViewModel.FolderBackgroundImageVerticalAlignment, Mode=OneWay}"
Opacity="{x:Bind ShellViewModel.FolderBackgroundImageOpacity, Mode=OneWay}"
Expand Down
Loading