VirtualBox

Changeset 24437 in vbox


Ignore:
Timestamp:
Nov 6, 2009 12:30:15 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Need to check if the controller is present before using it

File:
1 edited

Legend:

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

    r24400 r24437  
    21722172    foreach (const CMediumAttachment &attachment, attachments)
    21732173    {
    2174         if (attachment.GetType() == deviceType)
     2174        CStorageController controller = attachment.GetController();
     2175        if (   !controller.isNull()
     2176            && (attachment.GetType() == deviceType))
    21752177        {
    21762178            /* Attachment menu item */
     
    21792181            {
    21802182                attachmentMenu = new QMenu (menu);
    2181                 attachmentMenu->setTitle (QString ("%1 (%2)").arg (attachment.GetController().GetName())
    2182                                           .arg (vboxGlobal().toString (StorageSlot (attachment.GetController().GetBus(),
     2183                attachmentMenu->setTitle (QString ("%1 (%2)").arg (controller.GetName())
     2184                                          .arg (vboxGlobal().toString (StorageSlot (controller.GetBus(),
    21832185                                                                                    attachment.GetPort(),
    21842186                                                                                    attachment.GetDevice()))));
    2185                 switch (attachment.GetController().GetBus())
     2187                switch (controller.GetBus())
    21862188                {
    21872189                    case KStorageBus_IDE:
     
    22472249                    mountMediumAction->setCheckable (true);
    22482250                    mountMediumAction->setChecked (!currentMedium.isNull() && medium.GetId() == currentId);
    2249                     mountMediumAction->setData (QVariant::fromValue (MountTarget (attachment.GetController().GetName(),
     2251                    mountMediumAction->setData (QVariant::fromValue (MountTarget (controller.GetName(),
    22502252                                                                                  attachment.GetPort(),
    22512253                                                                                  attachment.GetDevice(),
     
    22622264            QAction *callVMMAction = new QAction (attachmentMenu);
    22632265            callVMMAction->setIcon (QIcon (":/diskimage_16px.png"));
    2264             callVMMAction->setData (QVariant::fromValue (MountTarget (attachment.GetController().GetName(),
     2266            callVMMAction->setData (QVariant::fromValue (MountTarget (controller.GetName(),
    22652267                                                                      attachment.GetPort(),
    22662268                                                                      attachment.GetDevice(),
     
    22762278            QAction *unmountMediumAction = new QAction (attachmentMenu);
    22772279            unmountMediumAction->setEnabled (!currentMedium.isNull());
    2278             unmountMediumAction->setData (QVariant::fromValue (MountTarget (attachment.GetController().GetName(),
     2280            unmountMediumAction->setData (QVariant::fromValue (MountTarget (controller.GetName(),
    22792281                                                                            attachment.GetPort(),
    22802282                                                                            attachment.GetDevice())));
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