From 267470d2f840b558a00c1b238af3ac7466dfc081 Mon Sep 17 00:00:00 2001 From: Tim <81175852+wharvex@users.noreply.github.com> Date: Tue, 13 Aug 2024 23:35:44 -0400 Subject: [PATCH] remove `#if DEBUG` statements --- .../Services/Storage/StorageDevicesService.cs | 2 -- .../Cloud/Detector/GoogleDriveCloudDetector.cs | 14 -------------- 2 files changed, 16 deletions(-) diff --git a/src/Files.App/Services/Storage/StorageDevicesService.cs b/src/Files.App/Services/Storage/StorageDevicesService.cs index f3de3eecf766..8493a260c03c 100644 --- a/src/Files.App/Services/Storage/StorageDevicesService.cs +++ b/src/Files.App/Services/Storage/StorageDevicesService.cs @@ -24,9 +24,7 @@ public async IAsyncEnumerable GetDrivesAsync() var sw = Stopwatch.StartNew(); var googleDrivePath = GoogleDriveCloudDetector.GetRegistryBasePath(); sw.Stop(); -#if DEBUG Debug.WriteLine($"In RemovableDrivesService: Time elapsed for registry check: {sw.Elapsed}"); -#endif App.AppModel.GoogleDrivePath = googleDrivePath ?? string.Empty; foreach (var drive in list) diff --git a/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs index 4eab324fec79..8e60637cb153 100644 --- a/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs @@ -66,10 +66,8 @@ await FilesystemTasks.Wrap(() => StorageFile.GetFileFromPathAsync(Path.Combine(a var folder = await StorageFolder.GetFolderFromPathAsync(path); string title = reader["title"]?.ToString() ?? folder.Name; -#if DEBUG Debug.WriteLine("YIELD RETURNING from `GoogleDriveCloudDetector.GetProviders()` (roots): "); Debug.WriteLine($"Name: Google Drive ({title}); SyncFolder: {path}"); -#endif yield return new CloudProvider(CloudProviders.GoogleDrive) { @@ -94,10 +92,8 @@ await FilesystemTasks.Wrap(() => StorageFile.GetFileFromPathAsync(Path.Combine(a var folder = await StorageFolder.GetFolderFromPathAsync(path); string title = reader["name"]?.ToString() ?? folder.Name; -#if DEBUG Debug.WriteLine("YIELD RETURNING from `GoogleDriveCloudDetector.GetProviders` (media): "); Debug.WriteLine($"Name: {title}; SyncFolder: {path}"); -#endif yield return new CloudProvider(CloudProviders.GoogleDrive) { @@ -107,11 +103,9 @@ await FilesystemTasks.Wrap(() => StorageFile.GetFileFromPathAsync(Path.Combine(a }; } -#if DEBUG await Inspect(database, "SELECT * FROM roots", "root_preferences db, roots table"); await Inspect(database, "SELECT * FROM media", "root_preferences db, media table"); await Inspect(database, "SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY 1", "root_preferences db, all tables"); -#endif var registryPath = App.AppModel.GoogleDrivePath; if (!AddMyDriveToPathAndValidate(ref registryPath)) @@ -130,9 +124,7 @@ private static async Task Inspect(SqliteConnection database, string sqlCommand, var reader = await cmdTablesAll.ExecuteReaderAsync(); var colNamesList = Enumerable.Range(0, reader.FieldCount).Select(i => reader.GetName(i)).ToList(); -#if DEBUG Debug.WriteLine($"BEGIN LOGGING of {targetDescription}"); -#endif for (int rowIdx = 0; reader.Read() is not false; rowIdx++) { @@ -143,9 +135,7 @@ private static async Task Inspect(SqliteConnection database, string sqlCommand, .ToList().ForEach(s => Debug.WriteLine(s)); } -#if DEBUG Debug.WriteLine($"END LOGGING of {targetDescription} contents"); -#endif } private static JsonDocument? GetGoogleDriveRegValJson() @@ -199,10 +189,8 @@ private static async Task Inspect(SqliteConnection database, string sqlCommand, return null; } -#if DEBUG Debug.WriteLine("REGISTRY LOGGING"); Debug.WriteLine(googleDriveRegValJsonProperty.ToString()); -#endif var item = googleDriveRegValJsonProperty.Value.EnumerateArray().FirstOrDefault(); if (item.ValueKind == JsonValueKind.Undefined) @@ -287,10 +275,8 @@ private static bool AddMyDriveToPathAndValidate(ref string path) si.Name?.Equals("My Drive") ?? false) as ShellLink)?.TargetPath ?? string.Empty); -#if DEBUG Debug.WriteLine("SHELL FOLDER LOGGING"); rootFolder?.ForEach(si => Debug.WriteLine(si.Name)); -#endif if (!string.IsNullOrEmpty(myDriveFolder)) {