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

Fix EntryView and PreviewView to automatically update when the database changes #7041

Merged
merged 1 commit into from
Oct 17, 2021

Conversation

Aetf
Copy link
Contributor

@Aetf Aetf commented Oct 12, 2021

This addresses the concern in #6943 (comment).

DatabaseWidget::deleteEntries does the following things:

  1. select row above after deletion
  2. refresh the search
  3. update preview view

This PR removes 2 and 3 by connecting them to appropriate signals.

A little explanation of why 1 is kept:

Qt already handles selection and current item updates during row removal: when a row is removed, the current item is updated to one of the remaining items; and the row is simply removed from the set of selected rows. This is already the behavior we want in most cases.
The code in 1 additionally makes the new current item the new selection. This is useful in the UI as the user can keep delete entries but is not so useful otherwise.

Testing strategy

Type of change

  • ✅ Refactor (significant modification to existing code)

@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2021

Codecov Report

Merging #7041 (684d565) into develop (b6716bd) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #7041   +/-   ##
========================================
  Coverage    63.61%   63.62%           
========================================
  Files          330      330           
  Lines        41807    41804    -3     
========================================
  Hits         26595    26595           
+ Misses       15212    15209    -3     
Impacted Files Coverage Δ
src/gui/DatabaseWidget.cpp 61.62% <100.00%> (-0.01%) ⬇️
src/core/Entry.cpp 83.89% <0.00%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6716bd...684d565. Read the comment docs.

@droidmonkey droidmonkey added the pr: refactoring Pull request that refactors code label Oct 17, 2021
@droidmonkey droidmonkey merged commit 8b6d0e4 into keepassxreboot:develop Oct 17, 2021
@Aetf Aetf deleted the refactor/delete-entry branch January 25, 2022 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: refactoring Pull request that refactors code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants