Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised watch list item insertion. #139

Merged

Conversation

cristian64
Copy link
Collaborator

  • Groups and watch items are now inserted below (or inside) the currently selected item.
  • Newly added items are automatically selected. If nested in a group, they are automatically expanded.
  • Paste action reuses the newly added functionality.

Fixes #129.

If multiple items are inserted, all of them are selected. The last item
will become the current focus item.
The newly introduced `MemWatchModel::addNodes()` method, which
efficiently inserts rows individually (as opposed to invalidating the
entire layout via `layoutChanged()`), is now used. This enables
`onRowsInserted()` to auto-select pasted rows.

Also, note that current selection (and not the current focus index) is
now used as insertion point when pasting items via `Ctrl+V`. On the
other hand, the **Paste** context menu action still uses the current
focus index (the index from which the context menu was deployed).

The memory leak around the `copiedRootNode` variable (which was never
freed before) has been addressed.
@cristian64 cristian64 force-pushed the revised_watch_list_item_insertion branch from 46806c0 to e9a5b08 Compare May 16, 2024 19:21
@dreamsyntax dreamsyntax merged commit ae7c268 into aldelaro5:master May 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: "Add group / Add watch" should add below selected index if watch node, or inside if group node
2 participants