UI: AddressesPage: Add ability to comment address lines with "#".

This commit is contained in:
Nodir Temirkhodjaev 2018-01-20 15:33:10 +05:00
parent 4c918df002
commit 50f9bfd601

View File

@ -70,11 +70,13 @@ bool Ip4Range::fromText(const QString &text)
text.splitRef(QLatin1Char('\n'))) { text.splitRef(QLatin1Char('\n'))) {
++lineNo; ++lineNo;
if (line.isEmpty()) const QStringRef lineTrimmed = line.trimmed();
if (lineTrimmed.isEmpty()
|| lineTrimmed.startsWith('#')) // commented line
continue; continue;
quint32 from, to; quint32 from, to;
if (!parseAddressMask(line, from, to)) { if (!parseAddressMask(lineTrimmed, from, to)) {
setErrorLineNo(lineNo); setErrorLineNo(lineNo);
return false; return false;
} }