From 0a04999cf6c6d0a571dc0bbf6665d875989718d2 Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sat, 1 May 2021 12:45:04 +0200 Subject: [PATCH 1/5] Removed cache feature --- .../UniversalStorageEnumerator.cs | 19 +- .../Win32StorageEnumerator.cs | 19 +- .../FileListCache/FileListCacheController.cs | 48 ---- Files/Helpers/FileListCache/IFileListCache.cs | 4 - .../PersistentSQLiteCacheAdapter.cs | 123 --------- Files/ViewModels/ItemViewModel.cs | 251 +++--------------- Files/Views/ColumnShellPage.xaml.cs | 2 +- Files/Views/ModernShellPage.xaml.cs | 2 +- 8 files changed, 40 insertions(+), 428 deletions(-) diff --git a/Files/Filesystem/StorageEnumerators/UniversalStorageEnumerator.cs b/Files/Filesystem/StorageEnumerators/UniversalStorageEnumerator.cs index c8870aaf3a76..fcee5f750029 100644 --- a/Files/Filesystem/StorageEnumerators/UniversalStorageEnumerator.cs +++ b/Files/Filesystem/StorageEnumerators/UniversalStorageEnumerator.cs @@ -23,7 +23,6 @@ public static async Task> ListEntries( string returnformat, Type sourcePageType, CancellationToken cancellationToken, - List skipItems, int countLimit, Func, Task> intermediateAction ) @@ -74,14 +73,7 @@ ex is UnauthorizedAccessException var folder = await AddFolderAsync(item as StorageFolder, currentStorageFolder, returnformat, cancellationToken); if (folder != null) { - if (skipItems?.Contains(folder.ItemPath) ?? false) - { - skipItems.Remove(folder.ItemPath); - } - else - { - tempList.Add(folder); - } + tempList.Add(folder); } } else @@ -90,14 +82,7 @@ ex is UnauthorizedAccessException var fileEntry = await AddFileAsync(file, currentStorageFolder, returnformat, true, sourcePageType, cancellationToken); if (fileEntry != null) { - if (skipItems?.Contains(fileEntry.ItemPath) ?? false) - { - skipItems.Remove(fileEntry.ItemPath); - } - else - { - tempList.Add(fileEntry); - } + tempList.Add(fileEntry); } } if (cancellationToken.IsCancellationRequested) diff --git a/Files/Filesystem/StorageEnumerators/Win32StorageEnumerator.cs b/Files/Filesystem/StorageEnumerators/Win32StorageEnumerator.cs index 51c72e131677..b27df0bb385e 100644 --- a/Files/Filesystem/StorageEnumerators/Win32StorageEnumerator.cs +++ b/Files/Filesystem/StorageEnumerators/Win32StorageEnumerator.cs @@ -28,7 +28,6 @@ public static async Task> ListEntries( WIN32_FIND_DATA findData, NamedPipeAsAppServiceConnection connection, CancellationToken cancellationToken, - List skipItems, int countLimit, Func, Task> intermediateAction ) @@ -49,14 +48,7 @@ Func, Task> intermediateAction var file = await GetFile(findData, path, returnformat, connection, cancellationToken); if (file != null) { - if (skipItems?.Contains(file.ItemPath) ?? false) - { - skipItems.Remove(file.ItemPath); - } - else - { - tempList.Add(file); - } + tempList.Add(file); ++count; } } @@ -67,14 +59,7 @@ Func, Task> intermediateAction var folder = await GetFolder(findData, path, returnformat, cancellationToken); if (folder != null) { - if (skipItems?.Contains(folder.ItemPath) ?? false) - { - skipItems.Remove(folder.ItemPath); - } - else - { - tempList.Add(folder); - } + tempList.Add(folder); ++count; } } diff --git a/Files/Helpers/FileListCache/FileListCacheController.cs b/Files/Helpers/FileListCache/FileListCacheController.cs index 1c8ae8472aa3..fb78aadaddfb 100644 --- a/Files/Helpers/FileListCache/FileListCacheController.cs +++ b/Files/Helpers/FileListCache/FileListCacheController.cs @@ -20,59 +20,11 @@ private FileListCacheController() persistentAdapter = new PersistentSQLiteCacheAdapter(); } - private readonly IMemoryCache filesCache = new MemoryCache(new MemoryCacheOptions - { - SizeLimit = 1_000_000 - }); - private readonly IMemoryCache fileNamesCache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 1_000_000 }); - public Task SaveFileListToCache(string path, CacheEntry cacheEntry) - { - if (!App.AppSettings.UseFileListCache) - { - return Task.CompletedTask; - } - - if (cacheEntry == null) - { - filesCache.Remove(path); - return persistentAdapter.SaveFileListToCache(path, cacheEntry); - } - filesCache.Set(path, cacheEntry, new MemoryCacheEntryOptions - { - Size = cacheEntry.FileList.Count - }); - - // save entry to persistent cache in background - return persistentAdapter.SaveFileListToCache(path, cacheEntry); - } - - public async Task ReadFileListFromCache(string path, CancellationToken cancellationToken) - { - if (!App.AppSettings.UseFileListCache) - { - return null; - } - - var entry = filesCache.Get(path); - if (entry == null) - { - entry = await persistentAdapter.ReadFileListFromCache(path, cancellationToken); - if (entry?.FileList != null) - { - filesCache.Set(path, entry, new MemoryCacheEntryOptions - { - Size = entry.FileList.Count - }); - } - } - return entry; - } - public async Task ReadFileDisplayNameFromCache(string path, CancellationToken cancellationToken) { var displayName = fileNamesCache.Get(path); diff --git a/Files/Helpers/FileListCache/IFileListCache.cs b/Files/Helpers/FileListCache/IFileListCache.cs index c51ef2f588e0..41babaecc361 100644 --- a/Files/Helpers/FileListCache/IFileListCache.cs +++ b/Files/Helpers/FileListCache/IFileListCache.cs @@ -5,10 +5,6 @@ namespace Files.Helpers.FileListCache { internal interface IFileListCache { - public Task ReadFileListFromCache(string path, CancellationToken cancellationToken); - - public Task SaveFileListToCache(string path, CacheEntry cacheEntry); - public Task ReadFileDisplayNameFromCache(string path, CancellationToken cancellationToken); public Task SaveFileDisplayNameToCache(string path, string displayName); diff --git a/Files/Helpers/FileListCache/PersistentSQLiteCacheAdapter.cs b/Files/Helpers/FileListCache/PersistentSQLiteCacheAdapter.cs index cb6ef3816206..bc453081ae89 100644 --- a/Files/Helpers/FileListCache/PersistentSQLiteCacheAdapter.cs +++ b/Files/Helpers/FileListCache/PersistentSQLiteCacheAdapter.cs @@ -15,98 +15,6 @@ internal class PersistentSQLiteCacheAdapter : IFileListCache, IDisposable private SqliteConnection connection; private bool disposedValue; - public async Task SaveFileListToCache(string path, CacheEntry cacheEntry) - { - if (!await InitializeIfNeeded()) - { - return; - } - const int maxCachedEntries = 128; - try - { - if (cacheEntry == null) - { - using var deleteCommand = new SqliteCommand("DELETE FROM FileListCache WHERE Id = @Id", connection); - deleteCommand.Parameters.Add("@Id", SqliteType.Text).Value = path; - await deleteCommand.ExecuteNonQueryAsync(); - return; - } - - if (cacheEntry.FileList.Count > maxCachedEntries) - { - cacheEntry.FileList = cacheEntry.FileList.Take(maxCachedEntries).ToList(); - } - - using var cmd = new SqliteCommand("SELECT Id FROM FileListCache WHERE Id = @Id", connection); - cmd.Parameters.Add("@Id", SqliteType.Text).Value = path; - using var reader = await cmd.ExecuteReaderAsync(); - if (reader.HasRows) - { - // need to update entry - using var updateCommand = new SqliteCommand("UPDATE FileListCache SET Timestamp = @Timestamp, Entry = @Entry WHERE Id = @Id", connection); - updateCommand.Parameters.Add("@Id", SqliteType.Text).Value = path; - updateCommand.Parameters.Add("@Timestamp", SqliteType.Integer).Value = GetTimestamp(DateTime.UtcNow); - var settings = new JsonSerializerSettings - { - TypeNameHandling = TypeNameHandling.Auto - }; - updateCommand.Parameters.Add("@Entry", SqliteType.Text).Value = JsonConvert.SerializeObject(cacheEntry, settings); - await updateCommand.ExecuteNonQueryAsync(); - } - else - { - // need to insert entry - using var insertCommand = new SqliteCommand("INSERT INTO FileListCache (Id, Timestamp, Entry) VALUES (@Id, @Timestamp, @Entry)", connection); - insertCommand.Parameters.Add("@Id", SqliteType.Text).Value = path; - insertCommand.Parameters.Add("@Timestamp", SqliteType.Integer).Value = GetTimestamp(DateTime.UtcNow); - var settings = new JsonSerializerSettings - { - TypeNameHandling = TypeNameHandling.Auto - }; - insertCommand.Parameters.Add("@Entry", SqliteType.Text).Value = JsonConvert.SerializeObject(cacheEntry, settings); - await insertCommand.ExecuteNonQueryAsync(); - } - } - catch (Exception ex) - { - NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message); - } - } - - public async Task ReadFileListFromCache(string path, CancellationToken cancellationToken) - { - if (!await InitializeIfNeeded()) - { - return null; - } - try - { - using var cmd = new SqliteCommand("SELECT Timestamp, Entry FROM FileListCache WHERE Id = @Id", connection); - cmd.Parameters.Add("@Id", SqliteType.Text).Value = path; - - using var reader = await cmd.ExecuteReaderAsync(cancellationToken); - if (!await reader.ReadAsync()) - { - return null; - } - var timestamp = reader.GetInt64(0); - var entryAsJson = reader.GetString(1); - var settings = new JsonSerializerSettings - { - TypeNameHandling = TypeNameHandling.Auto - }; - var entry = JsonConvert.DeserializeObject(entryAsJson, settings); - entry.CurrentFolder.ItemPropertiesInitialized = false; - entry.FileList.ForEach((item) => item.ItemPropertiesInitialized = false); - return entry; - } - catch (Exception ex) - { - NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message); - return null; - } - } - public async Task SaveFileDisplayNameToCache(string path, string displayName) { if (!await InitializeIfNeeded()) @@ -174,11 +82,6 @@ public async Task ReadFileDisplayNameFromCache(string path, Cancellation } } - private long GetTimestamp(DateTime dateTime) - { - return new DateTimeOffset(dateTime).ToUnixTimeSeconds(); - } - public void Dispose() { if (!disposedValue) @@ -190,23 +93,6 @@ public void Dispose() private void RunCleanupRoutine() { - Task.Run(async () => - { - try - { - // remove entries that are 1 month old (timestamp is updated every time the cache is set) - var limitTimestamp = GetTimestamp(DateTime.Now.AddMonths(-1)); - using var cmd = new SqliteCommand("DELETE FROM FileListCache WHERE Timestamp < @Timestamp", connection); - cmd.Parameters.Add("@Timestamp", SqliteType.Integer).Value = limitTimestamp; - - var count = await cmd.ExecuteNonQueryAsync().ConfigureAwait(false); - Debug.WriteLine($"Removed {count} old entries from cache database"); - } - catch (Exception ex) - { - NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message); - } - }); } private async Task InitializeIfNeeded() @@ -227,15 +113,6 @@ private async Task InitializeIfNeeded() connection.Open(); // create db schema - var createFileListCacheTable = @"CREATE TABLE IF NOT EXISTS ""FileListCache"" ( - ""Id"" VARCHAR(5000) NOT NULL, - ""Timestamp"" INTEGER NOT NULL, - ""Entry"" TEXT NOT NULL, - PRIMARY KEY(""Id"") - )"; - using var cmdFileListCacheTable = new SqliteCommand(createFileListCacheTable, connection); - cmdFileListCacheTable.ExecuteNonQuery(); - var createFileDisplayNameCacheTable = @"CREATE TABLE IF NOT EXISTS ""FileDisplayNameCache"" ( ""Id"" VARCHAR(5000) NOT NULL, ""DisplayName"" TEXT NOT NULL, diff --git a/Files/ViewModels/ItemViewModel.cs b/Files/ViewModels/ItemViewModel.cs index 749e4fe1f152..e5819e591fc6 100644 --- a/Files/ViewModels/ItemViewModel.cs +++ b/Files/ViewModels/ItemViewModel.cs @@ -945,12 +945,12 @@ public async Task LoadIconWithoutOverlayAsync(string filePath, uint thum return null; } - public void RefreshItems(string previousDir, bool useCache = true) + public void RefreshItems(string previousDir) { - RapidAddItemsToCollectionAsync(WorkingDirectory, previousDir, useCache); + RapidAddItemsToCollectionAsync(WorkingDirectory, previousDir); } - private async void RapidAddItemsToCollectionAsync(string path, string previousDir, bool useCache = true) + private async void RapidAddItemsToCollectionAsync(string path, string previousDir) { ItemLoadStatusChanged?.Invoke(this, new ItemLoadStatusChangedEventArgs() { Status = ItemLoadStatusChangedEventArgs.ItemLoadStatus.Starting }); @@ -994,13 +994,13 @@ private async void RapidAddItemsToCollectionAsync(string path, string previousDi var libItem = new LibraryItem(library); foreach (var folder in library.Folders) { - await RapidAddItemsToCollection(folder, useCache, libItem); + await RapidAddItemsToCollection(folder, libItem); } } } else { - await RapidAddItemsToCollection(path, useCache); + await RapidAddItemsToCollection(path); } ItemLoadStatusChanged?.Invoke(this, new ItemLoadStatusChangedEventArgs() { Status = ItemLoadStatusChangedEventArgs.ItemLoadStatus.Complete, PreviousDirectory = previousDir, Path = path }); @@ -1014,7 +1014,7 @@ private async void RapidAddItemsToCollectionAsync(string path, string previousDi } } - private async Task RapidAddItemsToCollection(string path, bool useCache, LibraryItem library = null) + private async Task RapidAddItemsToCollection(string path, LibraryItem library = null) { if (string.IsNullOrEmpty(path)) { @@ -1024,47 +1024,6 @@ private async Task RapidAddItemsToCollection(string path, bool useCache, Library Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); - List cacheResult = null; - - if (useCache) - { - cacheResult = await Task.Run(async () => - { - CacheEntry cacheEntry = await fileListCache.ReadFileListFromCache(path, addFilesCTS.Token); - - if (cacheEntry != null) - { - for (var i = 0; i < Math.Min(32, cacheEntry.FileList.Count); i++) - { - var entry = cacheEntry.FileList[i]; - if (!entry.IsHiddenItem || AppSettings.AreHiddenItemsVisible) - { - if (entry.FileImage == null) - { - entry.LoadFolderGlyph = entry.PrimaryItemAttribute == StorageItemTypes.Folder; - entry.LoadUnknownTypeGlyph = entry.PrimaryItemAttribute == StorageItemTypes.File && !entry.IsLinkItem; - entry.LoadWebShortcutGlyph = entry.PrimaryItemAttribute == StorageItemTypes.File && entry.IsLinkItem; - entry.LoadFileIcon = false; - } - filesAndFolders.Add(entry); - } - if (addFilesCTS.IsCancellationRequested) - { - return null; - } - } - return filesAndFolders.Select(i => i.ItemPath).ToList(); - } - return null; - }); - if (cacheResult != null) - { - await OrderFilesAndFoldersAsync(); - await ApplyFilesAndFoldersChangesAsync(); - IsLoadingItems = false; // Hide progress indicator if loaded from cache - } - } - var isRecycleBin = path.StartsWith(AppSettings.RecycleBinPath); if (isRecycleBin || path.StartsWith(AppSettings.NetworkFolderPath) || @@ -1085,7 +1044,7 @@ private async Task RapidAddItemsToCollection(string path, bool useCache, Library storageFolder = res.Result; } } - if (await EnumerateItemsFromStandardFolderAsync(path, storageFolder, folderSettings.GetLayoutType(path, false), addFilesCTS.Token, cacheResult, cacheOnly: false, library)) + if (await EnumerateItemsFromStandardFolderAsync(path, storageFolder, folderSettings.GetLayoutType(path, false), addFilesCTS.Token, library)) { // Is folder synced to cloud storage? var syncStatus = await CheckCloudDriveSyncStatusAsync(currentStorageFolder?.Item); @@ -1093,54 +1052,6 @@ private async Task RapidAddItemsToCollection(string path, bool useCache, Library WatchForDirectoryChanges(path, syncStatus); } - - var parallelLimit = App.AppSettings.PreemptiveCacheParallelLimit; - if (App.AppSettings.UseFileListCache && App.AppSettings.UsePreemptiveCache && parallelLimit > 0 && !addFilesCTS.IsCancellationRequested) - { - void CacheSubfolders(IEnumerable folderPaths, StorageFolderWithPath parentFolder, LibraryItem library) - { - Task.Run(async () => - { - try - { - await folderPaths.AsyncParallelForEach(async folderPath => - { - if (addFilesCTS.IsCancellationRequested) - { - return; - } - StorageFolderWithPath storageFolder = null; - if (Path.IsPathRooted(folderPath)) - { - var res = await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(folderPath, null, parentFolder)); - if (res) - { - storageFolder = res.Result; - } - } - await EnumerateItemsFromStandardFolderAsync(folderPath, storageFolder, folderSettings.GetLayoutType(folderPath, false), addFilesCTS.Token, null, cacheOnly: true, library); - }, maxDegreeOfParallelism: parallelLimit); - } - catch (Exception ex) - { - // ignore exception. This is fine, it's only a caching that can fail - NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message); - } - }).Forget(); - } - - // run background tasks to iterate through folders and cache all of them preemptively - CacheSubfolders(filesAndFolders.Where(e => e.PrimaryItemAttribute == StorageItemTypes.Folder && !e.IsLibraryItem).Select(e => e.ItemPath), storageFolder, library); - - // run background tasks to iterate through library folders and cache all of them preemptively - foreach (var libFile in filesAndFolders.Where(e => e.IsLibraryItem)) - { - if (App.LibraryManager.TryGetLibrary(libFile.ItemPath, out LibraryLocationItem lib) && !lib.IsEmpty) - { - CacheSubfolders(lib.Folders, null, new LibraryItem(lib)); - } - } - } } if (addFilesCTS.IsCancellationRequested) @@ -1232,7 +1143,7 @@ await Task.Run(async () => } } - public async Task EnumerateItemsFromStandardFolderAsync(string path, StorageFolderWithPath storageFolderForGivenPath, Type sourcePageType, CancellationToken cancellationToken, List skipItems, bool cacheOnly = false, LibraryItem library = null) + public async Task EnumerateItemsFromStandardFolderAsync(string path, StorageFolderWithPath storageFolderForGivenPath, Type sourcePageType, CancellationToken cancellationToken, LibraryItem library = null) { // Flag to use FindFirstFileExFromApp or StorageFolder enumeration bool enumFromStorageFolder = false; @@ -1254,11 +1165,6 @@ public async Task EnumerateItemsFromStandardFolderAsync(string path, Stora } else if (!FolderHelpers.CheckFolderAccessWithWin32(path)) // The folder is really inaccessible { - if (cacheOnly) - { - return false; - } - if (res == FileSystemStatusCode.Unauthorized) { //TODO: proper dialog @@ -1284,7 +1190,7 @@ await DialogDisplayHelper.ShowDialogAsync( ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; string returnformat = Enum.Parse(localSettings.Values[Constants.LocalSettings.DateTimeFormat].ToString()) == TimeStyle.Application ? "D" : "g"; - if (!cacheOnly && await FolderHelpers.CheckBitlockerStatusAsync(rootFolder, WorkingDirectory)) + if (await FolderHelpers.CheckBitlockerStatusAsync(rootFolder, WorkingDirectory)) { var bitlockerDialog = new Files.Dialogs.BitlockerDialog(Path.GetPathRoot(WorkingDirectory)); var bitlockerResult = await bitlockerDialog.ShowAsync(); @@ -1335,11 +1241,8 @@ await DialogDisplayHelper.ShowDialogAsync( currentFolder.ItemDateCreatedReal = dateCreated; } } - if (!cacheOnly) - { - CurrentFolder = currentFolder; - } - await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, storageFolderForGivenPath, sourcePageType, cancellationToken, skipItems, cacheOnly); + CurrentFolder = currentFolder; + await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, storageFolderForGivenPath, sourcePageType, cancellationToken); return true; } else @@ -1397,73 +1300,36 @@ await DialogDisplayHelper.ShowDialogAsync( FileSize = null, FileSizeBytes = 0, }; - if (!cacheOnly) - { - CurrentFolder = currentFolder; - } + CurrentFolder = currentFolder; if (hFile == IntPtr.Zero) { - if (!cacheOnly) - { - await DialogDisplayHelper.ShowDialogAsync("DriveUnpluggedDialog/Title".GetLocalized(), ""); - } + await DialogDisplayHelper.ShowDialogAsync("DriveUnpluggedDialog/Title".GetLocalized(), ""); return false; } else if (hFile.ToInt64() == -1) { - await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, storageFolderForGivenPath, sourcePageType, cancellationToken, skipItems, cacheOnly); + await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, storageFolderForGivenPath, sourcePageType, cancellationToken); return false; } else { - List fileList; - if (cacheOnly) - { - fileList = await Win32StorageEnumerator.ListEntries(path, returnformat, hFile, findData, Connection, cancellationToken, skipItems, 32, null); - await SaveFileListToCacheAsync(path, fileList); - } - else + List fileList = await Win32StorageEnumerator.ListEntries(path, returnformat, hFile, findData, Connection, cancellationToken, -1, intermediateAction: async (intermediateList) => { - fileList = await Win32StorageEnumerator.ListEntries(path, returnformat, hFile, findData, Connection, cancellationToken, skipItems, -1, intermediateAction: async (intermediateList) => - { - filesAndFolders.AddRange(intermediateList); - await OrderFilesAndFoldersAsync(); - await ApplyFilesAndFoldersChangesAsync(); - }); - - filesAndFolders.AddRange(fileList); + filesAndFolders.AddRange(intermediateList); await OrderFilesAndFoldersAsync(); await ApplyFilesAndFoldersChangesAsync(); - } - - if (skipItems != null) - { - // remove invalid cache entries - var invalidEntries = filesAndFolders.Where(i => skipItems.Contains(i.ItemPath)).ToList(); - foreach (var i in invalidEntries) - { - filesAndFolders.Remove(i); - } - } + }); - if (!cacheOnly) - { - if (!addFilesCTS.IsCancellationRequested) - { - await SaveFileListToCacheAsync(path, filesAndFolders); - } - else - { - await fileListCache.SaveFileListToCache(path, null); - } - } + filesAndFolders.AddRange(fileList); + await OrderFilesAndFoldersAsync(); + await ApplyFilesAndFoldersChangesAsync(); return true; } } } - private async Task EnumFromStorageFolderAsync(string path, ListedItem currentFolder, StorageFolder rootFolder, StorageFolderWithPath currentStorageFolder, Type sourcePageType, CancellationToken cancellationToken, List skipItems, bool cacheOnly) + private async Task EnumFromStorageFolderAsync(string path, ListedItem currentFolder, StorageFolder rootFolder, StorageFolderWithPath currentStorageFolder, Type sourcePageType, CancellationToken cancellationToken) { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); @@ -1471,62 +1337,24 @@ private async Task EnumFromStorageFolderAsync(string path, ListedItem currentFol ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; string returnformat = Enum.Parse(localSettings.Values[Constants.LocalSettings.DateTimeFormat].ToString()) == TimeStyle.Application ? "D" : "g"; - List finalList; - if (cacheOnly) + List finalList = await UniversalStorageEnumerator.ListEntries( + rootFolder, + currentStorageFolder, + returnformat, + sourcePageType, + cancellationToken, + -1, + async (intermediateList) => { - finalList = await UniversalStorageEnumerator.ListEntries( - rootFolder, - currentStorageFolder, - returnformat, - sourcePageType, - cancellationToken, - null, - 32, - null); - await SaveFileListToCacheAsync(path, finalList); - } - else - { - finalList = await UniversalStorageEnumerator.ListEntries( - rootFolder, - currentStorageFolder, - returnformat, - sourcePageType, - cancellationToken, - skipItems, - -1, - async (intermediateList) => - { - filesAndFolders.AddRange(intermediateList); - await OrderFilesAndFoldersAsync(); - await ApplyFilesAndFoldersChangesAsync(); - }); - filesAndFolders.AddRange(finalList); + filesAndFolders.AddRange(intermediateList); await OrderFilesAndFoldersAsync(); await ApplyFilesAndFoldersChangesAsync(); - } + }); + filesAndFolders.AddRange(finalList); + await OrderFilesAndFoldersAsync(); + await ApplyFilesAndFoldersChangesAsync(); - if (skipItems != null) - { - // remove invalid cache entries - var invalidEntries = filesAndFolders.Where(i => skipItems.Contains(i.ItemPath)).ToList(); - foreach (var i in invalidEntries) - { - filesAndFolders.Remove(i); - } - } stopwatch.Stop(); - if (!cacheOnly) - { - if (!addFilesCTS.IsCancellationRequested) - { - await SaveFileListToCacheAsync(path, filesAndFolders); - } - else - { - await fileListCache.SaveFileListToCache(path, null); - } - } Debug.WriteLine($"Enumerating items in {path} (device) completed in {stopwatch.ElapsedMilliseconds} milliseconds.\n"); } @@ -1713,7 +1541,6 @@ private async void ProcessOperationQueue(CancellationToken cancellationToken) await OrderFilesAndFoldersAsync(); await ApplyFilesAndFoldersChangesAsync(); - await SaveFileListToCacheAsync(WorkingDirectory, filesAndFolders); } } catch @@ -1913,16 +1740,6 @@ private async Task UpdateFileOrFolderAsync(string path) } } - private Task SaveFileListToCacheAsync(string path, IEnumerable fileList) - { - return fileListCache.SaveFileListToCache(path, new CacheEntry - { - CurrentFolder = CurrentFolder, - // since filesAndFolders could be mutated, memory cache needs a copy of current list - FileList = fileList.Take(32).ToList() - }); - } - private async Task RemoveFileOrFolderAsync(ListedItem item) { filesAndFolders.Remove(item); diff --git a/Files/Views/ColumnShellPage.xaml.cs b/Files/Views/ColumnShellPage.xaml.cs index 8d28b26373b0..d175fb9ae010 100644 --- a/Files/Views/ColumnShellPage.xaml.cs +++ b/Files/Views/ColumnShellPage.xaml.cs @@ -1052,7 +1052,7 @@ public async void Refresh_Click() await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var ContentOwnedViewModelInstance = FilesystemViewModel; - ContentOwnedViewModelInstance?.RefreshItems(null, false); + ContentOwnedViewModelInstance?.RefreshItems(null); }); } diff --git a/Files/Views/ModernShellPage.xaml.cs b/Files/Views/ModernShellPage.xaml.cs index f6f0955690f0..5a6965b20565 100644 --- a/Files/Views/ModernShellPage.xaml.cs +++ b/Files/Views/ModernShellPage.xaml.cs @@ -1061,7 +1061,7 @@ public async void Refresh_Click() await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var ContentOwnedViewModelInstance = FilesystemViewModel; - ContentOwnedViewModelInstance?.RefreshItems(null, false); + ContentOwnedViewModelInstance?.RefreshItems(null); }); } From cbc6277a79c31b10cd615ed69e76131a902ec44e Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sat, 1 May 2021 12:51:08 +0200 Subject: [PATCH 2/5] Removed related strings and settings --- Files/Files.csproj | 1 - Files/Helpers/FileListCache/CacheEntry.cs | 11 --- Files/Strings/en-US/Resources.resw | 67 ++++++++----------- Files/ViewModels/SettingsViewModel.cs | 27 -------- .../ExperimentalViewModel.cs | 51 -------------- Files/Views/SettingsPages/Experimental.xaml | 23 ------- 6 files changed, 29 insertions(+), 151 deletions(-) delete mode 100644 Files/Helpers/FileListCache/CacheEntry.cs diff --git a/Files/Files.csproj b/Files/Files.csproj index b5090d3020d9..597b139706c8 100644 --- a/Files/Files.csproj +++ b/Files/Files.csproj @@ -258,7 +258,6 @@ - diff --git a/Files/Helpers/FileListCache/CacheEntry.cs b/Files/Helpers/FileListCache/CacheEntry.cs deleted file mode 100644 index 8809c801b11d..000000000000 --- a/Files/Helpers/FileListCache/CacheEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Files.Filesystem; -using System.Collections.Generic; - -namespace Files.Helpers.FileListCache -{ - internal class CacheEntry - { - public List FileList { get; set; } - public ListedItem CurrentFolder { get; set; } - } -} \ No newline at end of file diff --git a/Files/Strings/en-US/Resources.resw b/Files/Strings/en-US/Resources.resw index 1b96737d8230..06d393db9d10 100644 --- a/Files/Strings/en-US/Resources.resw +++ b/Files/Strings/en-US/Resources.resw @@ -1,17 +1,17 @@  - @@ -1512,12 +1512,6 @@ Original path - - Cache files and folders for better performance - - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Add @@ -1818,9 +1812,6 @@ Disconnect - - Use preemptive cache (preload entries in child directories on navigation) - More bundles options @@ -2160,13 +2151,13 @@ Date modified: - + Open with File icon - + Original path column diff --git a/Files/ViewModels/SettingsViewModel.cs b/Files/ViewModels/SettingsViewModel.cs index 3397562d9e95..cce94bab7fbd 100644 --- a/Files/ViewModels/SettingsViewModel.cs +++ b/Files/ViewModels/SettingsViewModel.cs @@ -576,33 +576,6 @@ public bool ShowFileOwner set => Set(value); } - /// - /// Gets or sets a value indicating whether or not to cache files and folders. - /// - public bool UseFileListCache - { - get => Get(false); - set => Set(value); - } - - /// - /// Gets or sets a value indicating whether or not to use preemptive caching. - /// - public bool UsePreemptiveCache - { - get => Get(false); - set => Set(value); - } - - /// - /// Gets or sets a value indicating the limit of parallel preemptive cache loading limit. - /// - public int PreemptiveCacheParallelLimit - { - get => Get(2); - set => Set(value); - } - /// /// Gets or sets a value whether or not to enable the new list view based details view. /// diff --git a/Files/ViewModels/SettingsViewModels/ExperimentalViewModel.cs b/Files/ViewModels/SettingsViewModels/ExperimentalViewModel.cs index ba7b7c48999e..2069371baabf 100644 --- a/Files/ViewModels/SettingsViewModels/ExperimentalViewModel.cs +++ b/Files/ViewModels/SettingsViewModels/ExperimentalViewModel.cs @@ -21,57 +21,6 @@ public bool ShowFileOwner } } - private bool useFileListCache = App.AppSettings.UseFileListCache; - - public bool UseFileListCache - { - get - { - return useFileListCache; - } - set - { - if (SetProperty(ref useFileListCache, value)) - { - App.AppSettings.UseFileListCache = value; - } - } - } - - private bool usePreemptiveCache = App.AppSettings.UsePreemptiveCache; - - public bool UsePreemptiveCache - { - get - { - return usePreemptiveCache; - } - set - { - if (SetProperty(ref usePreemptiveCache, value)) - { - App.AppSettings.UsePreemptiveCache = value; - } - } - } - - private int preemptiveCacheParallelLimit = App.AppSettings.PreemptiveCacheParallelLimit; - - public int PreemptiveCacheParallelLimit - { - get - { - return preemptiveCacheParallelLimit; - } - set - { - if (SetProperty(ref preemptiveCacheParallelLimit, value)) - { - App.AppSettings.PreemptiveCacheParallelLimit = value; - } - } - } - private bool useNewDetailsView = App.AppSettings.UseNewDetailsView; public bool UseNewDetailsView diff --git a/Files/Views/SettingsPages/Experimental.xaml b/Files/Views/SettingsPages/Experimental.xaml index 5317bc084d72..5ce86623db10 100644 --- a/Files/Views/SettingsPages/Experimental.xaml +++ b/Files/Views/SettingsPages/Experimental.xaml @@ -41,29 +41,6 @@ HeaderTemplate="{StaticResource CustomHeaderStyle}" IsOn="{Binding ShowFileOwner, Mode=TwoWay}" /> - - - - - - Date: Sat, 1 May 2021 14:44:52 +0200 Subject: [PATCH 3/5] Reduce calls to StorageFolder methods Hide progress bar after enumeration --- Files/MultilingualResources/Files.ar.xlf | 12 -- Files/MultilingualResources/Files.cs-CZ.xlf | 12 -- Files/MultilingualResources/Files.da-DK.xlf | 12 -- Files/MultilingualResources/Files.da.xlf | 12 -- Files/MultilingualResources/Files.de-DE.xlf | 12 -- Files/MultilingualResources/Files.es-ES.xlf | 12 -- Files/MultilingualResources/Files.fr-FR.xlf | 12 -- Files/MultilingualResources/Files.he-IL.xlf | 12 -- Files/MultilingualResources/Files.hi-IN.xlf | 12 -- Files/MultilingualResources/Files.hu-HU.xlf | 12 -- Files/MultilingualResources/Files.it-IT.xlf | 12 -- Files/MultilingualResources/Files.ja-JP.xlf | 12 -- Files/MultilingualResources/Files.ko-KR.xlf | 12 -- Files/MultilingualResources/Files.lv-LV.xlf | 12 -- Files/MultilingualResources/Files.nl-NL.xlf | 12 -- Files/MultilingualResources/Files.or-IN.xlf | 12 -- Files/MultilingualResources/Files.pl-PL.xlf | 12 -- Files/MultilingualResources/Files.pt-BR.xlf | 12 -- Files/MultilingualResources/Files.pt-PT.xlf | 12 -- Files/MultilingualResources/Files.ru-RU.xlf | 12 -- Files/MultilingualResources/Files.sv-SE.xlf | 12 -- Files/MultilingualResources/Files.ta.xlf | 12 -- Files/MultilingualResources/Files.tr-TR.xlf | 12 -- Files/MultilingualResources/Files.uk-UA.xlf | 12 -- Files/MultilingualResources/Files.zh-Hans.xlf | 12 -- Files/MultilingualResources/Files.zh-Hant.xlf | 12 -- Files/Strings/ar/Resources.resw | 3 - Files/Strings/cs-CZ/Resources.resw | 3 - Files/Strings/da-DK/Resources.resw | 9 - Files/Strings/da/Resources.resw | 3 - Files/Strings/de-DE/Resources.resw | 9 - Files/Strings/es-ES/Resources.resw | 9 - Files/Strings/fr-FR/Resources.resw | 9 - Files/Strings/he-IL/Resources.resw | 3 - Files/Strings/hu-HU/Resources.resw | 9 - Files/Strings/it-IT/Resources.resw | 9 - Files/Strings/ja-JP/Resources.resw | 9 - Files/Strings/ko-KR/Resources.resw | 9 - Files/Strings/lv-LV/Resources.resw | 9 - Files/Strings/pl-PL/Resources.resw | 9 - Files/Strings/pt-BR/Resources.resw | 9 - Files/Strings/pt-PT/Resources.resw | 9 - Files/Strings/ru-RU/Resources.resw | 9 - Files/Strings/sv-SE/Resources.resw | 3 - Files/Strings/tr-TR/Resources.resw | 9 - Files/Strings/uk-UA/Resources.resw | 9 - Files/Strings/zh-Hans/Resources.resw | 9 - Files/Strings/zh-Hant/Resources.resw | 9 - Files/ViewModels/ItemViewModel.cs | 158 ++++++++++-------- 49 files changed, 85 insertions(+), 553 deletions(-) diff --git a/Files/MultilingualResources/Files.ar.xlf b/Files/MultilingualResources/Files.ar.xlf index 98cedb07784f..2ef0277b0332 100644 --- a/Files/MultilingualResources/Files.ar.xlf +++ b/Files/MultilingualResources/Files.ar.xlf @@ -1844,10 +1844,6 @@ Original path المسار الأصلي - - Cache files and folders for better performance - ملفات ومجلدات ذاكرة التخزين المؤقت لأداء أفضل - Add إضافة @@ -2243,14 +2239,6 @@ Disconnect قطع الاتصال - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.cs-CZ.xlf b/Files/MultilingualResources/Files.cs-CZ.xlf index bb3b177890be..2bf557abd1e0 100644 --- a/Files/MultilingualResources/Files.cs-CZ.xlf +++ b/Files/MultilingualResources/Files.cs-CZ.xlf @@ -1859,10 +1859,6 @@ Original path Umístění - - Cache files and folders for better performance - Indexovat soubory a složky pro lepší výkon - Add Přidat @@ -2260,14 +2256,6 @@ Disconnect Odpojit - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.da-DK.xlf b/Files/MultilingualResources/Files.da-DK.xlf index 5691f1df602a..280c438790cb 100644 --- a/Files/MultilingualResources/Files.da-DK.xlf +++ b/Files/MultilingualResources/Files.da-DK.xlf @@ -1836,10 +1836,6 @@ Original path Oprindelig sti - - Cache files and folders for better performance - Cache filer og mapper for bedre ydeevne - Add Tilføj @@ -2233,14 +2229,6 @@ Disconnect Afbryd forbindelsen - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Forebyggende cache parallel grænse (mindre værdier burde virke bedre på harddiske) - - - Use preemptive cache (preload entries in child directories on navigation) - Brug forebyggende cache (forudindlæs elementer i undermapper under navigation) - More bundles options Flere samlingsindstillinger diff --git a/Files/MultilingualResources/Files.da.xlf b/Files/MultilingualResources/Files.da.xlf index b996ba523ce6..372b845c1dac 100644 --- a/Files/MultilingualResources/Files.da.xlf +++ b/Files/MultilingualResources/Files.da.xlf @@ -1844,10 +1844,6 @@ Original path Oprindelig sti - - Cache files and folders for better performance - Cache filer og mapper for bedre ydeevne - Add Tilføj @@ -2241,14 +2237,6 @@ Disconnect Afbryd forbindelsen - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index 88f16b024558..2636c4c017e7 100644 --- a/Files/MultilingualResources/Files.de-DE.xlf +++ b/Files/MultilingualResources/Files.de-DE.xlf @@ -1832,10 +1832,6 @@ Remove Entfernen - - Cache files and folders for better performance - Dateien und Ordner zwischenspeichern, um die Leistung zu verbessern - Cancel Abbrechen @@ -2228,14 +2224,6 @@ Disconnect Verbindung trennen - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Anzahl an vorzeitigen Zwischenspeichervorgängen (Ein kleinerer Wert ist für Festplatten empfohlen) - - - Use preemptive cache (preload entries in child directories on navigation) - Vorzeitiges Zwischenspeichern aktivieren (Einträge in Unterverzeichnissen werden beim Navigieren vorgeladen) - More bundles options Mehr Gruppenoptionen diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index f5f0eaa36475..9c597e7d7d9e 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -1834,10 +1834,6 @@ Remove Quitar - - Cache files and folders for better performance - Almacenar archivos y carpetas en caché para mejorar el rendimiento - Cancel Cancelar @@ -2231,14 +2227,6 @@ Disconnect Desconectar - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Límite paralelo de caché preventivo (números más pequeños deberían funcionar mejor para discos duros) - - - Use preemptive cache (preload entries in child directories on navigation) - Usar caché preventivo (precarga entradas en directorios secundarios en la navegación) - More bundles options Más opciones de contenedores diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index bd43457de7ff..fdf8a3c2b4f1 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -1834,10 +1834,6 @@ Remove Enlever - - Cache files and folders for better performance - Mettre en cache les fichiers et dossiers pour de meilleures performantes - Cancel Annuler @@ -2231,14 +2227,6 @@ Disconnect Déconnecter - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Limite parallèle du cache préventif (des nombres plus petits devraient mieux fonctionner pour les disques durs) - - - Use preemptive cache (preload entries in child directories on navigation) - Utiliser le cache préventif (précharger les entrées dans les dossiers enfants lors de la navigation) - More bundles options Plus d'options de bundles diff --git a/Files/MultilingualResources/Files.he-IL.xlf b/Files/MultilingualResources/Files.he-IL.xlf index 57c2ffc820e4..39b353c389da 100644 --- a/Files/MultilingualResources/Files.he-IL.xlf +++ b/Files/MultilingualResources/Files.he-IL.xlf @@ -1843,10 +1843,6 @@ Remove הסר - - Cache files and folders for better performance - לשיפור ביצועים שמור קבצים ותיקיות בזכרון מטמון - Cancel ביטול @@ -2240,14 +2236,6 @@ Disconnect התנתק - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.hi-IN.xlf b/Files/MultilingualResources/Files.hi-IN.xlf index c4683502b9f9..e2302b247cdf 100644 --- a/Files/MultilingualResources/Files.hi-IN.xlf +++ b/Files/MultilingualResources/Files.hi-IN.xlf @@ -1839,10 +1839,6 @@ Original path Original path - - Cache files and folders for better performance - Cache files and folders for better performance - Add जोड़ें @@ -2247,14 +2243,6 @@ Disconnect डिस्कनेक्ट करें - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index bb295f278ed4..bb629219d4e7 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1840,10 +1840,6 @@ Remove Törlés - - Cache files and folders for better performance - Fájlok és mappák gyorsítótárazása a jobb teljesítményért - Cancel Mégse @@ -2244,14 +2240,6 @@ Disconnect Szétkapcsolás - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Előzetes gyorsítótár szálak maximális száma (kisebb érték jobb lehet HDD esetén) - - - Use preemptive cache (preload entries in child directories on navigation) - Előzetes gyorsítótárazás (almappák beolvasása navigáláskor) - More bundles options További munkaterület lehetőségek diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index 4b9c52235e8a..43141030c310 100644 --- a/Files/MultilingualResources/Files.it-IT.xlf +++ b/Files/MultilingualResources/Files.it-IT.xlf @@ -1836,10 +1836,6 @@ Remove Rimuovi - - Cache files and folders for better performance - Memorizza file e cartelle nella cache per migliorare le prestazioni - Cancel Annulla @@ -2233,14 +2229,6 @@ Disconnect Disconnetti - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Limite di parallelizzazione della cache predittiva (per un hard disk è consigliato un numero piccolo) - - - Use preemptive cache (preload entries in child directories on navigation) - Usa cache predittiva (precarica le sottocartelle durante la navigazione) - More bundles options Altre opzioni dei gruppi diff --git a/Files/MultilingualResources/Files.ja-JP.xlf b/Files/MultilingualResources/Files.ja-JP.xlf index dcddac175701..c685dc122bca 100644 --- a/Files/MultilingualResources/Files.ja-JP.xlf +++ b/Files/MultilingualResources/Files.ja-JP.xlf @@ -1835,10 +1835,6 @@ Remove 削除 - - Cache files and folders for better performance - よりよいパフォーマンスのためにファイルとフォルダをキャッシュ - Cancel キャンセル @@ -2232,14 +2228,6 @@ Disconnect 切断 - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - ファイルを予めキャッシュする量の上限(HDDには小さな値を推奨) - - - Use preemptive cache (preload entries in child directories on navigation) - ファイルを予めキャッシュ(サブフォルダのファイルをプリロード) - More bundles options その他のバンドル オプション diff --git a/Files/MultilingualResources/Files.ko-KR.xlf b/Files/MultilingualResources/Files.ko-KR.xlf index 4d90e5a6ae9d..30b3df4f14a9 100644 --- a/Files/MultilingualResources/Files.ko-KR.xlf +++ b/Files/MultilingualResources/Files.ko-KR.xlf @@ -1844,10 +1844,6 @@ Original path 원래 위치 - - Cache files and folders for better performance - 파일, 폴더를 캐싱하여 성능 개선 - Add 추가 @@ -2233,14 +2229,6 @@ Disconnect 연결 끊기 - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - 선점적 캐시 병렬 실행 제한 (하드 드라이브에는 숫자가 적을수록 좋습니다) - - - Use preemptive cache (preload entries in child directories on navigation) - 선점적 캐시 사용 (탐색 시 하위 폴더 내 항목을 미리 로딩합니다) - More bundles options 추가 보관함 옵션 diff --git a/Files/MultilingualResources/Files.lv-LV.xlf b/Files/MultilingualResources/Files.lv-LV.xlf index 46968b644cce..9fc7ba7a8ba0 100644 --- a/Files/MultilingualResources/Files.lv-LV.xlf +++ b/Files/MultilingualResources/Files.lv-LV.xlf @@ -1853,14 +1853,6 @@ Original path Oriģinālais ceļš - - Cache files and folders for better performance - Ātrdarbībai glabāt failus un mapes kešatmiņā - - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preventīās kešatmiņas paralēlais ierobežojums (mazākam skaitlim vajadzētu strādāt labāk uz cietajiem diskiem) - Add Pievienot @@ -2254,10 +2246,6 @@ Disconnect Atvienot - - Use preemptive cache (preload entries in child directories on navigation) - Izmantot preventīvu saglabāšanu kešatmiņā (preventīvi ielādēt apakšvienumus) - More bundles options Papildus saišķu opcijas diff --git a/Files/MultilingualResources/Files.nl-NL.xlf b/Files/MultilingualResources/Files.nl-NL.xlf index 9cde52cfb30a..bc1e22befbe9 100644 --- a/Files/MultilingualResources/Files.nl-NL.xlf +++ b/Files/MultilingualResources/Files.nl-NL.xlf @@ -1836,10 +1836,6 @@ Remove Wissen - - Cache files and folders for better performance - Cache files and folders for better performance - Cancel Annuleren @@ -2232,14 +2228,6 @@ Disconnect Verbinding verbreken - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.or-IN.xlf b/Files/MultilingualResources/Files.or-IN.xlf index 8cb8bb0880c9..1e06567f934a 100644 --- a/Files/MultilingualResources/Files.or-IN.xlf +++ b/Files/MultilingualResources/Files.or-IN.xlf @@ -1851,10 +1851,6 @@ Remove ଅପସାରଣ - - Cache files and folders for better performance - Cache files and folders for better performance - Cancel ବାତିଲ୍ @@ -2247,14 +2243,6 @@ Disconnect ବିଚ୍ଛିନ୍ନ - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index bc65c2d2882d..f0f3e922a20f 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -1846,10 +1846,6 @@ Remove Usuń - - Cache files and folders for better performance - Buforuj pliki i foldery dla lepszej wydajności - Cancel Anuluj @@ -2246,14 +2242,6 @@ Disconnect Odłącz - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Równoległy limit wyprzedzającego buforowania pamięci podręcznej (mniejsza ilość powinna działać lepiej dla dysków twardych) - - - Use preemptive cache (preload entries in child directories on navigation) - Używaj wyprzedzającego buforowania (wstępne wczytywanie wpisów w podrzędnych katalogach podczas nawigacji) - More bundles options Więcej opcji paczek diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index e445cff2246a..2b7e698846ec 100644 --- a/Files/MultilingualResources/Files.pt-BR.xlf +++ b/Files/MultilingualResources/Files.pt-BR.xlf @@ -1846,10 +1846,6 @@ Remove Remover - - Cache files and folders for better performance - Armazene arquivos e pastas em cache para melhor desempenho - Cancel Cancelar @@ -2190,14 +2186,6 @@ Disconnect Desconectar - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Limite preventivo paralelo de cache (números menores devem funcionar melhor para discos rígidos) - - - Use preemptive cache (preload entries in child directories on navigation) - Usar cache preemptivo (entradas de pré-carregamento em diretórios filho na navegação) - More bundles options Mais opções de pacotes diff --git a/Files/MultilingualResources/Files.pt-PT.xlf b/Files/MultilingualResources/Files.pt-PT.xlf index 36b08aee8c2b..9254f61a36cf 100644 --- a/Files/MultilingualResources/Files.pt-PT.xlf +++ b/Files/MultilingualResources/Files.pt-PT.xlf @@ -1848,10 +1848,6 @@ Remove Remover - - Cache files and folders for better performance - Armazene ficheiros e pastas em cache para melhor desempenho - Cancel Cancelar @@ -2247,14 +2243,6 @@ Disconnect Desconectar - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Limite preventivo paralelo de cache (números menores devem funcionar melhor para discos rígidos) - - - Use preemptive cache (preload entries in child directories on navigation) - Usar cache preemptivo (entradas de pré-carregamento em diretórios filho na navegação) - More bundles options Mais opções de pacotes diff --git a/Files/MultilingualResources/Files.ru-RU.xlf b/Files/MultilingualResources/Files.ru-RU.xlf index 68987ae8dca5..dc39dac5f57e 100644 --- a/Files/MultilingualResources/Files.ru-RU.xlf +++ b/Files/MultilingualResources/Files.ru-RU.xlf @@ -1844,10 +1844,6 @@ Remove Убрать - - Cache files and folders for better performance - Кэшировать файлы и папки для повышения производительности - Cancel Отмена @@ -2244,14 +2240,6 @@ Disconnect Отключить - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Параллельный предел кэша (меньшие числа должны работать лучше для жестких дисков) - - - Use preemptive cache (preload entries in child directories on navigation) - Использовать кеш (предварительная загрузка записей в дочерних каталогах при навигации) - More bundles options Опции Коллекций diff --git a/Files/MultilingualResources/Files.sv-SE.xlf b/Files/MultilingualResources/Files.sv-SE.xlf index 5f8c513ce875..3e4030adc03b 100644 --- a/Files/MultilingualResources/Files.sv-SE.xlf +++ b/Files/MultilingualResources/Files.sv-SE.xlf @@ -1852,10 +1852,6 @@ Original path Ursprunglig plats - - Cache files and folders for better performance - Lagra filer och mappar i cache för bättre prestanda - Add Lägg till @@ -2244,14 +2240,6 @@ Disconnect Koppla från - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.ta.xlf b/Files/MultilingualResources/Files.ta.xlf index 37e945e47abe..13d3c564e13a 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -1850,10 +1850,6 @@ Remove அகற்று - - Cache files and folders for better performance - Cache files and folders for better performance - Cancel ரத்து @@ -2246,14 +2242,6 @@ Disconnect துண்டி - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - - - Use preemptive cache (preload entries in child directories on navigation) - Use preemptive cache (preload entries in child directories on navigation) - More bundles options More bundles options diff --git a/Files/MultilingualResources/Files.tr-TR.xlf b/Files/MultilingualResources/Files.tr-TR.xlf index d5d451627204..d72c4000d71f 100644 --- a/Files/MultilingualResources/Files.tr-TR.xlf +++ b/Files/MultilingualResources/Files.tr-TR.xlf @@ -1837,10 +1837,6 @@ Remove Sil - - Cache files and folders for better performance - Daha iyi başarım için dosya ve klasörler ön belleğe alınsın - Cancel İptal @@ -2234,14 +2230,6 @@ Disconnect Bağlantıyı kes - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Hazırlık ön belleği paralel sınırı (sabit sürücüler için daha küçük değerler daha iyi olmalıdır) - - - Use preemptive cache (preload entries in child directories on navigation) - Hazırlık ön belleği kullanılsın (gezinirken alt klasör kayıtları önceden yüklenir) - More bundles options Diğer paket seçenekleri diff --git a/Files/MultilingualResources/Files.uk-UA.xlf b/Files/MultilingualResources/Files.uk-UA.xlf index 642d72ce45b6..3354de8df074 100644 --- a/Files/MultilingualResources/Files.uk-UA.xlf +++ b/Files/MultilingualResources/Files.uk-UA.xlf @@ -1844,10 +1844,6 @@ Remove Вилучити - - Cache files and folders for better performance - Кешувати файли та папки для швидшої роботи - Cancel Скасувати @@ -2244,14 +2240,6 @@ Disconnect Відключити - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - Обмеження кеш-пам’яті (менші числа повинні працювати краще для жорстких дисків) - - - Use preemptive cache (preload entries in child directories on navigation) - Використовувати кеш (попередньо завантажувати записи в дочірні каталоги на навігації) - More bundles options Опції Колекцій diff --git a/Files/MultilingualResources/Files.zh-Hans.xlf b/Files/MultilingualResources/Files.zh-Hans.xlf index 63177ac5b9c4..2683d450a395 100644 --- a/Files/MultilingualResources/Files.zh-Hans.xlf +++ b/Files/MultilingualResources/Files.zh-Hans.xlf @@ -1836,10 +1836,6 @@ Remove 移除 - - Cache files and folders for better performance - 缓存文件和文件夹以获取更好的性能 - Cancel 取消 @@ -2233,14 +2229,6 @@ Disconnect 断开连接 - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - 抢占式缓存并发限制(对硬盘驱动器更小的数字更好) - - - Use preemptive cache (preload entries in child directories on navigation) - 使用抢占式缓存(浏览时预加载子文件夹项目) - More bundles options 更多包选项 diff --git a/Files/MultilingualResources/Files.zh-Hant.xlf b/Files/MultilingualResources/Files.zh-Hant.xlf index 9a612121f0ae..b4125489bb70 100644 --- a/Files/MultilingualResources/Files.zh-Hant.xlf +++ b/Files/MultilingualResources/Files.zh-Hant.xlf @@ -1836,10 +1836,6 @@ Remove 移除 - - Cache files and folders for better performance - 快取檔案及資料夾以獲得更佳的效能 - Cancel 取消 @@ -2233,14 +2229,6 @@ Disconnect 中斷連線 - - Preemptive cache parallel limit (smaller numbers should work better for hard drives) - 「主動式快取」最多可同時執行的執行續 (較小的數量應該會在硬碟上運作得比較好) - - - Use preemptive cache (preload entries in child directories on navigation) - 啟用主動式快取 (在瀏覽資料夾時預先載入子資料夾的內容) - More bundles options 更多綁定選項 diff --git a/Files/Strings/ar/Resources.resw b/Files/Strings/ar/Resources.resw index 2b20aada8e7b..fba407058337 100644 --- a/Files/Strings/ar/Resources.resw +++ b/Files/Strings/ar/Resources.resw @@ -1368,9 +1368,6 @@ المسار الأصلي - - ملفات ومجلدات ذاكرة التخزين المؤقت لأداء أفضل - إضافة diff --git a/Files/Strings/cs-CZ/Resources.resw b/Files/Strings/cs-CZ/Resources.resw index e268c9d3fd80..0454e750253a 100644 --- a/Files/Strings/cs-CZ/Resources.resw +++ b/Files/Strings/cs-CZ/Resources.resw @@ -1377,9 +1377,6 @@ Umístění - - Indexovat soubory a složky pro lepší výkon - Přidat diff --git a/Files/Strings/da-DK/Resources.resw b/Files/Strings/da-DK/Resources.resw index 892827048ec0..8579c3db0936 100644 --- a/Files/Strings/da-DK/Resources.resw +++ b/Files/Strings/da-DK/Resources.resw @@ -1380,9 +1380,6 @@ Oprindelig sti - - Cache filer og mapper for bedre ydeevne - Tilføj @@ -1677,12 +1674,6 @@ Afbryd forbindelsen - - Forebyggende cache parallel grænse (mindre værdier burde virke bedre på harddiske) - - - Brug forebyggende cache (forudindlæs elementer i undermapper under navigation) - Flere samlingsindstillinger diff --git a/Files/Strings/da/Resources.resw b/Files/Strings/da/Resources.resw index eb7f65319420..3482534e5274 100644 --- a/Files/Strings/da/Resources.resw +++ b/Files/Strings/da/Resources.resw @@ -1380,9 +1380,6 @@ Oprindelig sti - - Cache filer og mapper for bedre ydeevne - Tilføj diff --git a/Files/Strings/de-DE/Resources.resw b/Files/Strings/de-DE/Resources.resw index 41ba58377d00..d2d6de1dd296 100644 --- a/Files/Strings/de-DE/Resources.resw +++ b/Files/Strings/de-DE/Resources.resw @@ -1380,9 +1380,6 @@ Entfernen - - Dateien und Ordner zwischenspeichern, um die Leistung zu verbessern - Abbrechen @@ -1677,12 +1674,6 @@ Verbindung trennen - - Anzahl an vorzeitigen Zwischenspeichervorgängen (Ein kleinerer Wert ist für Festplatten empfohlen) - - - Vorzeitiges Zwischenspeichern aktivieren (Einträge in Unterverzeichnissen werden beim Navigieren vorgeladen) - Mehr Gruppenoptionen diff --git a/Files/Strings/es-ES/Resources.resw b/Files/Strings/es-ES/Resources.resw index cce21bb59132..761ddfb60906 100644 --- a/Files/Strings/es-ES/Resources.resw +++ b/Files/Strings/es-ES/Resources.resw @@ -1368,9 +1368,6 @@ Quitar - - Almacenar archivos y carpetas en caché para mejorar el rendimiento - Cancelar @@ -1665,12 +1662,6 @@ Desconectar - - Límite paralelo de caché preventivo (números más pequeños deberían funcionar mejor para discos duros) - - - Usar caché preventivo (precarga entradas en directorios secundarios en la navegación) - Más opciones de contenedores diff --git a/Files/Strings/fr-FR/Resources.resw b/Files/Strings/fr-FR/Resources.resw index d10c46052e24..c9e5d5b11b40 100644 --- a/Files/Strings/fr-FR/Resources.resw +++ b/Files/Strings/fr-FR/Resources.resw @@ -1353,9 +1353,6 @@ Enlever - - Mettre en cache les fichiers et dossiers pour de meilleures performantes - Annuler @@ -1647,12 +1644,6 @@ Déconnecter - - Limite parallèle du cache préventif (des nombres plus petits devraient mieux fonctionner pour les disques durs) - - - Utiliser le cache préventif (précharger les entrées dans les dossiers enfants lors de la navigation) - Plus d'options de bundles diff --git a/Files/Strings/he-IL/Resources.resw b/Files/Strings/he-IL/Resources.resw index 22f0f9d96d47..8a8bf2d1a0be 100644 --- a/Files/Strings/he-IL/Resources.resw +++ b/Files/Strings/he-IL/Resources.resw @@ -1128,9 +1128,6 @@ הסר - - לשיפור ביצועים שמור קבצים ותיקיות בזכרון מטמון - ביטול diff --git a/Files/Strings/hu-HU/Resources.resw b/Files/Strings/hu-HU/Resources.resw index 90c274c1bfee..b09a679299ce 100644 --- a/Files/Strings/hu-HU/Resources.resw +++ b/Files/Strings/hu-HU/Resources.resw @@ -1377,9 +1377,6 @@ Törlés - - Fájlok és mappák gyorsítótárazása a jobb teljesítményért - Mégse @@ -1677,12 +1674,6 @@ Szétkapcsolás - - Előzetes gyorsítótár szálak maximális száma (kisebb érték jobb lehet HDD esetén) - - - Előzetes gyorsítótárazás (almappák beolvasása navigáláskor) - További munkaterület lehetőségek diff --git a/Files/Strings/it-IT/Resources.resw b/Files/Strings/it-IT/Resources.resw index 68a5095d65f6..fbe136d59434 100644 --- a/Files/Strings/it-IT/Resources.resw +++ b/Files/Strings/it-IT/Resources.resw @@ -1380,9 +1380,6 @@ Rimuovi - - Memorizza file e cartelle nella cache per migliorare le prestazioni - Annulla @@ -1677,12 +1674,6 @@ Disconnetti - - Limite di parallelizzazione della cache predittiva (per un hard disk è consigliato un numero piccolo) - - - Usa cache predittiva (precarica le sottocartelle durante la navigazione) - Altre opzioni dei gruppi diff --git a/Files/Strings/ja-JP/Resources.resw b/Files/Strings/ja-JP/Resources.resw index 710d09050cf6..fd8a021780b6 100644 --- a/Files/Strings/ja-JP/Resources.resw +++ b/Files/Strings/ja-JP/Resources.resw @@ -1371,9 +1371,6 @@ 削除 - - よりよいパフォーマンスのためにファイルとフォルダをキャッシュ - キャンセル @@ -1668,12 +1665,6 @@ 切断 - - ファイルを予めキャッシュする量の上限(HDDには小さな値を推奨) - - - ファイルを予めキャッシュ(サブフォルダのファイルをプリロード) - その他のバンドル オプション diff --git a/Files/Strings/ko-KR/Resources.resw b/Files/Strings/ko-KR/Resources.resw index 349d1e52fd77..61489dc7337a 100644 --- a/Files/Strings/ko-KR/Resources.resw +++ b/Files/Strings/ko-KR/Resources.resw @@ -1386,9 +1386,6 @@ 원래 위치 - - 파일, 폴더를 캐싱하여 성능 개선 - 추가 @@ -1677,12 +1674,6 @@ 연결 끊기 - - 선점적 캐시 병렬 실행 제한 (하드 드라이브에는 숫자가 적을수록 좋습니다) - - - 선점적 캐시 사용 (탐색 시 하위 폴더 내 항목을 미리 로딩합니다) - 추가 보관함 옵션 diff --git a/Files/Strings/lv-LV/Resources.resw b/Files/Strings/lv-LV/Resources.resw index 351aaf2918ff..9f6591afc1b6 100644 --- a/Files/Strings/lv-LV/Resources.resw +++ b/Files/Strings/lv-LV/Resources.resw @@ -1392,12 +1392,6 @@ Oriģinālais ceļš - - Ātrdarbībai glabāt failus un mapes kešatmiņā - - - Preventīās kešatmiņas paralēlais ierobežojums (mazākam skaitlim vajadzētu strādāt labāk uz cietajiem diskiem) - Pievienot @@ -1692,9 +1686,6 @@ Atvienot - - Izmantot preventīvu saglabāšanu kešatmiņā (preventīvi ielādēt apakšvienumus) - Papildus saišķu opcijas diff --git a/Files/Strings/pl-PL/Resources.resw b/Files/Strings/pl-PL/Resources.resw index f20bb40a4406..79b9d150d2ae 100644 --- a/Files/Strings/pl-PL/Resources.resw +++ b/Files/Strings/pl-PL/Resources.resw @@ -1374,9 +1374,6 @@ Usuń - - Buforuj pliki i foldery dla lepszej wydajności - Anuluj @@ -1668,12 +1665,6 @@ Odłącz - - Równoległy limit wyprzedzającego buforowania pamięci podręcznej (mniejsza ilość powinna działać lepiej dla dysków twardych) - - - Używaj wyprzedzającego buforowania (wstępne wczytywanie wpisów w podrzędnych katalogach podczas nawigacji) - Więcej opcji paczek diff --git a/Files/Strings/pt-BR/Resources.resw b/Files/Strings/pt-BR/Resources.resw index 0c69b87cf21e..ea06d179a34f 100644 --- a/Files/Strings/pt-BR/Resources.resw +++ b/Files/Strings/pt-BR/Resources.resw @@ -1380,9 +1380,6 @@ Remover - - Armazene arquivos e pastas em cache para melhor desempenho - Cancelar @@ -1635,12 +1632,6 @@ Desconectar - - Limite preventivo paralelo de cache (números menores devem funcionar melhor para discos rígidos) - - - Usar cache preemptivo (entradas de pré-carregamento em diretórios filho na navegação) - Mais opções de pacotes diff --git a/Files/Strings/pt-PT/Resources.resw b/Files/Strings/pt-PT/Resources.resw index f7e621fd1036..cc08668e98ab 100644 --- a/Files/Strings/pt-PT/Resources.resw +++ b/Files/Strings/pt-PT/Resources.resw @@ -1380,9 +1380,6 @@ Remover - - Armazene ficheiros e pastas em cache para melhor desempenho - Cancelar @@ -1677,12 +1674,6 @@ Desconectar - - Limite preventivo paralelo de cache (números menores devem funcionar melhor para discos rígidos) - - - Usar cache preemptivo (entradas de pré-carregamento em diretórios filho na navegação) - Mais opções de pacotes diff --git a/Files/Strings/ru-RU/Resources.resw b/Files/Strings/ru-RU/Resources.resw index 385eda6637ed..e8b062bbd07d 100644 --- a/Files/Strings/ru-RU/Resources.resw +++ b/Files/Strings/ru-RU/Resources.resw @@ -1341,9 +1341,6 @@ Убрать - - Кэшировать файлы и папки для повышения производительности - Отмена @@ -1638,12 +1635,6 @@ Отключить - - Параллельный предел кэша (меньшие числа должны работать лучше для жестких дисков) - - - Использовать кеш (предварительная загрузка записей в дочерних каталогах при навигации) - Опции Коллекций diff --git a/Files/Strings/sv-SE/Resources.resw b/Files/Strings/sv-SE/Resources.resw index f93062bd352b..ad02b95753fe 100644 --- a/Files/Strings/sv-SE/Resources.resw +++ b/Files/Strings/sv-SE/Resources.resw @@ -1386,9 +1386,6 @@ Ursprunglig plats - - Lagra filer och mappar i cache för bättre prestanda - Lägg till diff --git a/Files/Strings/tr-TR/Resources.resw b/Files/Strings/tr-TR/Resources.resw index adeb83499efc..00c49196e5ff 100644 --- a/Files/Strings/tr-TR/Resources.resw +++ b/Files/Strings/tr-TR/Resources.resw @@ -1380,9 +1380,6 @@ Sil - - Daha iyi başarım için dosya ve klasörler ön belleğe alınsın - İptal @@ -1677,12 +1674,6 @@ Bağlantıyı kes - - Hazırlık ön belleği paralel sınırı (sabit sürücüler için daha küçük değerler daha iyi olmalıdır) - - - Hazırlık ön belleği kullanılsın (gezinirken alt klasör kayıtları önceden yüklenir) - Diğer paket seçenekleri diff --git a/Files/Strings/uk-UA/Resources.resw b/Files/Strings/uk-UA/Resources.resw index 7c9f5007a1a6..7ee8418cbfc1 100644 --- a/Files/Strings/uk-UA/Resources.resw +++ b/Files/Strings/uk-UA/Resources.resw @@ -1335,9 +1335,6 @@ Вилучити - - Кешувати файли та папки для швидшої роботи - Скасувати @@ -1632,12 +1629,6 @@ Відключити - - Обмеження кеш-пам’яті (менші числа повинні працювати краще для жорстких дисків) - - - Використовувати кеш (попередньо завантажувати записи в дочірні каталоги на навігації) - Опції Колекцій diff --git a/Files/Strings/zh-Hans/Resources.resw b/Files/Strings/zh-Hans/Resources.resw index 1cd71e120435..51d833a90693 100644 --- a/Files/Strings/zh-Hans/Resources.resw +++ b/Files/Strings/zh-Hans/Resources.resw @@ -1380,9 +1380,6 @@ 移除 - - 缓存文件和文件夹以获取更好的性能 - 取消 @@ -1677,12 +1674,6 @@ 断开连接 - - 抢占式缓存并发限制(对硬盘驱动器更小的数字更好) - - - 使用抢占式缓存(浏览时预加载子文件夹项目) - 更多包选项 diff --git a/Files/Strings/zh-Hant/Resources.resw b/Files/Strings/zh-Hant/Resources.resw index 1aac46744dc5..dec944ccdea3 100644 --- a/Files/Strings/zh-Hant/Resources.resw +++ b/Files/Strings/zh-Hant/Resources.resw @@ -1350,9 +1350,6 @@ 移除 - - 快取檔案及資料夾以獲得更佳的效能 - 取消 @@ -1647,12 +1644,6 @@ 中斷連線 - - 「主動式快取」最多可同時執行的執行續 (較小的數量應該會在硬碟上運作得比較好) - - - 啟用主動式快取 (在瀏覽資料夾時預先載入子資料夾的內容) - 更多綁定選項 diff --git a/Files/ViewModels/ItemViewModel.cs b/Files/ViewModels/ItemViewModel.cs index e5819e591fc6..33b967b26512 100644 --- a/Files/ViewModels/ItemViewModel.cs +++ b/Files/ViewModels/ItemViewModel.cs @@ -62,18 +62,13 @@ public class ItemViewModel : INotifyPropertyChanged, IDisposable public event EventHandler DirectoryInfoUpdated; - private string customPath; - private IFileListCache fileListCache = FileListCacheController.GetInstance(); private NamedPipeAsAppServiceConnection Connection; public string WorkingDirectory { - get - { - return currentStorageFolder?.Path ?? customPath; - } + get; private set; } private StorageFolderWithPath currentStorageFolder; @@ -91,12 +86,11 @@ public string WorkingDirectory public event ItemLoadStatusChangedEventHandler ItemLoadStatusChanged; - public async Task SetWorkingDirectoryAsync(string value) + public async Task SetWorkingDirectoryAsync(string value) { - var navigated = (FilesystemResult)true; if (string.IsNullOrWhiteSpace(value)) { - return new FilesystemResult(FileSystemStatusCode.NotAFolder); + return; } bool isLibrary = false; @@ -113,29 +107,12 @@ public async Task SetWorkingDirectoryAsync(string value) { workingRoot = null; currentStorageFolder = null; - customPath = value; } else if (!Path.IsPathRooted(WorkingDirectory) || Path.GetPathRoot(WorkingDirectory) != Path.GetPathRoot(value)) { workingRoot = await FilesystemTasks.Wrap(() => DrivesManager.GetRootFromPathAsync(value)); } - if (!isLibrary && Path.IsPathRooted(value)) - { - var res = await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(value, workingRoot, currentStorageFolder)); - if (res) - { - currentStorageFolder = res.Result; - customPath = null; - } - else - { - currentStorageFolder = null; - customPath = value; - } - navigated = res; - } - if (value == "Home" || value == "NewTab".GetLocalized()) { currentStorageFolder = null; @@ -145,8 +122,8 @@ public async Task SetWorkingDirectoryAsync(string value) App.JumpList.AddFolderToJumpList(value); } + WorkingDirectory = value; NotifyPropertyChanged(nameof(WorkingDirectory)); - return navigated; } public async Task> GetFolderFromPathAsync(string value) @@ -435,12 +412,20 @@ public async Task ApplyFilesAndFoldersChangesAsync() { if (filesAndFolders == null || filesAndFolders.Count == 0) { - await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(() => + Action action = () => { FilesAndFolders.Clear(); IsFolderEmptyTextDisplayed = FilesAndFolders.Count == 0; DirectoryInfoUpdated?.Invoke(this, EventArgs.Empty); - }); + }; + if (CoreApplication.MainView.DispatcherQueue.HasThreadAccess) + { + action(); + } + else + { + await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(action); + } return; } @@ -455,7 +440,7 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(() => // After calling BeginBulkOperation, ObservableCollection.CollectionChanged is suppressed // so modifies to FilesAndFolders won't trigger UI updates, hence below operations can be // run safely without needs of dispatching to UI thread - await Task.Run(() => + Action applyChangesAction = () => { var startIndex = -1; var tempList = new List(); @@ -505,21 +490,32 @@ void ApplyBulkInsertEntries() { FilesAndFolders.RemoveRange(filesAndFolders.Count, FilesAndFolders.Count - filesAndFolders.Count); } - }); + }; if (folderSettings.DirectoryGroupOption != GroupOption.None) { OrderGroups(); } - await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(() => + Action updateUIAction = () => { // trigger CollectionChanged with NotifyCollectionChangedAction.Reset // once loading is completed so that UI can be updated FilesAndFolders.EndBulkOperation(); IsFolderEmptyTextDisplayed = FilesAndFolders.Count == 0; DirectoryInfoUpdated?.Invoke(this, EventArgs.Empty); - }); + }; + + if (CoreApplication.MainView.DispatcherQueue.HasThreadAccess) + { + await Task.Run(applyChangesAction); + updateUIAction(); + } + else + { + applyChangesAction(); + await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(updateUIAction); + } } catch (Exception ex) { @@ -535,17 +531,27 @@ private Task OrderFilesAndFoldersAsync() return Task.CompletedTask; } - return Task.Run(() => + Action action = () => { if (filesAndFolders.Count == 0) { - return Task.CompletedTask; + return; } filesAndFolders = SortingHelper.OrderFileList(filesAndFolders, folderSettings.DirectorySortOption, folderSettings.DirectorySortDirection).ToList(); return Task.CompletedTask; }); + + if (CoreApplication.MainView.DispatcherQueue.HasThreadAccess) + { + return Task.Run(action); + } + else + { + action(); + return Task.CompletedTask; + } } private void OrderGroups(CancellationToken token = default) @@ -1035,18 +1041,12 @@ private async Task RapidAddItemsToCollection(string path, LibraryItem library = } else { - var storageFolder = currentStorageFolder; - if (Path.IsPathRooted(path)) - { - var res = await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(path)); - if (res) - { - storageFolder = res.Result; - } - } - if (await EnumerateItemsFromStandardFolderAsync(path, storageFolder, folderSettings.GetLayoutType(path, false), addFilesCTS.Token, library)) + if (await EnumerateItemsFromStandardFolderAsync(path, folderSettings.GetLayoutType(path, false), addFilesCTS.Token, library)) { + IsLoadingItems = false; // Hide progressbar after enumeration + // Is folder synced to cloud storage? + currentStorageFolder ??= await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(path)); var syncStatus = await CheckCloudDriveSyncStatusAsync(currentStorageFolder?.Item); PageTypeUpdated?.Invoke(this, new PageTypeUpdatedEventArgs() { IsTypeCloudDrive = syncStatus != CloudDriveSyncStatus.NotSynced && syncStatus != CloudDriveSyncStatus.Unknown }); @@ -1143,29 +1143,37 @@ await Task.Run(async () => } } - public async Task EnumerateItemsFromStandardFolderAsync(string path, StorageFolderWithPath storageFolderForGivenPath, Type sourcePageType, CancellationToken cancellationToken, LibraryItem library = null) + public async Task EnumerateItemsFromStandardFolderAsync(string path, Type sourcePageType, CancellationToken cancellationToken, LibraryItem library = null) { // Flag to use FindFirstFileExFromApp or StorageFolder enumeration bool enumFromStorageFolder = false; - StorageFolder rootFolder = null; - var res = await FilesystemTasks.Wrap(() => StorageFolder.GetFolderFromPathAsync(path).AsTask()); - if (res) + + if (FolderHelpers.CheckFolderAccessWithWin32(path)) { - rootFolder = res.Result; + // Will enumerate with FindFirstFileExFromApp, rootFolder only used for Bitlocker + currentStorageFolder = null; } else if (workingRoot != null) { - if (storageFolderForGivenPath == null) + var res = await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(path, workingRoot, currentStorageFolder)); + if (!res) { return false; } - rootFolder = storageFolderForGivenPath.Folder; + currentStorageFolder = res.Result; + rootFolder = currentStorageFolder.Folder; enumFromStorageFolder = true; } - else if (!FolderHelpers.CheckFolderAccessWithWin32(path)) // The folder is really inaccessible + else { - if (res == FileSystemStatusCode.Unauthorized) + var res = await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(path)); + if (res) + { + currentStorageFolder = res.Result; + rootFolder = currentStorageFolder.Folder; + } + else if (res == FileSystemStatusCode.Unauthorized) { //TODO: proper dialog await DialogDisplayHelper.ShowDialogAsync( @@ -1190,26 +1198,30 @@ await DialogDisplayHelper.ShowDialogAsync( ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; string returnformat = Enum.Parse(localSettings.Values[Constants.LocalSettings.DateTimeFormat].ToString()) == TimeStyle.Application ? "D" : "g"; - if (await FolderHelpers.CheckBitlockerStatusAsync(rootFolder, WorkingDirectory)) + if (Path.IsPathRooted(path) && Path.GetPathRoot(path) == path) { - var bitlockerDialog = new Files.Dialogs.BitlockerDialog(Path.GetPathRoot(WorkingDirectory)); - var bitlockerResult = await bitlockerDialog.ShowAsync(); - if (bitlockerResult == ContentDialogResult.Primary) + rootFolder ??= await FilesystemTasks.Wrap(() => StorageFolder.GetFolderFromPathAsync(path).AsTask()); + if (await FolderHelpers.CheckBitlockerStatusAsync(rootFolder, WorkingDirectory)) { - var userInput = bitlockerDialog.storedPasswordInput; - if (Connection != null) + var bitlockerDialog = new Files.Dialogs.BitlockerDialog(Path.GetPathRoot(WorkingDirectory)); + var bitlockerResult = await bitlockerDialog.ShowAsync(); + if (bitlockerResult == ContentDialogResult.Primary) { - var value = new ValueSet(); - value.Add("Arguments", "Bitlocker"); - value.Add("action", "Unlock"); - value.Add("drive", Path.GetPathRoot(path)); - value.Add("password", userInput); - await Connection.SendMessageAsync(value); - - if (await FolderHelpers.CheckBitlockerStatusAsync(rootFolder, WorkingDirectory)) + var userInput = bitlockerDialog.storedPasswordInput; + if (Connection != null) { - // Drive is still locked - await DialogDisplayHelper.ShowDialogAsync("BitlockerInvalidPwDialog/Title".GetLocalized(), "BitlockerInvalidPwDialog/Text".GetLocalized()); + var value = new ValueSet(); + value.Add("Arguments", "Bitlocker"); + value.Add("action", "Unlock"); + value.Add("drive", Path.GetPathRoot(path)); + value.Add("password", userInput); + await Connection.SendMessageAsync(value); + + if (await FolderHelpers.CheckBitlockerStatusAsync(rootFolder, WorkingDirectory)) + { + // Drive is still locked + await DialogDisplayHelper.ShowDialogAsync("BitlockerInvalidPwDialog/Title".GetLocalized(), "BitlockerInvalidPwDialog/Text".GetLocalized()); + } } } } @@ -1228,7 +1240,7 @@ await DialogDisplayHelper.ShowDialogAsync( LoadFolderGlyph = true, FileImage = null, LoadFileIcon = false, - ItemPath = string.IsNullOrEmpty(rootFolder.Path) ? storageFolderForGivenPath.Path : rootFolder.Path, + ItemPath = string.IsNullOrEmpty(rootFolder.Path) ? currentStorageFolder.Path : rootFolder.Path, LoadUnknownTypeGlyph = false, FileSize = null, FileSizeBytes = 0, @@ -1242,7 +1254,7 @@ await DialogDisplayHelper.ShowDialogAsync( } } CurrentFolder = currentFolder; - await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, storageFolderForGivenPath, sourcePageType, cancellationToken); + await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, currentStorageFolder, sourcePageType, cancellationToken); return true; } else @@ -1309,7 +1321,7 @@ await DialogDisplayHelper.ShowDialogAsync( } else if (hFile.ToInt64() == -1) { - await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, storageFolderForGivenPath, sourcePageType, cancellationToken); + await EnumFromStorageFolderAsync(path, currentFolder, rootFolder, currentStorageFolder, sourcePageType, cancellationToken); return false; } else From 6ae2564e25ff1254e258056610af796abbf47bb1 Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sat, 1 May 2021 18:56:45 +0200 Subject: [PATCH 4/5] Fix icons not loading on phone --- Files/ViewModels/ItemViewModel.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Files/ViewModels/ItemViewModel.cs b/Files/ViewModels/ItemViewModel.cs index 33b967b26512..81f51f026d5c 100644 --- a/Files/ViewModels/ItemViewModel.cs +++ b/Files/ViewModels/ItemViewModel.cs @@ -746,7 +746,7 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () => matchingStorageFile = await GetFileFromPathAsync(item.ItemPath); if (matchingStorageFile != null) { - if (!item.LoadFileIcon) // Loading icon from fulltrust process failed + if (fileIconInfo.IconData == null) // Loading icon from fulltrust process failed { using var Thumbnail = await matchingStorageFile.GetThumbnailAsync(ThumbnailMode.SingleItem, thumbnailSize, ThumbnailOptions.UseCurrentScale); using var headerThumbnail = loadGroupHeaderInfo && isFileTypeGroupMode ? await matchingStorageFile.GetThumbnailAsync(ThumbnailMode.DocumentsView, 36, ThumbnailOptions.UseCurrentScale) : null; @@ -754,9 +754,8 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () => { await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () => { - item.FileImage = new BitmapImage(); item.CustomIconData = await Thumbnail.ToByteArrayAsync(); - await item.FileImage.SetSourceAsync(Thumbnail); + item.FileImage = await item.CustomIconData.ToBitmapAsync(); item.LoadUnknownTypeGlyph = false; item.LoadFileIcon = true; }); From 95eecb3e4bc3031d83ec6e324503d1d0c9aa4605 Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sat, 15 May 2021 21:57:14 +0200 Subject: [PATCH 5/5] Fix merge conflicts --- Files/ViewModels/ItemViewModel.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Files/ViewModels/ItemViewModel.cs b/Files/ViewModels/ItemViewModel.cs index 81f51f026d5c..6804ce78ff1d 100644 --- a/Files/ViewModels/ItemViewModel.cs +++ b/Files/ViewModels/ItemViewModel.cs @@ -490,12 +490,12 @@ void ApplyBulkInsertEntries() { FilesAndFolders.RemoveRange(filesAndFolders.Count, FilesAndFolders.Count - filesAndFolders.Count); } - }; - if (folderSettings.DirectoryGroupOption != GroupOption.None) - { - OrderGroups(); - } + if (folderSettings.DirectoryGroupOption != GroupOption.None) + { + OrderGroups(); + } + }; Action updateUIAction = () => { @@ -539,9 +539,7 @@ private Task OrderFilesAndFoldersAsync() } filesAndFolders = SortingHelper.OrderFileList(filesAndFolders, folderSettings.DirectorySortOption, folderSettings.DirectorySortDirection).ToList(); - - return Task.CompletedTask; - }); + }; if (CoreApplication.MainView.DispatcherQueue.HasThreadAccess) {