Skip to content

Commit 0c973ed

Browse files
committed
Fix up 3
1 parent 15cdfc7 commit 0c973ed

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/Files.App/Services/Windows/WindowsQuickAccessService.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ async Task<LocationItem> CreateItemOf(string path)
148148

149149
locationItem.Path = path;
150150
locationItem.Section = SectionType.Pinned;
151-
locationItem.MenuOptions = new ContextMenuOptions()
151+
locationItem.MenuOptions = new()
152152
{
153153
IsLocationItem = true,
154154
ShowProperties = true,
@@ -157,7 +157,7 @@ async Task<LocationItem> CreateItemOf(string path)
157157
ShowEmptyRecycleBin = string.Equals(path, Constants.UserEnvironmentPaths.RecycleBinPath, StringComparison.OrdinalIgnoreCase)
158158
};
159159
locationItem.IsDefaultLocation = false;
160-
locationItem.Text = res?.Result?.DisplayName ?? Path.GetFileName(path.TrimEnd('\\'));
160+
locationItem.Text = res?.Result?.DisplayName ?? SystemIO.Path.GetFileName(path.TrimEnd('\\'));
161161

162162
if (res)
163163
{

src/Files.App/ViewModels/UserControls/Widgets/QuickAccessWidgetViewModel.cs

+7-11
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,14 @@ private async Task UpdateCollectionAsync(NotifyCollectionChangedEventArgs e)
172172
// case NotifyCollectionChangedAction.Reset:
173173
default:
174174
{
175-
var items = QuickAccessService.PinnedFolders.ToList();
176-
if (!items.SequenceEqual(Items))
175+
Items.Clear();
176+
foreach (var item in QuickAccessService.PinnedFolders.ToList())
177177
{
178-
Items.Clear();
179-
foreach (var item in items)
180-
{
181-
if (item is not LocationItem locationItem)
182-
continue;
183-
184-
var cardItem = new WidgetFolderCardItem(locationItem, SystemIO.Path.GetFileName(locationItem.Text), true) { Path = locationItem.Path };
185-
AddItemToCollection(cardItem);
186-
}
178+
if (item is not LocationItem locationItem)
179+
continue;
180+
181+
var cardItem = new WidgetFolderCardItem(locationItem, SystemIO.Path.GetFileName(locationItem.Text), true) { Path = locationItem.Path };
182+
AddItemToCollection(cardItem);
187183
}
188184
}
189185
break;

0 commit comments

Comments
 (0)