VirtualBox

Changeset 102153 in vbox for trunk


Ignore:
Timestamp:
Nov 20, 2023 3:05:27 PM (15 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10513: A bit of cleanup for UIGuestOSType stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp

    r102152 r102153  
    6868}
    6969
    70 const UIGuestOSTypeManager::UIGuestOSFamilyInfo &UIGuestOSTypeManager::getFamilies() const
     70UIGuestOSTypeManager::UIGuestOSFamilyInfo UIGuestOSTypeManager::getFamilies() const
    7171{
    7272    return m_guestOSFamilies;
     
    7575QStringList UIGuestOSTypeManager::getSubtypeListForFamilyId(const QString &strFamilyId) const
    7676{
    77     QStringList subtypeList;
     77    QStringList subtypes;
    7878    foreach (const UIGuestOSType &type, m_guestOSTypes)
    7979    {
    8080        if (type.getFamilyId() != strFamilyId)
    8181            continue;
    82         const QString &strSubtype = type.getSubtype();
    83         if (!strSubtype.isEmpty() && !subtypeList.contains(strSubtype))
    84             subtypeList << strSubtype;
     82        const QString strSubtype = type.getSubtype();
     83        if (strSubtype.isEmpty() || subtypes.contains(strSubtype))
     84            continue;
     85        subtypes << strSubtype;
    8586    }
    86     return subtypeList;
     87    return subtypes;
    8788}
    8889
     
    9596            continue;
    9697        QPair<QString, QString> info(type.getId(), type.getDescription());
    97 
    98         if (!typeInfoList.contains(info))
    99             typeInfoList << info;
     98        if (typeInfoList.contains(info))
     99            continue;
     100        typeInfoList << info;
    100101    }
    101102    return typeInfoList;
     
    107108    if (strSubtype.isEmpty())
    108109        return typeInfoList;
    109 
    110110    foreach (const UIGuestOSType &type, m_guestOSTypes)
    111111    {
     
    113113            continue;
    114114        QPair<QString, QString> info(type.getId(), type.getDescription());
    115         if (!typeInfoList.contains(info))
    116             typeInfoList << info;
     115        if (typeInfoList.contains(info))
     116            continue;
     117        typeInfoList << info;
    117118    }
    118119    return typeInfoList;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h

    r102152 r102153  
    114114
    115115    /** Returns a list of all families (id and description). */
    116     const UIGuestOSFamilyInfo &getFamilies() const;
     116    UIGuestOSFamilyInfo getFamilies() const;
    117117    /** Returns the list of subtypes for @p strFamilyId. This may be an empty list. */
    118     QStringList                getSubtypeListForFamilyId(const QString &strFamilyId) const;
     118    QStringList         getSubtypeListForFamilyId(const QString &strFamilyId) const;
    119119    /** Returns a list of OS types for the @p strFamilyId. */
    120     UIGuestOSTypeInfo          getTypeListForFamilyId(const QString &strFamilyId) const;
     120    UIGuestOSTypeInfo   getTypeListForFamilyId(const QString &strFamilyId) const;
    121121    /** Returns a list of OS types for the @p strSubtype. */
    122     UIGuestOSTypeInfo          getTypeListForSubtype(const QString &strSubtype) const;
     122    UIGuestOSTypeInfo   getTypeListForSubtype(const QString &strSubtype) const;
    123123
    124124    static bool isDOSType(const QString &strOSTypeId);
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