mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-26 17:46:47 -05:00
Fix support for referenced URL fields
This commit is contained in:
parent
7f33868d14
commit
82c1bf4ddb
5 changed files with 49 additions and 23 deletions
|
|
@ -885,7 +885,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();
|
||||
|
|
@ -1363,21 +1363,6 @@ bool BrowserService::checkLegacySettings(QSharedPointer<Database> db)
|
|||
return dialogResult == MessageBox::Yes;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -161,7 +161,6 @@ private:
|
|||
QString getDatabaseRootUuid();
|
||||
QString getDatabaseRecycleBinUuid();
|
||||
bool checkLegacySettings(QSharedPointer<Database> db);
|
||||
QStringList getEntryURLs(const Entry* entry);
|
||||
void hideWindow() const;
|
||||
void raiseWindow(const bool force = false);
|
||||
|
||||
|
|
|
|||
|
|
@ -377,16 +377,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