mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed folder creation/deletion bugs
This commit is contained in:
parent
0b73451502
commit
0edc697e14
2 changed files with 31 additions and 2 deletions
|
@ -148,7 +148,16 @@ namespace IDE
|
|||
DepInfo depInfo;
|
||||
mWatchedFiles.TryGetValue(fixedFilePath, out depInfo);
|
||||
if (depInfo == null)
|
||||
return;
|
||||
{
|
||||
if (changeType == .Deleted)
|
||||
{
|
||||
fixedFilePath.Append(IDEUtils.cNativeSlash);
|
||||
mWatchedFiles.TryGetValue(fixedFilePath, out depInfo);
|
||||
}
|
||||
|
||||
if (depInfo == null)
|
||||
return;
|
||||
}
|
||||
|
||||
if (depInfo.mContent != null)
|
||||
{
|
||||
|
|
|
@ -596,7 +596,17 @@ namespace IDE.ui
|
|||
public void NewFolder(ProjectFolder folder)
|
||||
{
|
||||
ProjectFolder projectFolder = new ProjectFolder();
|
||||
projectFolder.mName.Set("New Folder");
|
||||
|
||||
int checkIdx = 0;
|
||||
while (true)
|
||||
{
|
||||
projectFolder.mName.Set("New folder");
|
||||
if (checkIdx > 0)
|
||||
projectFolder.mName.AppendF("{}", checkIdx + 1);
|
||||
if (!folder.mChildMap.ContainsKey(projectFolder.mName))
|
||||
break;
|
||||
checkIdx++;
|
||||
}
|
||||
projectFolder.mProject = folder.mProject;
|
||||
projectFolder.mPath = new String();
|
||||
if (folder.mParentFolder == null)
|
||||
|
@ -614,6 +624,14 @@ namespace IDE.ui
|
|||
}
|
||||
if (projectFolder.mIncludeKind != .Auto)
|
||||
projectFolder.mProject.SetChanged();
|
||||
|
||||
String fullPath = scope String();
|
||||
projectFolder.GetFullImportPath(fullPath);
|
||||
if (Directory.CreateDirectory(fullPath) case .Err(let err))
|
||||
{
|
||||
if (err != .AlreadyExists)
|
||||
gApp.Fail(scope String()..AppendF("Failed to create directory '{]'", fullPath));
|
||||
}
|
||||
}
|
||||
|
||||
public void NewClass(ProjectFolder folder)
|
||||
|
@ -1310,6 +1328,8 @@ namespace IDE.ui
|
|||
{
|
||||
if (File.Delete(filePath) case .Ok)
|
||||
return true;
|
||||
if (Directory.Delete(filePath) case .Ok)
|
||||
return true;
|
||||
|
||||
fileErrorCount++;
|
||||
const int maxErrorLen = 4096;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue