Commit 1c66477d authored by Jan Grulich's avatar Jan Grulich
Browse files

Remove the last occurrence of comma when entering DNS servers manually

parent c3397215
......@@ -418,7 +418,11 @@ void IPv4Widget::slotDnsServers()
listWidget->setItems(m_ui->dns->text().split(','));
if (dlg->exec() == KDialog::Accepted) {
m_ui->dns->setText(listWidget->items().join(","));
QString text = listWidget->items().join(",");
if (text.lastIndexOf(',') == text.length()-1) {
text.remove(text.length()-1, 1);
}
m_ui->dns->setText(text);
}
if (dlg) {
......@@ -436,7 +440,11 @@ void IPv4Widget::slotDnsDomains()
listWidget->setItems(m_ui->dnsSearch->text().split(','));
if (dlg->exec() == KDialog::Accepted) {
m_ui->dnsSearch->setText(listWidget->items().join(","));
QString text = listWidget->items().join(",");
if (text.lastIndexOf(',') == text.length()-1) {
text.remove(text.length()-1, 1);
}
m_ui->dnsSearch->setText(text);
}
if (dlg) {
......
......@@ -408,7 +408,11 @@ void IPv6Widget::slotDnsServers()
listWidget->setItems(m_ui->dns->text().split(','));
if (dlg->exec() == KDialog::Accepted) {
m_ui->dns->setText(listWidget->items().join(","));
QString text = listWidget->items().join(",");
if (text.lastIndexOf(',') == text.length()-1) {
text.remove(text.length()-1, 1);
}
m_ui->dns->setText(text);
}
if (dlg) {
......@@ -426,7 +430,11 @@ void IPv6Widget::slotDnsDomains()
listWidget->setItems(m_ui->dnsSearch->text().split(','));
if (dlg->exec() == KDialog::Accepted) {
m_ui->dnsSearch->setText(listWidget->items().join(","));
QString text = listWidget->items().join(",");
if (text.lastIndexOf(',') == text.length()-1) {
text.remove(text.length()-1, 1);
}
m_ui->dnsSearch->setText(text);
}
if (dlg) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment