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

Cleanup config initialization, add local config options #5452

Merged
merged 1 commit into from
Sep 26, 2020

Conversation

droidmonkey
Copy link
Member

  • Fix Local config data is cleared when ~/.cache mounted on tempfs #5313, allow specifying local config path using environment variable and command line flag

  • Add command line flag --localconfig <path> to specify a file path to use for the local configuration settings.

  • Add environment variable support to set config files paths: KPXC_CONFIG and KPXC_CONFIG_LOCAL to override default locations.

  • Reorder startup sequence to load specified config files earlier to allow for theme settings and other early options to be picked up.

  • Removed old command line option --pw, no longer used.

  • Attempt a fix of application not closing when last window is gone. Only set QApplication::setQuitOnLastWindowClosed(true) when tray icon is enabled instead of always.

Replacement for #5325

Screenshots

Testing strategy

Tested on Windows

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)
  • ✅ Refactor (significant modification to existing code)

@droidmonkey droidmonkey added this to the v2.6.2 milestone Sep 20, 2020
* Fix #5313, allow specifying local config path using environment variable and command line flag
* Add command line flag `--localconfig <path>` to specify a file path to use for the local configuration settings.
* Add environment variable support to set config files paths: `KPXC_CONFIG` and `KPXC_CONFIG_LOCAL` to override default locations.
* Reorder startup sequence to load specified config files earlier to allow for theme settings and other early options to be picked up.
* Removed old command line option `--pw`, no longer used.

* Attempt a fix of application not closing when last window is gone. Only set `QApplication::setQuitOnLastWindowClosed(true)` when tray icon is enabled instead of always.
@kotoko
Copy link

kotoko commented Sep 20, 2020

When using variable KPXC_CONFIG_LOCAL should I set KPXC_CONFIG_LOCAL="~/.local/share" or KPXC_CONFIG_LOCAL="~/.local/share/keepassxc"?

@droidmonkey
Copy link
Member Author

Set it to whatever you want, but this points to a file not a directory.

@kotoko
Copy link

kotoko commented Sep 23, 2020

Oh... So I guess it should be KPXC_CONFIG_LOCAL="~/.local/share/keepassxc/keepassxc.ini". Last question: will it work if keepassxc folder does not exist?

@droidmonkey
Copy link
Member Author

Give it a try, test it out please

@kotoko
Copy link

kotoko commented Sep 24, 2020

OK. I tried to build keepassxc following readme (with cmake arguments -DWITH_XC_ALL=OFF -DCMAKE_BUILD_TYPE=Release) and got weird errors. For example:

/home/*****/build/CMakeFiles/CMakeTmp/src.cxx:2:44: error: too many arguments to function ‘size_t malloc_usable_size(void*)’
    2 |     int main() { malloc_usable_size(NULL, 0); return 0; }
      |                                            ^
In file included from /home/*****/build/CMakeFiles/CMakeTmp/src.cxx:1:
/usr/include/malloc.h:136:15: note: declared here
  136 | extern size_t malloc_usable_size (void *__ptr) __THROW;
      |               ^~~~~~~~~~~~~~~~~~

Given that I'm not interested in building and debugging keepassxc manually I'll just wait until this get merged to master and packaged by my linux distribution maintainers.

@phoerious
Copy link
Member

Last question: will it work if keepassxc folder does not exist?

QSettings creates directories if they don't exist.

@droidmonkey droidmonkey merged commit 9886b10 into release/2.6.2 Sep 26, 2020
@droidmonkey droidmonkey deleted the hotfix/cache-config branch September 26, 2020 13:26
phoerious added a commit that referenced this pull request Oct 21, 2020
Added

- Add option to keep window always on top to view menu [#5542]
- Move show/hide usernames and passwords to view menu [#5542]
- Add command line options and environment variables for changing the config locations [#5452]
- Include TOTP settings in CSV import/export and add support for ISO datetimes [#5346]

Changed

- Mask sensitive information in command execution confirmation prompt [#5542]
- SSH Agent: Avoid shortcut conflict on macOS by changing "Add key" to Ctrl+H on all platforms [#5484]

Fixed

- Prevent data loss with drag and drop between databases [#5536]
- Fix crash when toggling Capslock rapidly [#5545]
- Don't mark URL references as invalid URL [#5380]
- Reset entry preview after search [#5483]
- Set Qt::Dialog flag on database open dialog [#5356]
- Fix sorting of database report columns [#5426]
- Fix IfDevice matching logic [#5344]
- Fix layout issues and a stray scrollbar appearing on top of the entry edit screen [#5424]
- Fix tabbing into the notes field [#5424]
- Fix password generator ignoring settings on load [#5340]
- Restore natural entry sort order on application load [#5438]
- Fix paperclip and TOTP columns not saving state [#5327]
- Enforce fixed password font in entry preview [#5454]
- Add scrollbar when new database wizard exceeds screen size [#5560]
- Do not mark database as modified when viewing Auto-Type associations [#5542]
- CLI: Fix two heap-use-after-free crashes [#5368,#5470]
- Browser: Fix key exchange not working with multiple simultaneous users on Windows [#5485]
- Browser: Fix entry retrieval when "only best matching" is enabled [#5316]
- Browser: Ignore recycle bin on KeePassHTTP migration [#5481]
- KeeShare: Fix import crash [#5542]
- macOS: Fix toolbar theming and breadcrumb display issues [#5482]
- macOS: Fix file dialog randomly closing [#5479]
- macOS: Fix being unable to select OPVault files for import [#5341]
@phoerious phoerious added pr: bugfix Pull request that fixes a bug and removed bug labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: bugfix Pull request that fixes a bug ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants