mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-27 00:35:27 -04:00
Add 'get-database-entries' Proxy Request (#7292)
This commit is contained in:
parent
56178f976a
commit
8a554b37c0
13 changed files with 110 additions and 1 deletions
|
@ -219,6 +219,35 @@ QJsonObject BrowserService::getDatabaseGroups()
|
|||
return result;
|
||||
}
|
||||
|
||||
QJsonArray BrowserService::getDatabaseEntries()
|
||||
{
|
||||
auto db = getDatabase();
|
||||
if (!db) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Group* rootGroup = db->rootGroup();
|
||||
if (!rootGroup) {
|
||||
return {};
|
||||
}
|
||||
|
||||
QJsonArray entries;
|
||||
for (const auto& group : rootGroup->groupsRecursive(true)) {
|
||||
if (group == db->metadata()->recycleBin()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const auto& entry : group->entries()) {
|
||||
QJsonObject jentry;
|
||||
jentry["title"] = entry->resolveMultiplePlaceholders(entry->title());
|
||||
jentry["uuid"] = entry->resolveMultiplePlaceholders(entry->uuidToHex());
|
||||
jentry["url"] = entry->resolveMultiplePlaceholders(entry->url());
|
||||
entries.push_back(jentry);
|
||||
}
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
QJsonObject BrowserService::createNewGroup(const QString& groupName)
|
||||
{
|
||||
auto db = getDatabase();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue