mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Cleaned up url display code
This commit is contained in:
parent
b9fd609bb2
commit
f3d85ae219
@ -247,6 +247,13 @@ QString Entry::webUrl() const
|
||||
return resolveUrl(url);
|
||||
}
|
||||
|
||||
QString Entry::displayUrl() const
|
||||
{
|
||||
QString url = maskPasswordPlaceholders(m_attributes->value(EntryAttributes::URLKey));
|
||||
url = resolveMultiplePlaceholders(url);
|
||||
return resolveUrl(url);
|
||||
}
|
||||
|
||||
QString Entry::username() const
|
||||
{
|
||||
return m_attributes->value(EntryAttributes::UserNameKey);
|
||||
|
@ -79,6 +79,7 @@ public:
|
||||
QString title() const;
|
||||
QString url() const;
|
||||
QString webUrl() const;
|
||||
QString displayUrl() const;
|
||||
QString username() const;
|
||||
QString password() const;
|
||||
QString notes() const;
|
||||
|
@ -114,10 +114,7 @@ void DetailsWidget::getSelectedEntry(Entry* selectedEntry)
|
||||
// URL is well formed and can be opened in a browser
|
||||
// create a new display url that masks password placeholders
|
||||
// the actual link will use the password
|
||||
QString displayUrl = m_currentEntry->url();
|
||||
displayUrl = m_currentEntry->maskPasswordPlaceholders(displayUrl);
|
||||
displayUrl = m_currentEntry->resolveMultiplePlaceholders(displayUrl);
|
||||
url = QString("<a href=\"%1\">%2</a>").arg(url).arg(shortUrl(displayUrl));
|
||||
url = QString("<a href=\"%1\">%2</a>").arg(url).arg(shortUrl(m_currentEntry->displayUrl()));
|
||||
m_ui->urlLabel->setOpenExternalLinks(true);
|
||||
} else {
|
||||
// Fallback to the raw url string
|
||||
@ -325,4 +322,4 @@ void DetailsWidget::updateTabIndex(int index) {
|
||||
} else {
|
||||
m_selectedTabEntry = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,8 +151,7 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
||||
}
|
||||
return result;
|
||||
case Url:
|
||||
result = entry->maskPasswordPlaceholders(entry->url());
|
||||
result = entry->resolveMultiplePlaceholders(result);
|
||||
result = entry->displayUrl();
|
||||
if (attr->isReference(EntryAttributes::URLKey)) {
|
||||
result.prepend(tr("Ref: ","Reference abbreviation"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user