mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-15 14:54:09 +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
|
@ -147,8 +147,17 @@ namespace IDE
|
||||||
{
|
{
|
||||||
DepInfo depInfo;
|
DepInfo depInfo;
|
||||||
mWatchedFiles.TryGetValue(fixedFilePath, out depInfo);
|
mWatchedFiles.TryGetValue(fixedFilePath, out depInfo);
|
||||||
|
if (depInfo == null)
|
||||||
|
{
|
||||||
|
if (changeType == .Deleted)
|
||||||
|
{
|
||||||
|
fixedFilePath.Append(IDEUtils.cNativeSlash);
|
||||||
|
mWatchedFiles.TryGetValue(fixedFilePath, out depInfo);
|
||||||
|
}
|
||||||
|
|
||||||
if (depInfo == null)
|
if (depInfo == null)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (depInfo.mContent != null)
|
if (depInfo.mContent != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -596,7 +596,17 @@ namespace IDE.ui
|
||||||
public void NewFolder(ProjectFolder folder)
|
public void NewFolder(ProjectFolder folder)
|
||||||
{
|
{
|
||||||
ProjectFolder projectFolder = new ProjectFolder();
|
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.mProject = folder.mProject;
|
||||||
projectFolder.mPath = new String();
|
projectFolder.mPath = new String();
|
||||||
if (folder.mParentFolder == null)
|
if (folder.mParentFolder == null)
|
||||||
|
@ -614,6 +624,14 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
if (projectFolder.mIncludeKind != .Auto)
|
if (projectFolder.mIncludeKind != .Auto)
|
||||||
projectFolder.mProject.SetChanged();
|
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)
|
public void NewClass(ProjectFolder folder)
|
||||||
|
@ -1310,6 +1328,8 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
if (File.Delete(filePath) case .Ok)
|
if (File.Delete(filePath) case .Ok)
|
||||||
return true;
|
return true;
|
||||||
|
if (Directory.Delete(filePath) case .Ok)
|
||||||
|
return true;
|
||||||
|
|
||||||
fileErrorCount++;
|
fileErrorCount++;
|
||||||
const int maxErrorLen = 4096;
|
const int maxErrorLen = 4096;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue