VirtualBox

Changeset 8567 in vbox for trunk/src


Ignore:
Timestamp:
May 5, 2008 12:17:54 PM (17 years ago)
Author:
vboxsync
Message:

Fix SATA bug #2818

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

Legend:

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

    r8439 r8567  
    746746    , deviceTypes (KDeviceType_COUNT)
    747747    , storageBuses (KStorageBus_COUNT)
    748     , storageBusDevices (3)
    749     , storageBusChannels (2)
     748    , storageBusDevices (2)
     749    , storageBusChannels (3)
    750750    , diskTypes (KHardDiskType_COUNT)
    751751    , diskStorageTypes (KHardDiskStorageType_COUNT)
     
    975975QString VBoxGlobal::toString (KStorageBus aBus, LONG aChannel) const
    976976{
    977     Assert (storageBusChannels.count() == 2);
     977    Assert (storageBusChannels.count() == 3);
    978978    QString channel;
    979979
     
    992992        case KStorageBus_SATA:
    993993        {
    994             AssertMsgBreakVoid (aChannel == 0, ("Invalid channel %d\n", aChannel));
    995 
    996             /* null string since the SATA channel is alwayz zero so far */
     994            channel = storageBusChannels [2].arg (aChannel);
    997995            break;
    998996        }
     
    10261024        case KStorageBus_SATA:
    10271025        {
    1028             AssertMsgBreakVoid (aChannel.isEmpty(),
    1029                                 ("Invalid channel {%s}\n", aChannel.latin1()));
    1030             /* always zero so far for SATA */
     1026            /// @todo use regexp to properly extract the %1 text
     1027            QString tpl = storageBusChannels [2].arg ("");
     1028            if (aChannel.startsWith (tpl))
     1029            {
     1030                channel = aChannel.right (aChannel.length() - tpl.length()).toLong();
     1031                break;
     1032            }
     1033
     1034            AssertMsgFailedBreakVoid (("Invalid channel {%s}\n", aChannel.latin1()));
    10311035            break;
    10321036        }
     
    10471051    NOREF (aChannel);
    10481052
    1049     Assert (storageBusDevices.count() == 3);
     1053    Assert (storageBusDevices.count() == 2);
    10501054    QString device;
    10511055
     
    10641068        case KStorageBus_SATA:
    10651069        {
    1066             device = storageBusDevices [2].arg (aDevice);
     1070            AssertMsgBreakVoid (aDevice == 0, ("Invalid device %d\n", aDevice));
     1071            /* always zero so far for SATA */
    10671072            break;
    10681073        }
     
    11001105        case KStorageBus_SATA:
    11011106        {
    1102             /// @todo use regexp to properly extract the %1 text
    1103             QString tpl = storageBusDevices [2].arg ("");
    1104             if (aDevice.startsWith (tpl))
    1105             {
    1106                 device = aDevice.right (aDevice.length() - tpl.length()).toLong();
    1107                 break;
    1108             }
    1109 
    1110             AssertMsgFailedBreakVoid (("Invalid device {%s}\n", aDevice.latin1()));
     1107            AssertMsgBreakVoid(aDevice.isEmpty(), ("Invalid device {%s}\n", aDevice.latin1()));
     1108            /* always zero for SATA so far. */
     1109            break;
    11111110        }
    11121111        default:
     
    11391138        case KStorageBus_SATA:
    11401139        {
    1141             /* we only have one SATA channel so far which is always zero */
     1140            /* we only have one SATA device so far which is always zero */
    11421141            device = QString ("%1 %2")
    11431142                .arg (vboxGlobal().toString (aBus))
    1144                 .arg (vboxGlobal().toString (aBus, aChannel, aDevice));
     1143                .arg (vboxGlobal().toString (aBus, aChannel));
    11451144            break;
    11461145        }
     
    24532452        tr ("SATA", "StorageBus");
    24542453
    2455     Assert (storageBusChannels.count() == 2);
     2454    Assert (storageBusChannels.count() == 3);
    24562455    storageBusChannels [0] =
    24572456        tr ("Primary", "StorageBusChannel");
    24582457    storageBusChannels [1] =
    24592458        tr ("Secondary", "StorageBusChannel");
    2460 
    2461     Assert (storageBusDevices.count() == 3);
     2459    storageBusChannels [2] =
     2460        tr ("Port %1", "StorageBusChannel");
     2461
     2462    Assert (storageBusDevices.count() == 2);
    24622463    storageBusDevices [0] = tr ("Master", "StorageBusDevice");
    24632464    storageBusDevices [1] = tr ("Slave", "StorageBusDevice");
    2464     storageBusDevices [2] = tr ("Port %1", "StorageBusDevice");
    24652465
    24662466    diskTypes [KHardDiskType_Normal] =
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h

    r8436 r8567  
    135135
    136136        for (int i = 0; i < mSataPortsCount; ++ i)
    137             mSATAList << HDSlot (vboxGlobal().toFullString (KStorageBus_SATA, 0, i),
    138                                  KStorageBus_SATA, 0, i);
     137            mSATAList << HDSlot (vboxGlobal().toFullString (KStorageBus_SATA, i, 0),
     138                                 KStorageBus_SATA, i, 0);
    139139
    140140        emit listChanged();
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