bug: fix tree model pointer exception and performance#2333
Merged
Conversation
Add null checks before accessing item.data in choose_data() and lessThan() methods to prevent AttributeError when QModelIndex returns None from internalPointer() during sorting operations.
2 tasks
Refactor FileTreeModel to batch item additions in a single model reset cycle instead of resetting per item. For archives with ~5,400 files, this reduces model resets from 5,400 to 1. - Extract _addItemInternal() for core add logic without signals - Update addItems() to wrap all additions in single begin/endResetModel - Update parse_json_lines() in extract_dialog.py to use batch API - Update parse_diff_json() and parse_diff_lines() in diff_result.py
Add isomtime field to test data default dictionary so tests work regardless of borg_compat.version state. The code uses either mtime or isomtime depending on borg version, so providing both ensures tests pass when run in isolation or alongside other tests.
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.
Add null checks before accessing item.data in choose_data() and lessThan() methods to prevent AttributeError when QModelIndex returns None from internalPointer() during sorting operations.
Fixes #2249