mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-08 06:22:53 -04:00
Fix support for referenced URL fields
This commit is contained in:
parent
c112ffc3fc
commit
c1720c3711
5 changed files with 50 additions and 23 deletions
|
@ -814,7 +814,7 @@ QList<Entry*> BrowserService::sortEntries(QList<Entry*>& entries, const QString&
|
|||
// Build map of prioritized entries
|
||||
QMultiMap<int, Entry*> priorities;
|
||||
for (auto* entry : entries) {
|
||||
priorities.insert(sortPriority(getEntryURLs(entry), siteUrl, formUrl), entry);
|
||||
priorities.insert(sortPriority(entry->getAllUrls(), siteUrl, formUrl), entry);
|
||||
}
|
||||
|
||||
auto keys = priorities.uniqueKeys();
|
||||
|
@ -1214,21 +1214,6 @@ QSharedPointer<Database> BrowserService::selectedDatabase()
|
|||
return getDatabase();
|
||||
}
|
||||
|
||||
QStringList BrowserService::getEntryURLs(const Entry* entry)
|
||||
{
|
||||
QStringList urlList;
|
||||
urlList << entry->url();
|
||||
|
||||
// Handle additional URL's
|
||||
for (const auto& key : entry->attributes()->keys()) {
|
||||
if (key.startsWith(ADDITIONAL_URL)) {
|
||||
urlList << entry->attributes()->value(key);
|
||||
}
|
||||
}
|
||||
|
||||
return urlList;
|
||||
}
|
||||
|
||||
void BrowserService::hideWindow() const
|
||||
{
|
||||
if (m_prevWindowState == WindowState::Minimized) {
|
||||
|
|
|
@ -159,7 +159,7 @@ private:
|
|||
QSharedPointer<Database> selectedDatabase();
|
||||
QString getDatabaseRootUuid();
|
||||
QString getDatabaseRecycleBinUuid();
|
||||
QStringList getEntryURLs(const Entry* entry);
|
||||
bool checkLegacySettings(QSharedPointer<Database> db);
|
||||
void hideWindow() const;
|
||||
void raiseWindow(const bool force = false);
|
||||
void updateWindowState();
|
||||
|
|
|
@ -372,16 +372,18 @@ QString Entry::url() const
|
|||
QStringList Entry::getAllUrls() const
|
||||
{
|
||||
QStringList urlList;
|
||||
auto entryUrl = url();
|
||||
|
||||
if (!url().isEmpty()) {
|
||||
urlList << url();
|
||||
if (!entryUrl.isEmpty()) {
|
||||
urlList << (EntryAttributes::matchReference(entryUrl).hasMatch() ? resolveMultiplePlaceholders(entryUrl)
|
||||
: entryUrl);
|
||||
}
|
||||
|
||||
for (const auto& key : m_attributes->keys()) {
|
||||
if (key.startsWith("KP2A_URL")) {
|
||||
auto additionalUrl = m_attributes->value(key);
|
||||
if (!additionalUrl.isEmpty()) {
|
||||
urlList << additionalUrl;
|
||||
urlList << resolveMultiplePlaceholders(additionalUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue