VirtualBox

Changeset 67737 in vbox


Ignore:
Timestamp:
Jun 30, 2017 2:26:07 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116601
Message:

FE/Qt: bugref:8400: Virtual Media Manager: Small cleanup related to UIMediumType enum handling.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h

    r62493 r67737  
    3535    enum UIMediumType
    3636    {
    37         UIMediumType_Invalid,
    3837        UIMediumType_HardDisk,
    3938        UIMediumType_DVD,
    4039        UIMediumType_Floppy,
    41         UIMediumType_All
     40        UIMediumType_All,
     41        UIMediumType_Invalid
    4242    };
    4343
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r67719 r67737  
    13831383        /* Create tabs: */
    13841384        for (int i = 0; i < m_iTabCount; ++i)
    1385             prepareTab(mediumType(i));
     1385            prepareTab((UIMediumType)i);
    13861386        /* Configure tab-widget: */
    13871387        m_pTabWidget->setFocusPolicy(Qt::TabFocus);
     
    21952195    /* Return medium type for known tab index: */
    21962196    if (iIndex >= 0 && iIndex < m_iTabCount)
    2197         return mediumType(iIndex);
     2197        return (UIMediumType)iIndex;
    21982198
    21992199    /* Invalid by default: */
     
    22082208
    22092209    /* Return current medium type: */
    2210     return mediumType(m_pTabWidget->currentIndex());
     2210    return (UIMediumType)m_pTabWidget->currentIndex();
    22112211}
    22122212
     
    22572257    /* -1 by default: */
    22582258    return -1;
    2259 }
    2260 
    2261 /* static */
    2262 UIMediumType UIMediumManagerWidget::mediumType(int iIndex)
    2263 {
    2264     /* Return medium type corresponding to known tab index: */
    2265     switch (iIndex)
    2266     {
    2267         case 0: return UIMediumType_HardDisk;
    2268         case 1: return UIMediumType_DVD;
    2269         case 2: return UIMediumType_Floppy;
    2270         default: break;
    2271     }
    2272 
    2273     /* Invalid by default: */
    2274     return UIMediumType_Invalid;
    22752259}
    22762260
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h

    r67718 r67737  
    234234        /** Returns tab index for passed UIMediumType. */
    235235        static int tabIndex(UIMediumType type);
    236         /** Returns UIMediumType for passed tab index. */
    237         static UIMediumType mediumType(int iIndex);
    238236
    239237        /** Performs search for the @a pTree child which corresponds to the @a condition but not @a pException. */
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