mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Resolve placeholders in entry details url
This commit is contained in:
parent
8416d69f1e
commit
b9fd609bb2
@ -243,7 +243,8 @@ QString Entry::url() const
|
||||
|
||||
QString Entry::webUrl() const
|
||||
{
|
||||
return resolveUrl(m_attributes->value(EntryAttributes::URLKey));
|
||||
QString url = resolveMultiplePlaceholders(m_attributes->value(EntryAttributes::URLKey));
|
||||
return resolveUrl(url);
|
||||
}
|
||||
|
||||
QString Entry::username() const
|
||||
|
@ -110,10 +110,17 @@ void DetailsWidget::getSelectedEntry(Entry* selectedEntry)
|
||||
}
|
||||
|
||||
QString url = m_currentEntry->webUrl();
|
||||
if (url != "") {
|
||||
url = QString("<a href=\"%1\">%2</a>").arg(url).arg(shortUrl(url));
|
||||
if (!url.isEmpty()) {
|
||||
// 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));
|
||||
m_ui->urlLabel->setOpenExternalLinks(true);
|
||||
} else {
|
||||
// Fallback to the raw url string
|
||||
url = shortUrl(m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->url()));
|
||||
m_ui->urlLabel->setOpenExternalLinks(false);
|
||||
}
|
||||
|
@ -188,6 +188,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
@ -289,7 +292,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="usernameLabel"/>
|
||||
<widget class="QLabel" name="usernameLabel">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
|
Loading…
Reference in New Issue
Block a user