Add warning for duplicate URLs with Additional URLs list (#9588)

This commit is contained in:
Sami Vänttinen 2023-07-15 22:33:05 +03:00 committed by GitHub
parent 5dea019309
commit 9214ab2038
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 16 deletions

View file

@ -326,17 +326,18 @@ void EditEntryWidget::insertURL()
{
Q_ASSERT(!m_history);
QString name("KP2A_URL");
QString name(BrowserService::ADDITIONAL_URL);
int i = 1;
while (m_entryAttributes->keys().contains(name)) {
name = QString("KP2A_URL_%1").arg(i);
name = QString("%1_%2").arg(BrowserService::ADDITIONAL_URL, QString::number(i));
i++;
}
m_entryAttributes->set(name, tr("<empty URL>"));
QModelIndex index = m_additionalURLsDataModel->indexByKey(name);
m_additionalURLsDataModel->setEntryUrl(m_entry->url());
m_browserUi->additionalURLsView->setCurrentIndex(index);
m_browserUi->additionalURLsView->edit(index);