Commits

bitsquid committed fde43e8

Fix for files which have been deleted remaining in cache.

Comments (0)

Files changed (2)

header_hero/Data/SourceFile.cs

         public List<string> SystemIncludes { get; set; }
         public List<string> AbsoluteIncludes { get; set; }
         public int Lines { get; set; }
-       
+        public bool Touched { get; set; }
+
         public SourceFile()
         {
             LocalIncludes = new List<string>();
             SystemIncludes = new List<string>();
             AbsoluteIncludes = new List<string>();
             Lines = 0;
+            Touched = false;
         }
     }
 }

header_hero/Parser/Scanner.cs

         {
             feedback.Title = "Scanning directories...";
 
+            foreach (Data.SourceFile sf in _project.Files.Values)
+                sf.Touched = false;
+
             foreach (string dir in _project.ScanDirectories)
             {
                 feedback.Message = dir;
                     ScanFile(fi);
                 }
             }
+
+            foreach (var it in _project.Files.Where(kvp => !kvp.Value.Touched).ToList())
+                _project.Files.Remove(it.Key);
         }
         
         void ScanDirectory(DirectoryInfo di, ProgressFeedback feedback)
                 _project.Files[path] = sf;
             }
 
+            sf.Touched = true;
             sf.AbsoluteIncludes.Clear();
 
             string local_dir = Path.GetDirectoryName(path);