mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 04:23:09 +00:00
Some fixes for file paths for newly added files
This commit is contained in:
parent
ded4dae5c1
commit
25aa49cc29
7 changed files with 19 additions and 5 deletions
Binary file not shown.
|
@ -197,9 +197,16 @@ namespace Toolbox.Library
|
|||
//Don't add the root file name
|
||||
if (parentNode.FullPath != string.Empty && !(parentNode is ArchiveRootNodeWrapper))
|
||||
{
|
||||
string FullPath = Path.Combine(parentNode.FullPath, FileName);
|
||||
FullPath = FullPath.Substring(FullPath.IndexOf("/", 1) + 1);
|
||||
Console.WriteLine($"FullPath {FullPath}");
|
||||
string nodePath = parentNode.FullPath;
|
||||
int startIndex = nodePath.IndexOf(rootNode.Text);
|
||||
if (startIndex > 0)
|
||||
nodePath = nodePath.Substring(startIndex);
|
||||
|
||||
string slash = Path.DirectorySeparatorChar.ToString();
|
||||
string slashAlt = Path.AltDirectorySeparatorChar.ToString();
|
||||
string SetPath = nodePath.Replace(rootNode.Text + slash, string.Empty).Replace(slash ?? "", slashAlt);
|
||||
|
||||
string FullPath = Path.Combine(SetPath, FileName).Replace(slash ?? "", slashAlt);
|
||||
File.ArchiveFileInfo.FileName = FullPath;
|
||||
}
|
||||
else
|
||||
|
@ -210,12 +217,12 @@ namespace Toolbox.Library
|
|||
|
||||
if (HasAddedFile)
|
||||
{
|
||||
parentNode.Nodes.Add(File);
|
||||
|
||||
if (parentNode is ArchiveRootNodeWrapper)
|
||||
((ArchiveRootNodeWrapper)parentNode).AddFileNode(File);
|
||||
if (parentNode is ArchiveFolderNodeWrapper)
|
||||
((ArchiveFolderNodeWrapper)parentNode).RootNode.AddFileNode(File);
|
||||
|
||||
parentNode.Nodes.Add(File);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,6 +201,13 @@ namespace Toolbox.Library
|
|||
public void AddFileNode(ArchiveFileWrapper fileWrapper)
|
||||
{
|
||||
FileNodes.Add(Tuple.Create(fileWrapper.ArchiveFileInfo, (TreeNode)fileWrapper));
|
||||
|
||||
string FullName = SetFullPath(fileWrapper, this);
|
||||
if (FullName != string.Empty)
|
||||
{
|
||||
Console.WriteLine($"Updating info {FullName}");
|
||||
fileWrapper.ArchiveFileInfo.FileName = FullName;
|
||||
}
|
||||
}
|
||||
|
||||
public ToolStripItem[] GetContextMenuItems()
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue