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

Add auto-save delay per database #9100

Merged

Commits on Jul 6, 2023

  1. Add autosaveDelay in Metadata

    Add a new propery autosaveDelay in Metadata of the db.
    The property is saved in customData to do not affect database structure as this setting is unique to keepasxc.
    The propery sets delay to wait since last modification before saving.
    
    Part of issue keepassxreboot#8553
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    01aa22b View commit details
    Browse the repository at this point in the history
  2. Add autosaveDelay to DatabaseSettings

    Add metadata propery autosaveDelay to the gui in the DatabaseSettings widget under General.
    User can change the delay in minutes.
    Add new translation strings as well.
    
    Part of issue keepassxreboot#8553
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    b94b05f View commit details
    Browse the repository at this point in the history
  3. Implement autosaveDelay in DatabaseWidget

    Implement a autosave delay functionality to the database widget.
    Added timer to track the delay and trigger a save on timeout using the new onAutosaveDelayTimeout function.
    Changed the onDatabaseModified to test for the new autosaveDelay property and delay the save if needed or extend the delay on new modifications.
    After menual save stop the timer to avoid saving when not needed edited in DatabaseWidget::save().
    
    Part of issue keepassxreboot#8553
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    35b3445 View commit details
    Browse the repository at this point in the history
  4. Add tests for autosaveDelay gui and metadata

    Try to toggle in gui, set a value, save it.
    Chcek value saved is currect in metadata.
    Check that on loading saved value presented in gui and toggeled.
    
    Part of issue keepassxreboot#8553
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    3e4830f View commit details
    Browse the repository at this point in the history
  5. Add tests for autosaveDelay functionality

    Test autosaveDelay makes delays as expected.
    Test delay timer reset after new modification before timeout.
    
    Part of issue keepassxreboot#8553
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    8b72648 View commit details
    Browse the repository at this point in the history
  6. Reduce autosaveDelay test time

    Minimize the test time by spying for signals and forwarding time rather then waiting the delay.
    Only wait where needed to finish modified signal timer
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    8d93ffd View commit details
    Browse the repository at this point in the history
  7. Refactor: customData keys defined as const

    Imrpove code readbility and reduce bug potential byt using static const Qstring for all customData keys in Metadata.
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    bb1409c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5e07824 View commit details
    Browse the repository at this point in the history
  9. fix: edge case - disable autosave delay after triggering a save

    User might trigger the autosave delay timer and disable autosave delay or autosave.
    This commmit fixes potential issues from the timer triggering after the feature is disabled.
    The timer now checks if the feature is still enabled when triggered.
    Adds tests for those edge cases as well
    jNullj committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    3629a11 View commit details
    Browse the repository at this point in the history