ide: don't show same file name message if other same-named files are excluded when...
authorRejean Loyer <redj@ecere.com>
Tue, 10 Jun 2014 17:58:18 +0000 (13:58 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 22 Dec 2015 05:06:08 +0000 (00:06 -0500)
ide/src/dialogs/NodeProperties.ec
ide/src/project/ProjectNode.ec

index 8a835c0..0f7ece0 100644 (file)
@@ -43,15 +43,18 @@ class NodeProperties : Window
    {
       char filePath[MAX_LOCATION];
       char * oldName = node.name;
+      Map<Platform, SetBool> exclusionInfo { };
 
       node.name = null;
       GetLastDirectory(name.contents, filePath);
-      if(topNode.Find(filePath, false))
+      topNode.CollectExclusionInfo(exclusionInfo, null);
+      if(topNode.FindSameNameConflict(name.contents, false, exclusionInfo, null))
       {
          MessageBox { type = ok, master = this, text = filePath, contents = $"File with same name already in project." }.Modal();
          node.name = oldName;
          return false;
       }
+      delete exclusionInfo;
       delete oldName;
       node.name = CopyString(filePath);
       if(node.type == file)
index c92c695..d08873a 100644 (file)
@@ -1420,7 +1420,7 @@ private:
 
    bool ContainsFilesWithExtension(const char * extension, ProjectConfig prjConfig)
    {
-      if(type == file)
+      if(type == file && name && name[0])
       {
          char ext[MAX_EXTENSION];
          GetExtension(name, ext);