mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-23 00:10:37 -05:00
Fix opening files from command line
* Fix #2877 - password is unchecked by default * Smarter activation of key components based on contents of text entry fields * Prevent multiple copies of the same database from opening when the canonicalFileName != fileName
This commit is contained in:
parent
52d411f423
commit
edef225eab
4 changed files with 35 additions and 19 deletions
|
|
@ -157,10 +157,8 @@ void DatabaseTabWidget::addDatabaseTab(const QString& filePath,
|
|||
for (int i = 0, c = count(); i < c; ++i) {
|
||||
auto* dbWidget = databaseWidgetFromIndex(i);
|
||||
Q_ASSERT(dbWidget);
|
||||
if (dbWidget && dbWidget->database()->filePath() == canonicalFilePath) {
|
||||
if (!password.isEmpty()) {
|
||||
dbWidget->performUnlockDatabase(password, keyfile);
|
||||
}
|
||||
if (dbWidget && dbWidget->database()->canonicalFilePath() == canonicalFilePath) {
|
||||
dbWidget->performUnlockDatabase(password, keyfile);
|
||||
if (!inBackground) {
|
||||
// switch to existing tab if file is already open
|
||||
setCurrentIndex(indexOf(dbWidget));
|
||||
|
|
@ -171,9 +169,7 @@ void DatabaseTabWidget::addDatabaseTab(const QString& filePath,
|
|||
|
||||
auto* dbWidget = new DatabaseWidget(QSharedPointer<Database>::create(filePath), this);
|
||||
addDatabaseTab(dbWidget, inBackground);
|
||||
if (!password.isEmpty()) {
|
||||
dbWidget->performUnlockDatabase(password, keyfile);
|
||||
}
|
||||
dbWidget->performUnlockDatabase(password, keyfile);
|
||||
updateLastDatabases(filePath);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue