Skip to content

Revised watch list item insertion.#139

Merged
dreamsyntax merged 4 commits intoaldelaro5:masterfrom
cristian64:revised_watch_list_item_insertion
May 16, 2024
Merged

Revised watch list item insertion.#139
dreamsyntax merged 4 commits intoaldelaro5:masterfrom
cristian64:revised_watch_list_item_insertion

Conversation

@cristian64
Copy link
Copy Markdown
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
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