Repository navigation
Reset File Explorer model on build/session events - #7
Merged
Merged
Conversation
Add FileExplorer.reset_model to reinitialize the QFileSystemModel, set the root path, and clean up the old model to avoid stale views or leaks. Call reset_model when setting the content directory after loading a build, after clearing a build's folder, and after cleaning content from the BuildList UI so the file tree refreshes properly. Also update CHANGELOG.md with a v2.0.1 entry noting the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix FileExplorer showing empty content after folder recreate operations by forcing
QFileSystemModelreset.Problem
QFileSystemModelmaintains watchers to deleted directory inodes, causing empty views when folders are recreated.Solution
Added
FileExplorer.reset_model()method that recreates the model and releases stale filesystem watchers.Called
reset_model()after all destructive operations:cleanCurrentBuildFolder()(Clear button)onNewSession()(New Session menu)onCleanContent()(Clean Content context menu)Existing methods like
setRootPath()don't release inode watchers—full model replacement is required.