keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

feat: Add {CLIENT_HOSTNAME} placeholder support for backup file patterns

Open ryan-steed-usa opened this issue 1 month ago • 2 comments

This request introduces a new placeholder {CLIENT_HOSTNAME} that can be used in database backup file patterns. The hostname of the client performing the database save operation will be substituted in place of this placeholder.

Changes include:

  • Documentation update to reference the new {CLIENT_HOSTNAME} placeholder in the Reference.adoc file
  • Implementation of hostname resolution using QHostInfo::localHostName() in Tools.cpp
  • Addition of Qt5::Network library dependency for both the autotype library and testtools unit test
  • New test cases to verify proper substitution of the {CLIENT_HOSTNAME} placeholder
  • Test case for escaped patterns to ensure they are not replaced
  • Updated existing test data to include CLIENT_HOSTNAME in multiple pattern replacement test

The feature enhances backup file naming flexibility by allowing users to include the client hostname in their backup file names, which is particularly useful in multi-machine environments.

Note: Generative AI was used only to summarize the commit log.

Screenshots

image

Testing strategy

  1. Added unit tests.
  2. Manually compiled and saved database multiple times to validate backup database filename.

Type of change

  • ✅ New feature (change that adds functionality)

ryan-steed-usa avatar Nov 21 '25 06:11 ryan-steed-usa

Should I have been notified of these build failures? Based on the output, they seem unrelated to my changes:

ninja: error: unknown target 'coverage'

and

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

Am I missing something, do I need to make changes? Thanks!

ryan-steed-usa avatar Nov 23 '25 17:11 ryan-steed-usa

Disregard those failures we had an issue with our CI

droidmonkey avatar Nov 23 '25 21:11 droidmonkey