-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
added autoopen functionality (#477) #1053
Conversation
Much better! |
I would like some check on the file format since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I marked a bunch of minor things to fix.
Generally, this looks good otherwise, but I need to test it first and see if it works properly, also with auto-filled key file paths.
src/gui/DatabaseTabWidget.cpp
Outdated
Database* db = dbWidget->database(); | ||
Group *autoload = db->rootGroup()->findChildByName("AutoOpen"); | ||
if (autoload) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding style: pointer operator belongs to type, opening brace on same line as if.
src/gui/DatabaseTabWidget.cpp
Outdated
QDir dbFolder(dbpath.canonicalPath()); | ||
|
||
for (auto entry : autoload->entries()) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line here.
src/gui/DatabaseTabWidget.cpp
Outdated
continue; | ||
|
||
QFileInfo filepath; | ||
if (entry->url().startsWith("file:/")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be file:// (with a double slash)?
@TheZ3ro :
|
@alterratz I mean a check on the file format, if I try to open a keepassxc/src/format/KeePass2Reader.cpp Line 69 in 90468e8
😉 |
Please update your branch, so I can merge. Thanks! |
Updated it to current develop |
Finally got it working after realising from the code that "AutoOpen" is the name it's searching for. I must've missed the info about it being the same as KeeAutoExec... Got confused by the "autoload" in the description lol. |
Is this feature documented somewhere? ( https://duckduckgo.com/?q=keepassxc+auto+open ) |
How do we add a key file reference to the auto open vaults entries? |
Auto-open does not support key files |
Bug: auto open on a file that in turn auto-opens the first file gets into an endless loop. This will probably also work transitively. |
Don't do that |
implementation of #477 autoopen
If a folder (within the root folder) is named "AutoOpen", all entries within this folder are opened automatically
password: the password of the "slave" database
url: the file name of the database which can be:
file:///absolute/path.kdbx
/absolute/path.kdbx
path.kbdx (which is relative to the current db)
Did not test it on windows or osx but since Qt file
functions have been used I suppose it will work fine.
Description
iterated over all items in the AutoOpen folder in updateTabNameFromDbWidgetSender which is called after a db is opened
also had to change a few lines in DatabaseTabWidget::openDatabase to set passwords for already open databases or ignore databases which have their password set already.
Motivation and context
implements feature request #477
I use dependent DBs a lot and manually opening them sucks
How has this been tested?
created a few (8) databases linked them to the master (4) and other "slave" DBs (4) using different url styles and loaded the master db as well as slave DBs
tried it with some of them opened before loading the master as well.
built it with following settings:
cmake -DWITH_XC_AUTOTYPE=ON -DWITH_XC_HTTP=ON -DWITH_XC_YUBIKEY=ON -DWITH_TESTS=ON -DWITH_ASAN=ON -DCMAKE_BUILD_TYPE=Release ..
Screenshots (if appropriate):
Types of changes
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]