mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 00:09:53 -05:00
Don't ask when removing an empty URL
There is no harm to deleting an empty URL from the browser integration URL list when the user never set a value. It's a bit annoying, actually.
This commit is contained in:
parent
745f1befe9
commit
656e6d289a
@ -340,13 +340,19 @@ void EditEntryWidget::removeCurrentURL()
|
||||
QModelIndex index = m_browserUi->additionalURLsView->currentIndex();
|
||||
|
||||
if (index.isValid()) {
|
||||
auto name = m_additionalURLsDataModel->keyByIndex(index);
|
||||
auto url = m_entryAttributes->value(name);
|
||||
if (url != tr("<empty URL>")) {
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Confirm Removal"),
|
||||
tr("Are you sure you want to remove this URL?"),
|
||||
MessageBox::Remove | MessageBox::Cancel,
|
||||
MessageBox::Cancel);
|
||||
|
||||
if (result == MessageBox::Remove) {
|
||||
if (result != MessageBox::Remove) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_entryAttributes->remove(m_additionalURLsDataModel->keyByIndex(index));
|
||||
if (m_additionalURLsDataModel->rowCount() == 0) {
|
||||
m_browserUi->editURLButton->setEnabled(false);
|
||||
@ -354,7 +360,6 @@ void EditEntryWidget::removeCurrentURL()
|
||||
}
|
||||
setModified(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditEntryWidget::editCurrentURL()
|
||||
|
Loading…
Reference in New Issue
Block a user