Skip to content

Commit da5f195

Browse files
committed
tweaks on the regular expression validators
1 parent ce66bf8 commit da5f195

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

code/peditor/peditor.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ PropertiesEditor::PropertiesEditor(QWidget* parent, const arrayElement& ae, bool
5050
QString s_ip6 = "(?:[0-9a-fA-F]{1,4})";
5151

5252
// QLineEdits that allow single address
53-
QRegularExpression rx4("\\s?|^" + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "$");
54-
QRegularExpression rx6("\\s?|^" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + "$");
53+
QRegularExpression rx4("\\s?|^" + s_ip4 + "(?:\\." + s_ip4 + "){3}" + "$");
54+
QRegularExpression rx6("\\s?|^" + s_ip6 + "(?::" + s_ip6 + "){7}" + "$");
5555
QRegularExpressionValidator* lev_4 = new QRegularExpressionValidator(rx4, this);
5656
QRegularExpressionValidator* lev_6 = new QRegularExpressionValidator(rx6, this);
5757
ui.lineEdit_ipv4address->setValidator(lev_4);
@@ -61,8 +61,7 @@ PropertiesEditor::PropertiesEditor(QWidget* parent, const arrayElement& ae, bool
6161
ui.lineEdit_ipv6gateway->setValidator(lev_6);
6262

6363
// now QLineEdits that allow multiple addresses
64-
//rx4.setPattern("\\s*|(" + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "(\\s*[,|;]?\\s*))+");
65-
QRegularExpression rx46("\\s?|((" + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "|" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ":" + s_ip6 + ")" + "(\\s*[,|;|\\s]+\\s*))+");
64+
QRegularExpression rx46("\\s?|((" + s_ip4 + "(?:\\." + s_ip4 + "){3}|" + s_ip6 + "(?::" + s_ip6 + "){7})(\\s*[,|;|\\s]\\s*))+");
6665
QRegularExpressionValidator* lev_m = new QRegularExpressionValidator(rx46, this);
6766
ui.lineEdit_nameservers->setValidator(lev_m);
6867
ui.lineEdit_timeservers->setValidator(lev_m);

code/resource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.
3434

3535
///////////////////////////////// Program Values ///////////////////////
3636
// Program Info
37-
#define VERSION "14.10.14-1"
37+
#define VERSION "14.10.15-1"
3838
#define RELEASE_DATE "15 October 2014"
3939
#define COPYRIGHT_DATE "2013-2014"
4040

text/changelog.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
q<b><center>Connman System Tray (CMST)</center></b>
1+
<b><center>Connman System Tray (CMST)</center></b>
22
<b><center>Change Log</center></b>
33
<br>
44
<br><b>2014.10.15</b>
@@ -10,7 +10,7 @@ q<b><center>Connman System Tray (CMST)</center></b>
1010
<li>If an instance of CMST is started while one is running the running copy will be raised, and a message about a second instance trying to start will be printed to stderr.</li>
1111
<li>Wifi signal strength bar and techonlogy buttons now have frames around them so that they do not fill an entire table cell</li>
1212
<li>Autoconnect property can be set or unset from the property editor.</li>
13-
<li>Fixed IPv6 validator in the properties editor.</li>
13+
<li>Fixed the IPv6 validator in the properties editor.</li>
1414
</ul>
1515
<br>
1616
<br><b>2014.08.23</b>

0 commit comments

Comments
 (0)