mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-05 05:27:39 +03:00
Add CustomData::getKeyWithPrefix()
This commit is contained in:
parent
132ca42ec5
commit
9670a5e74e
5 changed files with 25 additions and 19 deletions
|
@ -602,7 +602,8 @@ QString BrowserService::storeKey(const QString& key)
|
|||
return {};
|
||||
}
|
||||
|
||||
contains = db->metadata()->customData()->contains(CustomData::BrowserKeyPrefix + id);
|
||||
contains =
|
||||
db->metadata()->customData()->contains(CustomData::getKeyWithPrefix(CustomData::BrowserKeyPrefix, id));
|
||||
if (contains) {
|
||||
dialogResult = MessageBox::warning(m_currentDatabaseWidget,
|
||||
tr("KeePassXC - Overwrite existing key?"),
|
||||
|
@ -615,8 +616,8 @@ QString BrowserService::storeKey(const QString& key)
|
|||
} while (contains && dialogResult == MessageBox::Cancel);
|
||||
|
||||
hideWindow();
|
||||
db->metadata()->customData()->set(CustomData::BrowserKeyPrefix + id, key);
|
||||
db->metadata()->customData()->set(QString("%1%2").arg(CustomData::Created, id),
|
||||
db->metadata()->customData()->set(CustomData::getKeyWithPrefix(CustomData::BrowserKeyPrefix, id), key);
|
||||
db->metadata()->customData()->set(CustomData::getKeyWithPrefix(CustomData::Created, id),
|
||||
QLocale::system().toString(Clock::currentDateTime(), QLocale::ShortFormat));
|
||||
return id;
|
||||
}
|
||||
|
@ -628,7 +629,7 @@ QString BrowserService::getKey(const QString& id)
|
|||
return {};
|
||||
}
|
||||
|
||||
return db->metadata()->customData()->value(CustomData::BrowserKeyPrefix + id);
|
||||
return db->metadata()->customData()->value(CustomData::getKeyWithPrefix(CustomData::BrowserKeyPrefix, id));
|
||||
}
|
||||
|
||||
#ifdef WITH_XC_BROWSER_PASSKEYS
|
||||
|
@ -1070,7 +1071,8 @@ QList<Entry*> BrowserService::searchEntries(const QString& siteUrl,
|
|||
// Check if database is connected with KeePassXC-Browser. If so, return browser key (otherwise empty)
|
||||
auto databaseConnected = [&](const QSharedPointer<Database>& db) {
|
||||
for (const StringPair& keyPair : keyList) {
|
||||
QString key = db->metadata()->customData()->value(CustomData::BrowserKeyPrefix + keyPair.first);
|
||||
const auto key = db->metadata()->customData()->value(
|
||||
CustomData::getKeyWithPrefix(CustomData::BrowserKeyPrefix, keyPair.first));
|
||||
if (!key.isEmpty() && keyPair.second == key) {
|
||||
return keyPair.first;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue