VirtualBox

Changeset 93981 in vbox


Ignore:
Timestamp:
Feb 28, 2022 1:58:42 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: qt6: Simplified fromInternalString<KNATProtocol> so it compiles against qt6. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

    r93569 r93981  
    738738template<> KNATProtocol fromInternalString<KNATProtocol>(const QString &strProtocol)
    739739{
    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)
    749741        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);
    753745}
    754746
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette