Skip to content

Commit

Permalink
remove #if DEBUG statements
Browse files Browse the repository at this point in the history
  • Loading branch information
wharvex committed Aug 14, 2024
1 parent c09ee2d commit 267470d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
2 changes: 0 additions & 2 deletions src/Files.App/Services/Storage/StorageDevicesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public async IAsyncEnumerable<ILocatableFolder> 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)
Expand Down
14 changes: 0 additions & 14 deletions src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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))
Expand All @@ -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++)
{
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
{
Expand Down

0 comments on commit 267470d

Please sign in to comment.