VirtualBox

Changeset 78500 in vbox for trunk/src


Ignore:
Timestamp:
May 14, 2019 11:28:57 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
130539
Message:

FE/Qt: bugref:6247: VM Settings / Storage page: Removing controller classes, since they going to be replaceable between themselves.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r78495 r78500  
    442442}
    443443
    444 
    445 /* IDE Controller Type */
    446 IDEControllerType::IDEControllerType (KStorageControllerType aSubType)
    447     : AbstractControllerType (KStorageBus_IDE, aSubType)
    448 {
    449 }
    450 
    451 KStorageControllerType IDEControllerType::first() const
    452 {
    453     return KStorageControllerType_PIIX3;
    454 }
    455 
    456 uint IDEControllerType::size() const
    457 {
    458     return 3;
    459 }
    460 
    461 
    462 /* SATA Controller Type */
    463 SATAControllerType::SATAControllerType (KStorageControllerType aSubType)
    464     : AbstractControllerType (KStorageBus_SATA, aSubType)
    465 {
    466 }
    467 
    468 KStorageControllerType SATAControllerType::first() const
    469 {
    470     return KStorageControllerType_IntelAhci;
    471 }
    472 
    473 uint SATAControllerType::size() const
    474 {
    475     return 1;
    476 }
    477 
    478 
    479 /* SCSI Controller Type */
    480 SCSIControllerType::SCSIControllerType (KStorageControllerType aSubType)
    481     : AbstractControllerType (KStorageBus_SCSI, aSubType)
    482 {
    483 }
    484 
    485 KStorageControllerType SCSIControllerType::first() const
    486 {
    487     return KStorageControllerType_LsiLogic;
    488 }
    489 
    490 uint SCSIControllerType::size() const
    491 {
    492     return 2;
    493 }
    494 
    495 
    496 /* Floppy Controller Type */
    497 FloppyControllerType::FloppyControllerType (KStorageControllerType aSubType)
    498     : AbstractControllerType (KStorageBus_Floppy, aSubType)
    499 {
    500 }
    501 
    502 KStorageControllerType FloppyControllerType::first() const
    503 {
    504     return KStorageControllerType_I82078;
    505 }
    506 
    507 uint FloppyControllerType::size() const
    508 {
    509     return 1;
    510 }
    511 
    512 
    513 /* SAS Controller Type */
    514 SASControllerType::SASControllerType (KStorageControllerType aSubType)
    515     : AbstractControllerType (KStorageBus_SAS, aSubType)
    516 {
    517 }
    518 
    519 KStorageControllerType SASControllerType::first() const
    520 {
    521     return KStorageControllerType_LsiLogicSas;
    522 }
    523 
    524 uint SASControllerType::size() const
    525 {
    526     return 1;
    527 }
    528 
    529 
    530 /* USB Controller Type */
    531 USBStorageControllerType::USBStorageControllerType (KStorageControllerType aSubType)
    532     : AbstractControllerType (KStorageBus_USB, aSubType)
    533 {
    534 }
    535 
    536 KStorageControllerType USBStorageControllerType::first() const
    537 {
    538     return KStorageControllerType_USB;
    539 }
    540 
    541 uint USBStorageControllerType::size() const
    542 {
    543     return 1;
    544 }
    545 
    546 
    547 /* NVMe Controller Type */
    548 NVMeStorageControllerType::NVMeStorageControllerType (KStorageControllerType aSubType)
    549     : AbstractControllerType (KStorageBus_PCIe, aSubType)
    550 {
    551 }
    552 
    553 KStorageControllerType NVMeStorageControllerType::first() const
    554 {
    555     return KStorageControllerType_NVMe;
    556 }
    557 
    558 uint NVMeStorageControllerType::size() const
    559 {
    560     return 1;
     444KStorageControllerType AbstractControllerType::first() const
     445{
     446    switch (mBusType)
     447    {
     448        case KStorageBus_IDE:    return KStorageControllerType_PIIX3;
     449        case KStorageBus_SATA:   return KStorageControllerType_IntelAhci;
     450        case KStorageBus_SCSI:   return KStorageControllerType_LsiLogic;
     451        case KStorageBus_Floppy: return KStorageControllerType_I82078;
     452        case KStorageBus_SAS:    return KStorageControllerType_LsiLogicSas;
     453        case KStorageBus_USB:    return KStorageControllerType_USB;
     454        case KStorageBus_PCIe:   return KStorageControllerType_NVMe;
     455        default:                 AssertFailedReturn(KStorageControllerType_Null);
     456    }
     457}
     458
     459uint AbstractControllerType::size() const
     460{
     461    switch (mBusType)
     462    {
     463        case KStorageBus_IDE:    return 3;
     464        case KStorageBus_SATA:   return 1;
     465        case KStorageBus_SCSI:   return 2;
     466        case KStorageBus_Floppy: return 1;
     467        case KStorageBus_SAS:    return 1;
     468        case KStorageBus_USB:    return 1;
     469        case KStorageBus_PCIe:   return 1;
     470        default:                 AssertFailedReturn(0);
     471    }
    561472}
    562473
     
    703614    {
    704615        case KStorageBus_IDE:
    705             mCtrType = new IDEControllerType (aControllerType);
     616            mCtrType = new AbstractControllerType(KStorageBus_IDE, aControllerType);
    706617            break;
    707618        case KStorageBus_SATA:
    708             mCtrType = new SATAControllerType (aControllerType);
     619            mCtrType = new AbstractControllerType(KStorageBus_SATA, aControllerType);
    709620            break;
    710621        case KStorageBus_SCSI:
    711             mCtrType = new SCSIControllerType (aControllerType);
     622            mCtrType = new AbstractControllerType(KStorageBus_SCSI, aControllerType);
    712623            break;
    713624        case KStorageBus_Floppy:
    714             mCtrType = new FloppyControllerType (aControllerType);
     625            mCtrType = new AbstractControllerType(KStorageBus_Floppy, aControllerType);
    715626            break;
    716627        case KStorageBus_SAS:
    717             mCtrType = new SASControllerType (aControllerType);
     628            mCtrType = new AbstractControllerType(KStorageBus_SAS, aControllerType);
    718629            break;
    719630        case KStorageBus_USB:
    720             mCtrType = new USBStorageControllerType (aControllerType);
     631            mCtrType = new AbstractControllerType(KStorageBus_USB, aControllerType);
    721632            break;
    722633        case KStorageBus_PCIe:
    723             mCtrType = new NVMeStorageControllerType (aControllerType);
     634            mCtrType = new AbstractControllerType(KStorageBus_PCIe, aControllerType);
    724635            break;
    725636
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r77170 r78500  
    155155protected:
    156156
    157     virtual KStorageControllerType first() const = 0;
    158     virtual uint size() const = 0;
     157    KStorageControllerType first() const;
     158    uint size() const;
    159159
    160160    KStorageBus mBusType;
    161161    KStorageControllerType mCtrType;
    162162    QList<PixmapType> mPixmaps;
    163 };
    164 
    165 /* IDE Controller Type */
    166 class SHARED_LIBRARY_STUFF IDEControllerType : public AbstractControllerType
    167 {
    168 public:
    169 
    170     IDEControllerType (KStorageControllerType aSubType);
    171 
    172 private:
    173 
    174     KStorageControllerType first() const;
    175     uint size() const;
    176 };
    177 
    178 /* SATA Controller Type */
    179 class SHARED_LIBRARY_STUFF SATAControllerType : public AbstractControllerType
    180 {
    181 public:
    182 
    183     SATAControllerType (KStorageControllerType aSubType);
    184 
    185 private:
    186 
    187     KStorageControllerType first() const;
    188     uint size() const;
    189 };
    190 
    191 /* SCSI Controller Type */
    192 class SHARED_LIBRARY_STUFF SCSIControllerType : public AbstractControllerType
    193 {
    194 public:
    195 
    196     SCSIControllerType (KStorageControllerType aSubType);
    197 
    198 private:
    199 
    200     KStorageControllerType first() const;
    201     uint size() const;
    202 };
    203 
    204 /* Floppy Controller Type */
    205 class SHARED_LIBRARY_STUFF FloppyControllerType : public AbstractControllerType
    206 {
    207 public:
    208 
    209     FloppyControllerType (KStorageControllerType aSubType);
    210 
    211 private:
    212 
    213     KStorageControllerType first() const;
    214     uint size() const;
    215 };
    216 
    217 /* SAS Controller Type */
    218 class SHARED_LIBRARY_STUFF SASControllerType : public AbstractControllerType
    219 {
    220 public:
    221 
    222     SASControllerType (KStorageControllerType aSubType);
    223 
    224 private:
    225 
    226     KStorageControllerType first() const;
    227     uint size() const;
    228 };
    229 
    230 /* USB Controller Type */
    231 class SHARED_LIBRARY_STUFF USBStorageControllerType : public AbstractControllerType
    232 {
    233 public:
    234 
    235     USBStorageControllerType (KStorageControllerType aSubType);
    236 
    237 private:
    238 
    239     KStorageControllerType first() const;
    240     uint size() const;
    241 };
    242 
    243 /* NVMe Controller Type */
    244 class SHARED_LIBRARY_STUFF NVMeStorageControllerType : public AbstractControllerType
    245 {
    246 public:
    247 
    248     NVMeStorageControllerType (KStorageControllerType aSubType);
    249 
    250 private:
    251 
    252     KStorageControllerType first() const;
    253     uint size() const;
    254163};
    255164
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