Files changed in IJ Project shown in red

If you open an IJ project where one or more of the files have been moved or deleted and are no longer in their path where they were when the project was saved… the missing files aren’t shown in red in IJ until you delete or move at least one of the files in the project to trigger IJ to rescan/repaint.

Rail

Adding a call to checkFileStatus() in the ProjectTreeItemBase constructor fixes the problem…

    ProjectTreeItemBase (const Project::Item& projectItem)
        : item (projectItem), isFileMissing (false)
    {
        item.state.addListener (this);
    
        checkFileStatus();
    }

Rail

Ok, but checkFileStatus is a virtual function, so calling it in the base class constructor isn't the best thing to do.

AFAICT it does get called after the tree is loaded though - when I tried removing a file, it did appear in red. It'll also refresh all the file statuses whenever the introjucer app gains focus. Any clues on how I can reproduce what you're seeing?

Create a new IJ project, save it. Close IJ. Rename one of the source files in Finder or Windows Explorer… Reopen IJ and load the project. The renamed file isn’t shown in red unless you move it in IJ or make the change I posted above.

OSX 10.8.5 and Windows 8.1

Rail

Aah… It only happens if the files are in a group and the group is closed. If the group is open then IJ updates the display.

Rail

Maybe it needs to do a refresh in addSubItems or somewhere?

Probably in ProjectTreeItemBase::itemOpennessChanged() or ProjectTreeItemBase::refreshSubItems()

Rail