Skip to content

Commit e6d8671

Browse files
authored
Codebase: Fixing UpdateService (#8812)
1 parent 62714c4 commit e6d8671

File tree

8 files changed

+17
-16
lines changed

8 files changed

+17
-16
lines changed

src/Files.Backend/Services/Settings/IUpdateSettingsService.cs renamed to src/Files.Backend/Services/IUpdateService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System.ComponentModel;
22
using System.Threading.Tasks;
33

4-
namespace Files.Backend.Services.Settings
4+
namespace Files.Backend.Services
55
{
6-
public interface IUpdateSettingsService : IBaseSettingsService, INotifyPropertyChanged
6+
public interface IUpdateService : INotifyPropertyChanged
77
{
88
/// <summary>
99
/// Gets a value indicating whether updates are available.

src/Files.Uwp/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ private IServiceProvider ConfigureServices()
114114
// Settings not related to IUserSettingsService:
115115
.AddSingleton<IFileTagsSettingsService, FileTagsSettingsService>()
116116
.AddSingleton<IBundlesSettingsService, BundlesSettingsService>()
117-
.AddSingleton<IUpdateSettingsService, UpdateSettingsService>()
118117

119118
// Other services
120119
.AddSingleton<IDialogService, DialogService>()
121120
.AddSingleton<IImagingService, ImagingService>()
122121
.AddSingleton<ILocalizationService, LocalizationService>()
122+
.AddSingleton<IUpdateService, UpdateService>()
123123

124124
// TODO(i): FileSystem operations:
125125
// (IFilesystemHelpersService, IFilesystemOperationsService)
@@ -201,7 +201,7 @@ await Task.WhenAll(
201201
});
202202

203203
// Check for required updates
204-
var updateService = Ioc.Default.GetRequiredService<IUpdateSettingsService>();
204+
var updateService = Ioc.Default.GetRequiredService<IUpdateService>();
205205
await updateService.CheckForUpdates();
206206
await updateService.DownloadMandatoryUpdates();
207207
}

src/Files.Uwp/Files.Uwp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
<Compile Include="ServicesImplementation\Settings\PaneSettingsService.cs" />
251251
<Compile Include="ServicesImplementation\Settings\UserSettingsService.cs" />
252252
<Compile Include="ServicesImplementation\Settings\WidgetsSettingsService.cs" />
253-
<Compile Include="ServicesImplementation\Settings\UpdateSettingsService.cs" />
253+
<Compile Include="ServicesImplementation\UpdateService.cs" />
254254
<Compile Include="UserControls\ColoredIcon.xaml.cs">
255255
<DependentUpon>ColoredIcon.xaml</DependentUpon>
256256
</Compile>

src/Files.Uwp/ServicesImplementation/Settings/UpdateSettingsService.cs renamed to src/Files.Uwp/ServicesImplementation/UpdateService.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
using System.IO;
44
using System.Linq;
55
using System.Threading.Tasks;
6-
using Files.Backend.Services.Settings;
7-
using Files.Uwp.Serialization;
8-
using Microsoft.Toolkit.Uwp;
96
using Windows.Services.Store;
107
using Windows.UI.Xaml.Controls;
8+
using CommunityToolkit.Mvvm.ComponentModel;
9+
using Files.Backend.Services;
10+
using Microsoft.Toolkit.Uwp;
1111

12-
namespace Files.Uwp.ServicesImplementation.Settings
12+
namespace Files.Uwp.ServicesImplementation
1313
{
14-
internal sealed class UpdateSettingsService : BaseObservableJsonSettings, IUpdateSettingsService
14+
internal sealed class UpdateService : ObservableObject, IUpdateService
1515
{
1616
private StoreContext _storeContext;
1717
private IList<StorePackageUpdate> _updatePackages;
@@ -42,7 +42,7 @@ private set
4242
}
4343
}
4444

45-
public UpdateSettingsService()
45+
public UpdateService()
4646
{
4747
_updatePackages = new List<StorePackageUpdate>();
4848
}

src/Files.Uwp/UserControls/NavigationToolbar.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,12 @@
573573
Height="32"
574574
HorizontalContentAlignment="Stretch"
575575
VerticalContentAlignment="Stretch"
576-
x:Load="{x:Bind ViewModel.UpdateSettingsService.IsUpdateAvailable, Mode=OneWay}"
576+
x:Load="{x:Bind ViewModel.UpdateService.IsUpdateAvailable, Mode=OneWay}"
577577
AccessKey="1"
578578
AutomationProperties.Name="{helpers:ResourceString Name=UpdateFiles}"
579579
Background="Transparent"
580580
Command="{x:Bind ViewModel.UpdateCommand, Mode=OneWay}"
581-
IsEnabled="{x:Bind ViewModel.UpdateSettingsService.IsUpdating, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
581+
IsEnabled="{x:Bind ViewModel.UpdateService.IsUpdating, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
582582
Style="{StaticResource ToolBarButtonStyle}"
583583
ToolTipService.ToolTip="{helpers:ResourceString Name=UpdateFiles}">
584584
<FontIcon FontSize="14" Glyph="&#xE896;" />

src/Files.Uwp/ViewModels/NavToolbarViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using Windows.UI.Xaml.Controls;
2828
using Windows.UI.Xaml.Controls.Primitives;
2929
using Windows.UI.Xaml.Input;
30+
using Files.Backend.Services;
3031
using static Files.UserControls.INavigationToolbar;
3132
using SearchBox = Files.UserControls.SearchBox;
3233
using SortDirection = Files.Shared.Enums.SortDirection;
@@ -38,7 +39,7 @@ public class NavToolbarViewModel : ObservableObject, INavigationToolbar, IDispos
3839
{
3940
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetService<IUserSettingsService>();
4041

41-
public IUpdateSettingsService UpdateSettingsService { get; } = Ioc.Default.GetService<IUpdateSettingsService>();
42+
public IUpdateService UpdateService { get; } = Ioc.Default.GetService<IUpdateService>();
4243

4344
public delegate void ToolbarPathItemInvokedEventHandler(object sender, PathNavigationEventArgs e);
4445

src/Files.Uwp/Views/ColumnShellPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public sealed partial class ColumnShellPage : Page, IShellPage, INotifyPropertyC
6666

6767
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetService<IUserSettingsService>();
6868

69-
private IUpdateSettingsService UpdateSettingsService { get; } = Ioc.Default.GetService<IUpdateSettingsService>();
69+
private IUpdateService UpdateSettingsService { get; } = Ioc.Default.GetService<IUpdateService>();
7070

7171
private bool isCurrentInstance = false;
7272
public bool IsCurrentInstance

src/Files.Uwp/Views/ModernShellPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public sealed partial class ModernShellPage : Page, IShellPage, INotifyPropertyC
5555

5656
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetService<IUserSettingsService>();
5757

58-
private IUpdateSettingsService UpdateSettingsService { get; } = Ioc.Default.GetService<IUpdateSettingsService>();
58+
private IUpdateService UpdateSettingsService { get; } = Ioc.Default.GetService<IUpdateService>();
5959

6060
private bool isCurrentInstance = false;
6161
public bool IsCurrentInstance

0 commit comments

Comments
 (0)