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
36 changes: 0 additions & 36 deletions Files/Models/Settings/BaseJsonSettingsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,42 +173,6 @@ protected virtual bool Set<TValue>(TValue value, [CallerMemberName] string prope
{
try
{
// Check if caching is enabled
if (isCachingEnabled)
{
// If cache contains the setting...
if (settingsCache.ContainsKey(propertyName))
{
TValue settingValue;

// Get the object
object settingObject = settingsCache[propertyName];

// Check if it's a JToken object
if (settingObject is JToken jtoken)
{
// Get the value from JToken
settingValue = jtoken.ToObject<TValue>();
}
else
{
// Otherwise, it is TValue, get the value
settingValue = (TValue)settingObject;
}

// Compare the setting and the new value
if (EqualityComparer<TValue>.Default.Equals(value, settingValue))
{
// Both are equal meaning the cache doesn't have to be reloaded, return
return false;
}

// The values aren't equal, continue, to update the file and cache
}

// The value doesn't exist, continue, to update the file and cache
}

// If cache doesn't contain the setting...
if (!settingsCache.ContainsKey(propertyName))
{
Expand Down
1 change: 1 addition & 0 deletions Files/ViewModels/ItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ private async void RapidAddItemsToCollectionAsync(string path, string previousDi
}
finally
{
DirectoryInfoUpdated?.Invoke(this, EventArgs.Empty); // Make sure item count is updated
enumFolderSemaphore.Release();
itemLoadEvent.Set();
}
Expand Down
13 changes: 1 addition & 12 deletions Files/Views/ColumnShellPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ public ColumnShellPage()
SystemNavigationManager.GetForCurrentView().BackRequested += ColumnShellPage_BackRequested;

App.DrivesManager.PropertyChanged += DrivesManager_PropertyChanged;

AppServiceConnectionHelper.ConnectionChanged += AppServiceConnectionHelper_ConnectionChanged;
}

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

public NamedPipeAsAppServiceConnection ServiceConnection { get; private set; }

private TabItemArguments tabItemArguments;

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

private async void Page_Loaded(object sender, RoutedEventArgs e)
private void Page_Loaded(object sender, RoutedEventArgs e)
{
FilesystemViewModel = new ItemViewModel(InstanceViewModel?.FolderSettings);
FilesystemViewModel.WorkingDirectoryModified += ViewModel_WorkingDirectoryModified;
Expand All @@ -544,7 +540,6 @@ private async void Page_Loaded(object sender, RoutedEventArgs e)
FilesystemViewModel.PageTypeUpdated += FilesystemViewModel_PageTypeUpdated;
FilesystemViewModel.OnSelectionRequestedEvent += FilesystemViewModel_OnSelectionRequestedEvent;
OnNavigationParamsChanged();
ServiceConnection = await AppServiceConnectionHelper.Instance;
this.Loaded -= Page_Loaded;
}

Expand Down Expand Up @@ -803,12 +798,6 @@ public void Dispose()
FilesystemViewModel.OnSelectionRequestedEvent -= FilesystemViewModel_OnSelectionRequestedEvent;
FilesystemViewModel.Dispose();
}
AppServiceConnectionHelper.ConnectionChanged -= AppServiceConnectionHelper_ConnectionChanged;
}

private async void AppServiceConnectionHelper_ConnectionChanged(object sender, Task<NamedPipeAsAppServiceConnection> e)
{
ServiceConnection = await e;
}

private void FilesystemViewModel_ItemLoadStatusChanged(object sender, ItemLoadStatusChangedEventArgs e)
Expand Down
14 changes: 1 addition & 13 deletions Files/Views/ModernShellPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ public ModernShellPage()
SystemNavigationManager.GetForCurrentView().BackRequested += ModernShellPage_BackRequested;

App.DrivesManager.PropertyChanged += DrivesManager_PropertyChanged;

AppServiceConnectionHelper.ConnectionChanged += AppServiceConnectionHelper_ConnectionChanged;
}

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

public NamedPipeAsAppServiceConnection ServiceConnection { get; private set; }

private TabItemArguments tabItemArguments;

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

private async void Page_Loaded(object sender, RoutedEventArgs e)
private void Page_Loaded(object sender, RoutedEventArgs e)
{
FilesystemViewModel = new ItemViewModel(InstanceViewModel?.FolderSettings);
FilesystemViewModel.WorkingDirectoryModified += ViewModel_WorkingDirectoryModified;
Expand All @@ -572,7 +568,6 @@ private async void Page_Loaded(object sender, RoutedEventArgs e)
FilesystemViewModel.PageTypeUpdated += FilesystemViewModel_PageTypeUpdated;
FilesystemViewModel.OnSelectionRequestedEvent += FilesystemViewModel_OnSelectionRequestedEvent;
OnNavigationParamsChanged();
ServiceConnection = await AppServiceConnectionHelper.Instance;
this.Loaded -= Page_Loaded;
}

Expand Down Expand Up @@ -945,13 +940,6 @@ public void Dispose()
{
disposableContent?.Dispose();
}

AppServiceConnectionHelper.ConnectionChanged -= AppServiceConnectionHelper_ConnectionChanged;
}

private async void AppServiceConnectionHelper_ConnectionChanged(object sender, Task<NamedPipeAsAppServiceConnection> e)
{
ServiceConnection = await e;
}

private void FilesystemViewModel_ItemLoadStatusChanged(object sender, ItemLoadStatusChangedEventArgs e)
Expand Down