From 50f9bfd6017fcba5fcb14988351d8a0a17df9477 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sat, 20 Jan 2018 15:33:10 +0500 Subject: [PATCH] UI: AddressesPage: Add ability to comment address lines with "#". --- src/ui/util/net/ip4range.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/util/net/ip4range.cpp b/src/ui/util/net/ip4range.cpp index 0d23b411..04054c3a 100644 --- a/src/ui/util/net/ip4range.cpp +++ b/src/ui/util/net/ip4range.cpp @@ -70,11 +70,13 @@ bool Ip4Range::fromText(const QString &text) text.splitRef(QLatin1Char('\n'))) { ++lineNo; - if (line.isEmpty()) + const QStringRef lineTrimmed = line.trimmed(); + if (lineTrimmed.isEmpty() + || lineTrimmed.startsWith('#')) // commented line continue; quint32 from, to; - if (!parseAddressMask(line, from, to)) { + if (!parseAddressMask(lineTrimmed, from, to)) { setErrorLineNo(lineNo); return false; }