Changeset 32460 in vbox
- Timestamp:
- Sep 13, 2010 5:03:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsPortForwardingDlg.cpp
r31563 r32460 52 52 QValidator::State validate(QString &strInput, int & /* iPos */) const 53 53 { 54 QString strStringToValidate(strInput); 55 strStringToValidate.remove(' '); 54 56 QString strDot("\\."); 55 57 QString strDigits("(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)"); 56 58 QRegExp intRegExp(QString("^(%1?(%2(%1?(%2(%1?(%2%1?)?)?)?)?)?)?$").arg(strDigits).arg(strDot)); 57 59 uint uNetwork, uMask; 58 if (str Input.isEmpty() || RTCidrStrToIPv4(strInput.toLatin1().constData(), &uNetwork, &uMask) == VINF_SUCCESS)60 if (strStringToValidate == "..." || RTCidrStrToIPv4(strStringToValidate.toLatin1().constData(), &uNetwork, &uMask) == VINF_SUCCESS) 59 61 return QValidator::Acceptable; 60 else if (intRegExp.indexIn(str Input) != -1)62 else if (intRegExp.indexIn(strStringToValidate) != -1) 61 63 return QValidator::Intermediate; 62 64 else … … 140 142 setAlignment(Qt::AlignCenter); 141 143 setValidator(new IPValidator(this)); 144 setInputMask("000.000.000.000"); 142 145 } 143 146 … … 151 154 IpData ip() const 152 155 { 153 return text() ;156 return text() == "..." ? QString() : text(); 154 157 } 155 158 };
Note:
See TracChangeset
for help on using the changeset viewer.