Changeset 93981 in vbox
- Timestamp:
- Feb 28, 2022 1:58:42 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp
r93569 r93981 738 738 template<> KNATProtocol fromInternalString<KNATProtocol>(const QString &strProtocol) 739 739 { 740 /* Here we have some fancy stuff allowing us 741 * to search through the keys using 'case-insensitive' rule: */ 742 QStringList keys; QList<KNATProtocol> values; 743 keys << "udp"; values << KNATProtocol_UDP; 744 keys << "tcp"; values << KNATProtocol_TCP; 745 /* Invalid type for unknown words: */ 746 if (!keys.contains(strProtocol, Qt::CaseInsensitive)) 747 { 748 AssertMsgFailed(("No value for '%s'", strProtocol.toUtf8().constData())); 740 if (strProtocol.compare("udp", Qt::CaseInsensitive) == 0) 749 741 return KNATProtocol_UDP; 750 }751 /* Corresponding type for known words: */752 return values.at(keys.indexOf(QRegExp(strProtocol, Qt::CaseInsensitive)));742 if (strProtocol.compare("tcp", Qt::CaseInsensitive) == 0) 743 return KNATProtocol_TCP; 744 AssertMsgFailedReturn(("No value for '%s'", strProtocol.toUtf8().constData()), KNATProtocol_UDP); 753 745 } 754 746
Note:
See TracChangeset
for help on using the changeset viewer.