tst_QDnsLookup: don't add duplicate 'nameserver' lines
I don't know why systemd-resolved did have those for me, but it did, so QtTest complains. QWARN : tst_QDnsLookup::setNameserver() Duplicate data tag "..." - please rename. Change-Id: I8df70eb429682b529ecefffd0aca735f94d77225 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1420ee85165c03bac2aa1678b295f7b1ebe44f51) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
c2df419edf
commit
4374f3ce41
@ -128,8 +128,9 @@ static QList<QHostAddress> systemNameservers(QDnsLookup::Protocol protocol)
|
|||||||
if (!line.startsWith(command))
|
if (!line.startsWith(command))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString addr = QLatin1StringView(line).mid(sizeof(command));
|
QHostAddress addr(QLatin1StringView(line).mid(sizeof(command)));
|
||||||
result.emplaceBack(addr);
|
if (!result.contains(addr))
|
||||||
|
result.emplaceBack(std::move(addr));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
parseFile("/etc/resolv.conf"_L1);
|
parseFile("/etc/resolv.conf"_L1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user