VirtualBox

Ignore:
Timestamp:
Nov 25, 2016 5:36:44 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112095
Message:

FE/Qt: bugref:6899: Accessibility support (step 143): UIApplianceEditorWidget: Fixing variable shadowing bug (kudos to Cppcheck).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r64750 r64756  
    159159
    160160    /** Constructs item passing @a iNumber and @a pParentItem to the base-class.
    161       * @param  enmType              Brings the Virtual System Description type.
     161      * @param  enmVSDType           Brings the Virtual System Description type.
    162162      * @param  strRef               Brings something totally useless.
    163163      * @param  strOrigValue         Brings the original value.
     
    165165      * @param  strExtraConfigValue  Brings the extra configuration value. */
    166166    UIVirtualHardwareItem(int iNumber,
    167                           KVirtualSystemDescriptionType enmType,
     167                          KVirtualSystemDescriptionType enmVSDType,
    168168                          const QString &strRef,
    169169                          const QString &strOrigValue,
     
    199199
    200200    /** Holds the Virtual System Description type. */
    201     KVirtualSystemDescriptionType  m_enmType;
     201    KVirtualSystemDescriptionType  m_enmVSDType;
    202202    /** Holds something totally useless. */
    203203    QString                        m_strRef;
     
    335335
    336336UIVirtualHardwareItem::UIVirtualHardwareItem(int iNumber,
    337                                              KVirtualSystemDescriptionType enmType,
     337                                             KVirtualSystemDescriptionType enmVSDType,
    338338                                             const QString &strRef,
    339339                                             const QString &aOrigValue,
     
    342342                                             UIApplianceModelItem *pParentItem)
    343343    : UIApplianceModelItem(iNumber, ApplianceModelItemType_VirtualHardware, pParentItem)
    344     , m_enmType(enmType)
     344    , m_enmVSDType(enmVSDType)
    345345    , m_strRef(strRef)
    346346    , m_strOrigValue(aOrigValue)
     
    359359    {
    360360        /* Some items are checkable */
    361         if (m_enmType == KVirtualSystemDescriptionType_Floppy ||
    362             m_enmType == KVirtualSystemDescriptionType_CDROM ||
    363             m_enmType == KVirtualSystemDescriptionType_USBController ||
    364             m_enmType == KVirtualSystemDescriptionType_SoundCard ||
    365             m_enmType == KVirtualSystemDescriptionType_NetworkAdapter)
     361        if (m_enmVSDType == KVirtualSystemDescriptionType_Floppy ||
     362            m_enmVSDType == KVirtualSystemDescriptionType_CDROM ||
     363            m_enmVSDType == KVirtualSystemDescriptionType_USBController ||
     364            m_enmVSDType == KVirtualSystemDescriptionType_SoundCard ||
     365            m_enmVSDType == KVirtualSystemDescriptionType_NetworkAdapter)
    366366            enmFlags |= Qt::ItemIsUserCheckable;
    367367        /* Some items are editable */
    368         if ((m_enmType == KVirtualSystemDescriptionType_Name ||
    369              m_enmType == KVirtualSystemDescriptionType_Product ||
    370              m_enmType == KVirtualSystemDescriptionType_ProductUrl ||
    371              m_enmType == KVirtualSystemDescriptionType_Vendor ||
    372              m_enmType == KVirtualSystemDescriptionType_VendorUrl ||
    373              m_enmType == KVirtualSystemDescriptionType_Version ||
    374              m_enmType == KVirtualSystemDescriptionType_Description ||
    375              m_enmType == KVirtualSystemDescriptionType_License ||
    376              m_enmType == KVirtualSystemDescriptionType_OS ||
    377              m_enmType == KVirtualSystemDescriptionType_CPU ||
    378              m_enmType == KVirtualSystemDescriptionType_Memory ||
    379              m_enmType == KVirtualSystemDescriptionType_SoundCard ||
    380              m_enmType == KVirtualSystemDescriptionType_NetworkAdapter ||
    381              m_enmType == KVirtualSystemDescriptionType_HardDiskControllerIDE ||
    382              m_enmType == KVirtualSystemDescriptionType_HardDiskImage) &&
     368        if ((m_enmVSDType == KVirtualSystemDescriptionType_Name ||
     369             m_enmVSDType == KVirtualSystemDescriptionType_Product ||
     370             m_enmVSDType == KVirtualSystemDescriptionType_ProductUrl ||
     371             m_enmVSDType == KVirtualSystemDescriptionType_Vendor ||
     372             m_enmVSDType == KVirtualSystemDescriptionType_VendorUrl ||
     373             m_enmVSDType == KVirtualSystemDescriptionType_Version ||
     374             m_enmVSDType == KVirtualSystemDescriptionType_Description ||
     375             m_enmVSDType == KVirtualSystemDescriptionType_License ||
     376             m_enmVSDType == KVirtualSystemDescriptionType_OS ||
     377             m_enmVSDType == KVirtualSystemDescriptionType_CPU ||
     378             m_enmVSDType == KVirtualSystemDescriptionType_Memory ||
     379             m_enmVSDType == KVirtualSystemDescriptionType_SoundCard ||
     380             m_enmVSDType == KVirtualSystemDescriptionType_NetworkAdapter ||
     381             m_enmVSDType == KVirtualSystemDescriptionType_HardDiskControllerIDE ||
     382             m_enmVSDType == KVirtualSystemDescriptionType_HardDiskImage) &&
    383383            m_checkState == Qt::Checked) /* Item has to be enabled */
    384384            enmFlags |= Qt::ItemIsEditable;
     
    395395        {
    396396            if (iColumn == ApplianceViewSection_ConfigValue &&
    397                 (m_enmType == KVirtualSystemDescriptionType_Floppy ||
    398                  m_enmType == KVirtualSystemDescriptionType_CDROM ||
    399                  m_enmType == KVirtualSystemDescriptionType_USBController ||
    400                  m_enmType == KVirtualSystemDescriptionType_SoundCard ||
    401                  m_enmType == KVirtualSystemDescriptionType_NetworkAdapter))
     397                (m_enmVSDType == KVirtualSystemDescriptionType_Floppy ||
     398                 m_enmVSDType == KVirtualSystemDescriptionType_CDROM ||
     399                 m_enmVSDType == KVirtualSystemDescriptionType_USBController ||
     400                 m_enmVSDType == KVirtualSystemDescriptionType_SoundCard ||
     401                 m_enmVSDType == KVirtualSystemDescriptionType_NetworkAdapter))
    402402            {
    403403                m_checkState = static_cast<Qt::CheckState>(value.toInt());
     
    436436            if (iColumn == ApplianceViewSection_Description)
    437437            {
    438                 switch (m_enmType)
     438                switch (m_enmVSDType)
    439439                {
    440440                    case KVirtualSystemDescriptionType_Name:                   value = UIApplianceEditorWidget::tr("Name"); break;
     
    466466            else if (iColumn == ApplianceViewSection_ConfigValue)
    467467            {
    468                 switch (m_enmType)
     468                switch (m_enmVSDType)
    469469                {
    470470                    case KVirtualSystemDescriptionType_Description:
     
    501501            if (iColumn == ApplianceViewSection_Description)
    502502            {
    503                 switch (m_enmType)
     503                switch (m_enmVSDType)
    504504                {
    505505                    case KVirtualSystemDescriptionType_Name:                   value = UIIconPool::iconSet(":/name_16px.png"); break;
     
    528528            }
    529529            else if (iColumn == ApplianceViewSection_ConfigValue &&
    530                      m_enmType == KVirtualSystemDescriptionType_OS)
     530                     m_enmVSDType == KVirtualSystemDescriptionType_OS)
    531531            {
    532532                const QStyle *pStyle = QApplication::style();
     
    562562        {
    563563            if (iColumn == ApplianceViewSection_ConfigValue &&
    564                 (m_enmType == KVirtualSystemDescriptionType_Floppy ||
    565                  m_enmType == KVirtualSystemDescriptionType_CDROM ||
    566                  m_enmType == KVirtualSystemDescriptionType_USBController ||
    567                  m_enmType == KVirtualSystemDescriptionType_SoundCard ||
    568                  m_enmType == KVirtualSystemDescriptionType_NetworkAdapter))
     564                (m_enmVSDType == KVirtualSystemDescriptionType_Floppy ||
     565                 m_enmVSDType == KVirtualSystemDescriptionType_CDROM ||
     566                 m_enmVSDType == KVirtualSystemDescriptionType_USBController ||
     567                 m_enmVSDType == KVirtualSystemDescriptionType_SoundCard ||
     568                 m_enmVSDType == KVirtualSystemDescriptionType_NetworkAdapter))
    569569                value = m_checkState;
    570570            break;
     
    572572        case UIVirtualHardwareItem::TypeRole:
    573573        {
    574             value = m_enmType;
     574            value = m_enmVSDType;
    575575            break;
    576576        }
     
    590590    if (idx.column() == ApplianceViewSection_ConfigValue)
    591591    {
    592         switch (m_enmType)
     592        switch (m_enmVSDType)
    593593        {
    594594            case KVirtualSystemDescriptionType_OS:
     
    697697{
    698698    bool fDone = false;
    699     switch (m_enmType)
     699    switch (m_enmVSDType)
    700700    {
    701701        case KVirtualSystemDescriptionType_OS:
     
    788788{
    789789    bool fDone = false;
    790     switch (m_enmType)
     790    switch (m_enmVSDType)
    791791    {
    792792        case KVirtualSystemDescriptionType_OS:
     
    12791279                UIVirtualHardwareItem *hwItem = static_cast<UIVirtualHardwareItem*>(pItem);
    12801280                /* The license type shouldn't be displayed */
    1281                 if (m_aFilteredList.contains(hwItem->m_enmType))
     1281                if (m_aFilteredList.contains(hwItem->m_enmVSDType))
    12821282                    return false;
    12831283            }
     
    13051305
    13061306    for (unsigned int i = 0; i < RT_ELEMENTS(s_aSortList); ++i)
    1307         if (pHwLeft->m_enmType == s_aSortList[i])
     1307        if (pHwLeft->m_enmVSDType == s_aSortList[i])
    13081308        {
    13091309            for (unsigned int a = 0; a <= i; ++a)
    1310                 if (pHwRight->m_enmType == s_aSortList[a])
     1310                if (pHwRight->m_enmVSDType == s_aSortList[a])
    13111311                    return true;
    13121312            return false;
Note: See TracChangeset for help on using the changeset viewer.

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