Skip to content

Commit

Permalink
Refactoring: renamed RemDirs private field to RemItems to match its p…
Browse files Browse the repository at this point in the history
…urpose.
  • Loading branch information
xvitaly committed Sep 10, 2024
1 parent 2126e3c commit 4685b04
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/srcrepair/FrmRmWrk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace srcrepair.gui
{
/// <summary>
/// Class of recursive directory cleanup window.
/// Class of recursive files and directories cleanup window.
/// </summary>
public partial class FrmRmWrk : Form
{
Expand All @@ -25,9 +25,9 @@ public partial class FrmRmWrk : Form
private readonly Logger Logger = LogManager.GetCurrentClassLogger();

/// <summary>
/// Stores the list of directories for cleanup.
/// Stores the list of items for cleanup.
/// </summary>
private readonly List<string> RemDirs;
private readonly List<string> RemItems;

/// <summary>
/// Stores status of currently running process.
Expand All @@ -37,11 +37,11 @@ public partial class FrmRmWrk : Form
/// <summary>
/// FrmRmWrk class constructor.
/// </summary>
/// <param name="SL">List of directories for cleanup.</param>
/// <param name="SL">The list of files directories for cleanup.</param>
public FrmRmWrk(List<string> SL)
{
InitializeComponent();
RemDirs = SL;
RemItems = SL;
}

/// <summary>
Expand All @@ -51,7 +51,7 @@ public FrmRmWrk(List<string> SL)
private void CleanupFiles(IProgress<int> Progress)
{
// Searching for candidates...
List<string> DeleteQueue = FileManager.FindFiles(RemDirs);
List<string> DeleteQueue = FileManager.FindFiles(RemItems);

// Creating some counters...
int TotalFiles = DeleteQueue.Count;
Expand Down Expand Up @@ -79,18 +79,18 @@ private void CleanupFiles(IProgress<int> Progress)
}
}

// Removing empty directories after files removal...
foreach (string Dir in RemDirs)
// Removing empty directories after the files removal...
foreach (string Item in RemItems)
{
try
{
if (Directory.Exists(Dir))
if (Directory.Exists(Item))
{
FileManager.RemoveEmptyDirectories(Dir);
FileManager.RemoveEmptyDirectories(Item);
}
else if (File.Exists(Dir))
else if (File.Exists(Item))
{
FileManager.RemoveEmptyDirectories(Path.GetDirectoryName(Dir));
FileManager.RemoveEmptyDirectories(Path.GetDirectoryName(Item));
}
}
catch (Exception Ex)
Expand Down

0 comments on commit 4685b04

Please sign in to comment.