- Timestamp:
- May 5, 2008 12:17:54 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r8439 r8567 746 746 , deviceTypes (KDeviceType_COUNT) 747 747 , storageBuses (KStorageBus_COUNT) 748 , storageBusDevices ( 3)749 , storageBusChannels ( 2)748 , storageBusDevices (2) 749 , storageBusChannels (3) 750 750 , diskTypes (KHardDiskType_COUNT) 751 751 , diskStorageTypes (KHardDiskStorageType_COUNT) … … 975 975 QString VBoxGlobal::toString (KStorageBus aBus, LONG aChannel) const 976 976 { 977 Assert (storageBusChannels.count() == 2);977 Assert (storageBusChannels.count() == 3); 978 978 QString channel; 979 979 … … 992 992 case KStorageBus_SATA: 993 993 { 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); 997 995 break; 998 996 } … … 1026 1024 case KStorageBus_SATA: 1027 1025 { 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())); 1031 1035 break; 1032 1036 } … … 1047 1051 NOREF (aChannel); 1048 1052 1049 Assert (storageBusDevices.count() == 3);1053 Assert (storageBusDevices.count() == 2); 1050 1054 QString device; 1051 1055 … … 1064 1068 case KStorageBus_SATA: 1065 1069 { 1066 device = storageBusDevices [2].arg (aDevice); 1070 AssertMsgBreakVoid (aDevice == 0, ("Invalid device %d\n", aDevice)); 1071 /* always zero so far for SATA */ 1067 1072 break; 1068 1073 } … … 1100 1105 case KStorageBus_SATA: 1101 1106 { 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; 1111 1110 } 1112 1111 default: … … 1139 1138 case KStorageBus_SATA: 1140 1139 { 1141 /* we only have one SATA channelso far which is always zero */1140 /* we only have one SATA device so far which is always zero */ 1142 1141 device = QString ("%1 %2") 1143 1142 .arg (vboxGlobal().toString (aBus)) 1144 .arg (vboxGlobal().toString (aBus, aChannel , aDevice));1143 .arg (vboxGlobal().toString (aBus, aChannel)); 1145 1144 break; 1146 1145 } … … 2453 2452 tr ("SATA", "StorageBus"); 2454 2453 2455 Assert (storageBusChannels.count() == 2);2454 Assert (storageBusChannels.count() == 3); 2456 2455 storageBusChannels [0] = 2457 2456 tr ("Primary", "StorageBusChannel"); 2458 2457 storageBusChannels [1] = 2459 2458 tr ("Secondary", "StorageBusChannel"); 2460 2461 Assert (storageBusDevices.count() == 3); 2459 storageBusChannels [2] = 2460 tr ("Port %1", "StorageBusChannel"); 2461 2462 Assert (storageBusDevices.count() == 2); 2462 2463 storageBusDevices [0] = tr ("Master", "StorageBusDevice"); 2463 2464 storageBusDevices [1] = tr ("Slave", "StorageBusDevice"); 2464 storageBusDevices [2] = tr ("Port %1", "StorageBusDevice");2465 2465 2466 2466 diskTypes [KHardDiskType_Normal] = -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h
r8436 r8567 135 135 136 136 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); 139 139 140 140 emit listChanged();
Note:
See TracChangeset
for help on using the changeset viewer.