Skip to content

PoC: delete folder feature (Reference Only)#10

Draft
AlchemistMist wants to merge 6 commits into
ZeromusXYZ:masterfrom
AlchemistMist:added-folder-delete-feature
Draft

PoC: delete folder feature (Reference Only)#10
AlchemistMist wants to merge 6 commits into
ZeromusXYZ:masterfrom
AlchemistMist:added-folder-delete-feature

Conversation

@AlchemistMist
Copy link
Copy Markdown

title

Copy link
Copy Markdown
Owner

@ZeromusXYZ ZeromusXYZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the bug regarding folder deletion when using
Edit -> Delete selected file ...

Comment thread AAPakEditor/AAPakEditor.sln Outdated
Comment thread AAPakEditor/Forms/MainForm.cs Outdated
}

private void MMEditDeleteFolder_Click(object sender, EventArgs e)
{
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation error.
On most of the functions you added btw.

Comment thread AAPakEditor/Forms/MainForm.cs Outdated
}

if (!(lbFiles.SelectedItem is FileListEntry fle))
// --- NEW LOGIC START ---
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I get what your intention is here. This breaks the program functionality.
You will no longer be able to delete just 1 file from a "folder" as this check will take priority over the single file check.
You always have a folder node selected in tvFolders before you can even select a single file.
It's best to just revert this part of the code.

Comment thread AAPakEditor/Forms/MainForm.cs Outdated
return;
var filename = _currentFileViewFolder;
if (filename != "") filename += "/";
filename += lbFiles.SelectedItem.ToString();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never just simply concat file paths by using string additions. Use Path.Combine() instead and account for the slash/backslash issue using replace.

Comment thread AAPakEditor/Forms/MainForm.cs Outdated
if (filename != "") filename += "/";
filename += lbFiles.SelectedItem.ToString();

if (!(lbFiles.SelectedItem is FileListEntry fle))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can write this as

if (lbFiles.SelectedItem is not FileListEntry fle)

which is less confusing to read.

@ZeromusXYZ ZeromusXYZ added enhancement New feature or request good first issue Good for newcomers labels Apr 9, 2026
Copy link
Copy Markdown
Owner

@ZeromusXYZ ZeromusXYZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality wise it now does indeed correctly use the file/directory if you picked the corresponding menu item.
However, you can not delete directories from the "Flat Folder View" tab this way.

Comment thread AAPakEditor/Forms/MainForm.cs Outdated
PreviewForm.Instance?.Close();
return;
}
else
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what editor you are using, but it's not a good one if it messes up indentations where you didn't even change code.

@AlchemistMist AlchemistMist marked this pull request as draft April 14, 2026 01:18
MMEditDeleteFolder_Click is it's own function now
@AlchemistMist AlchemistMist changed the title added delete folder feature PoC: delete folder feature (Reference Only) Apr 14, 2026
@AlchemistMist
Copy link
Copy Markdown
Author

updated title and changed to draft

i think i fixed most of the issues.
Indentation was from copy/paste

just sharing feature, i'll fix more if you want to add it to main.
otherwise feel free to close the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants