Skip to content

Commit

Permalink
tweaks on the regular expression validators
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-bibb committed Oct 15, 2014
1 parent ce66bf8 commit da5f195
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions code/peditor/peditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ PropertiesEditor::PropertiesEditor(QWidget* parent, const arrayElement& ae, bool
QString s_ip6 = "(?:[0-9a-fA-F]{1,4})";

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

// now QLineEdits that allow multiple addresses
//rx4.setPattern("\\s*|(" + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "\\." + s_ip4 + "(\\s*[,|;]?\\s*))+");
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*))+");
QRegularExpression rx46("\\s?|((" + s_ip4 + "(?:\\." + s_ip4 + "){3}|" + s_ip6 + "(?::" + s_ip6 + "){7})(\\s*[,|;|\\s]\\s*))+");
QRegularExpressionValidator* lev_m = new QRegularExpressionValidator(rx46, this);
ui.lineEdit_nameservers->setValidator(lev_m);
ui.lineEdit_timeservers->setValidator(lev_m);
Expand Down
2 changes: 1 addition & 1 deletion code/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.

///////////////////////////////// Program Values ///////////////////////
// Program Info
#define VERSION "14.10.14-1"
#define VERSION "14.10.15-1"
#define RELEASE_DATE "15 October 2014"
#define COPYRIGHT_DATE "2013-2014"

Expand Down
4 changes: 2 additions & 2 deletions text/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
q<b><center>Connman System Tray (CMST)</center></b>
<b><center>Connman System Tray (CMST)</center></b>
<b><center>Change Log</center></b>
<br>
<br><b>2014.10.15</b>
Expand All @@ -10,7 +10,7 @@ q<b><center>Connman System Tray (CMST)</center></b>
<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>
<li>Wifi signal strength bar and techonlogy buttons now have frames around them so that they do not fill an entire table cell</li>
<li>Autoconnect property can be set or unset from the property editor.</li>
<li>Fixed IPv6 validator in the properties editor.</li>
<li>Fixed the IPv6 validator in the properties editor.</li>
</ul>
<br>
<br><b>2014.08.23</b>
Expand Down

0 comments on commit da5f195

Please sign in to comment.