Wire ArchiveTableModel into ArchiveTab (QTableView migration, Phase 4 pt 1)#2519
Open
ebuzerdrmz44 wants to merge 6 commits into
Open
Wire ArchiveTableModel into ArchiveTab (QTableView migration, Phase 4 pt 1)#2519ebuzerdrmz44 wants to merge 6 commits into
ebuzerdrmz44 wants to merge 6 commits into
Conversation
Self-contained table model for archive rows: time/size/duration formatting, trigger icons, sort-role keys, and an editable name column, with isolated unit tests. Not yet wired into ArchiveTab.
…estore Trigger header
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.
Description
Wires the
ArchiveTableModelfrom #2517 intoArchiveTab, migrating the Archive tab from item-basedQTableWidgettoQTableView+QSortFilterProxyModel.Part of #2361 Phase 4.3088310Wire ArchiveTableModel into ArchiveTab2d61227Scope delete to repo, preserve scroll on refresh, ungate mount-openOnce #2517 lands I'll rebase onto master and the spike commits drop out.
Key changes:
.ui:QTableWidget→QTableView; sort viaQSortFilterProxyModel+setSortRole(SortRole)so non-string columns order by raw value, not lexically.selected_archives()helper readingArchiveRole: proxy-safe, so actions hit the right archive after sorting. All read sites (incl.archive_extract/archive_mount) route through it.view.edit()+ modeldataChanged;NoEditTriggersmakes the explicit edit the only editor entry.populate_from_profile(preserve_view=True)(keeps scroll offset instead of jumping to top); delete query scoped to repo.Related Issue
#2361 (Phase 4). Builds on #2517.
Motivation and Context
The item-based
QTableWidgetmixed data, formatting, and sort keys into widget items, which made sorting fragile (durations >24h sorted lexically, e.g.'1 day, …') and selection-after-sort error-prone. Moving to aQAbstractTableModel+ sort proxy separates data from presentation, fixes the sort-key bugs, and makes selection robust under sorting via a custom data role.How Has This Been Tested?
make test-unit(Borg 1.2.4) green, plus new tests for selection-after-sort and rename-failure revert. Manually checked sort → delete/rename hit the right archive.Screenshots (if appropriate):
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.