Skip to content

Commit 746a9b2

Browse files
authored
Fixes an issue for which changes to Bundles are not saved (#5439)
1 parent e9afcc2 commit 746a9b2

File tree

4 files changed

+3
-61
lines changed

4 files changed

+3
-61
lines changed

Diff for: Files/Models/Settings/BaseJsonSettingsModel.cs

-36
Original file line numberDiff line numberDiff line change
@@ -173,42 +173,6 @@ protected virtual bool Set<TValue>(TValue value, [CallerMemberName] string prope
173173
{
174174
try
175175
{
176-
// Check if caching is enabled
177-
if (isCachingEnabled)
178-
{
179-
// If cache contains the setting...
180-
if (settingsCache.ContainsKey(propertyName))
181-
{
182-
TValue settingValue;
183-
184-
// Get the object
185-
object settingObject = settingsCache[propertyName];
186-
187-
// Check if it's a JToken object
188-
if (settingObject is JToken jtoken)
189-
{
190-
// Get the value from JToken
191-
settingValue = jtoken.ToObject<TValue>();
192-
}
193-
else
194-
{
195-
// Otherwise, it is TValue, get the value
196-
settingValue = (TValue)settingObject;
197-
}
198-
199-
// Compare the setting and the new value
200-
if (EqualityComparer<TValue>.Default.Equals(value, settingValue))
201-
{
202-
// Both are equal meaning the cache doesn't have to be reloaded, return
203-
return false;
204-
}
205-
206-
// The values aren't equal, continue, to update the file and cache
207-
}
208-
209-
// The value doesn't exist, continue, to update the file and cache
210-
}
211-
212176
// If cache doesn't contain the setting...
213177
if (!settingsCache.ContainsKey(propertyName))
214178
{

Diff for: Files/ViewModels/ItemViewModel.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ private async void RapidAddItemsToCollectionAsync(string path, string previousDi
11271127
}
11281128
finally
11291129
{
1130+
DirectoryInfoUpdated?.Invoke(this, EventArgs.Empty); // Make sure item count is updated
11301131
enumFolderSemaphore.Release();
11311132
itemLoadEvent.Set();
11321133
}

Diff for: Files/Views/ColumnShellPage.xaml.cs

+1-12
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ public ColumnShellPage()
182182
SystemNavigationManager.GetForCurrentView().BackRequested += ColumnShellPage_BackRequested;
183183

184184
App.DrivesManager.PropertyChanged += DrivesManager_PropertyChanged;
185-
186-
AppServiceConnectionHelper.ConnectionChanged += AppServiceConnectionHelper_ConnectionChanged;
187185
}
188186

189187
void InitToolbarCommands()
@@ -494,8 +492,6 @@ private void OnNavigationParamsChanged()
494492
public static readonly DependencyProperty NavParamsProperty =
495493
DependencyProperty.Register("NavParams", typeof(string), typeof(ColumnShellPage), new PropertyMetadata(null));
496494

497-
public NamedPipeAsAppServiceConnection ServiceConnection { get; private set; }
498-
499495
private TabItemArguments tabItemArguments;
500496

501497
public TabItemArguments TabItemArguments
@@ -535,7 +531,7 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
535531
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
536532
}
537533

538-
private async void Page_Loaded(object sender, RoutedEventArgs e)
534+
private void Page_Loaded(object sender, RoutedEventArgs e)
539535
{
540536
FilesystemViewModel = new ItemViewModel(InstanceViewModel?.FolderSettings);
541537
FilesystemViewModel.WorkingDirectoryModified += ViewModel_WorkingDirectoryModified;
@@ -544,7 +540,6 @@ private async void Page_Loaded(object sender, RoutedEventArgs e)
544540
FilesystemViewModel.PageTypeUpdated += FilesystemViewModel_PageTypeUpdated;
545541
FilesystemViewModel.OnSelectionRequestedEvent += FilesystemViewModel_OnSelectionRequestedEvent;
546542
OnNavigationParamsChanged();
547-
ServiceConnection = await AppServiceConnectionHelper.Instance;
548543
this.Loaded -= Page_Loaded;
549544
}
550545

@@ -803,12 +798,6 @@ public void Dispose()
803798
FilesystemViewModel.OnSelectionRequestedEvent -= FilesystemViewModel_OnSelectionRequestedEvent;
804799
FilesystemViewModel.Dispose();
805800
}
806-
AppServiceConnectionHelper.ConnectionChanged -= AppServiceConnectionHelper_ConnectionChanged;
807-
}
808-
809-
private async void AppServiceConnectionHelper_ConnectionChanged(object sender, Task<NamedPipeAsAppServiceConnection> e)
810-
{
811-
ServiceConnection = await e;
812801
}
813802

814803
private void FilesystemViewModel_ItemLoadStatusChanged(object sender, ItemLoadStatusChangedEventArgs e)

Diff for: Files/Views/ModernShellPage.xaml.cs

+1-13
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ public ModernShellPage()
188188
SystemNavigationManager.GetForCurrentView().BackRequested += ModernShellPage_BackRequested;
189189

190190
App.DrivesManager.PropertyChanged += DrivesManager_PropertyChanged;
191-
192-
AppServiceConnectionHelper.ConnectionChanged += AppServiceConnectionHelper_ConnectionChanged;
193191
}
194192

195193
void InitToolbarCommands()
@@ -522,8 +520,6 @@ private void OnNavigationParamsChanged()
522520
public static readonly DependencyProperty NavParamsProperty =
523521
DependencyProperty.Register("NavParams", typeof(string), typeof(ModernShellPage), new PropertyMetadata(null));
524522

525-
public NamedPipeAsAppServiceConnection ServiceConnection { get; private set; }
526-
527523
private TabItemArguments tabItemArguments;
528524

529525
public TabItemArguments TabItemArguments
@@ -563,7 +559,7 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
563559
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
564560
}
565561

566-
private async void Page_Loaded(object sender, RoutedEventArgs e)
562+
private void Page_Loaded(object sender, RoutedEventArgs e)
567563
{
568564
FilesystemViewModel = new ItemViewModel(InstanceViewModel?.FolderSettings);
569565
FilesystemViewModel.WorkingDirectoryModified += ViewModel_WorkingDirectoryModified;
@@ -572,7 +568,6 @@ private async void Page_Loaded(object sender, RoutedEventArgs e)
572568
FilesystemViewModel.PageTypeUpdated += FilesystemViewModel_PageTypeUpdated;
573569
FilesystemViewModel.OnSelectionRequestedEvent += FilesystemViewModel_OnSelectionRequestedEvent;
574570
OnNavigationParamsChanged();
575-
ServiceConnection = await AppServiceConnectionHelper.Instance;
576571
this.Loaded -= Page_Loaded;
577572
}
578573

@@ -945,13 +940,6 @@ public void Dispose()
945940
{
946941
disposableContent?.Dispose();
947942
}
948-
949-
AppServiceConnectionHelper.ConnectionChanged -= AppServiceConnectionHelper_ConnectionChanged;
950-
}
951-
952-
private async void AppServiceConnectionHelper_ConnectionChanged(object sender, Task<NamedPipeAsAppServiceConnection> e)
953-
{
954-
ServiceConnection = await e;
955943
}
956944

957945
private void FilesystemViewModel_ItemLoadStatusChanged(object sender, ItemLoadStatusChangedEventArgs e)

0 commit comments

Comments
 (0)