Changeset 16971 in vbox
- Timestamp:
- Feb 20, 2009 12:26:19 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 43138
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r16867 r16971 5 5 6 6 /* 7 * Copyright (C) 2006-200 7Sun Microsystems, Inc.7 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 134 134 if (strcmp(a->argv[0], "ostypes") == 0) 135 135 { 136 ComPtr<IGuestOSTypeCollection> coll;137 ComPtr<IGuestOSTypeEnumerator> enumerator;138 CHECK_ERROR(a->virtualBox, COMGETTER(GuestOSTypes)(coll.asOutParam()));139 if (SUCCEEDED(rc) && coll)140 {141 CHECK_ERROR(coll, Enumerate(enumerator.asOutParam()));142 BOOL hasMore;143 while (SUCCEEDED(enumerator->HasMore(&hasMore)) && hasMore)136 com::SafeIfaceArray <IGuestOSType> coll; 137 rc = a->virtualBox->COMGETTER(GuestOSTypes)(ComSafeArrayAsOutParam(coll)); 138 if (SUCCEEDED(rc)) 139 { 140 /* 141 * Iterate through the collection. 142 */ 143 for (size_t i = 0; i < coll.size(); ++ i) 144 144 { 145 145 ComPtr<IGuestOSType> guestOS; 146 CHECK_ERROR_BREAK(enumerator, GetNext(guestOS.asOutParam()));146 guestOS = coll[i]; 147 147 Bstr guestId; 148 148 guestOS->COMGETTER(Id)(guestId.asOutParam()); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r16966 r16971 6 6 7 7 /* 8 * Copyright (C) 2008 Sun Microsystems, Inc.8 * Copyright (C) 2008-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 5536 5536 #endif 5537 5537 5538 /* Initialize guest OS Type list */5539 CGuestOSType Collectioncoll = mVBox.GetGuestOSTypes();5540 int osTypeCount = coll. GetCount();5538 /* Initialize guest OS Type list. */ 5539 CGuestOSTypeVector coll = mVBox.GetGuestOSTypes(); 5540 int osTypeCount = coll.size(); 5541 5541 AssertMsg (osTypeCount > 0, ("Number of OS types must not be zero")); 5542 5542 if (osTypeCount > 0) 5543 5543 { 5544 CGuestOSTypeEnumerator en = coll.Enumerate(); 5545 5546 /* Here we assume 'Other' type is always the first, so we 5547 * remember it and will append it to the list when finish */ 5548 CGuestOSType otherType (en.GetNext()); 5544 /* Here we assume the 'Other' type is always the first, so we 5545 * remember it and will append it to the list when finished. */ 5546 CGuestOSType otherType = coll[0]; 5549 5547 QString otherFamilyId (otherType.GetFamilyId()); 5550 5548 5551 5549 /* Fill the lists with all the available OS Types except 5552 * the 'Other' one type, itwill be appended. */5553 while (en.HasMore())5554 { 5555 CGuestOSType os (en.GetNext());5550 * the 'Other' type, which will be appended. */ 5551 for (int i = 1; i < coll.size(); ++i) 5552 { 5553 CGuestOSType os = coll[i]; 5556 5554 QString familyId (os.GetFamilyId()); 5557 5555 if (!mFamilyIDs.contains (familyId)) … … 5563 5561 } 5564 5562 5565 /* Append the 'Other' OS Type to the end of list */5563 /* Append the 'Other' OS Type to the end of list. */ 5566 5564 if (!mFamilyIDs.contains (otherFamilyId)) 5567 5565 { … … 5572 5570 } 5573 5571 5574 /* Fill in OS type icon dictionary */5572 /* Fill in OS type icon dictionary. */ 5575 5573 static const char *kOSTypeIcons [][2] = 5576 5574 { -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r16966 r16971 6 6 7 7 /* 8 * Copyright (C) 2006-200 7Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 692 692 } 693 693 694 STDMETHODIMP VirtualBox::COMGETTER(GuestOSTypes) ( IGuestOSTypeCollection **aGuestOSTypes)694 STDMETHODIMP VirtualBox::COMGETTER(GuestOSTypes) (ComSafeArrayOut (IGuestOSType *, aGuestOSTypes)) 695 695 { 696 696 CheckComArgOutSafeArrayPointerValid(aGuestOSTypes); … … 699 699 CheckComRCReturnRC (autoCaller.rc()); 700 700 701 ComObjPtr <GuestOSTypeCollection> collection;702 collection.createObject();703 704 701 AutoReadLock alock (this); 705 collection->init (mData.mGuestOSTypes); 706 collection.queryInterfaceTo (aGuestOSTypes); 702 703 SafeIfaceArray <IGuestOSType> ostypes (mData.mGuestOSTypes); 704 ostypes.detachTo (ComSafeArrayOutArg (aGuestOSTypes)); 707 705 708 706 return S_OK; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16967 r16971 46 46 * (<result> extraction for the %Rhrc format specifier) 47 47 * 48 Copyright (C) 2006-200 8Sun Microsystems, Inc.48 Copyright (C) 2006-2009 Sun Microsystems, Inc. 49 49 50 50 This file is part of VirtualBox Open Source Edition (OSE), as … … 1409 1409 <attribute name="progressOperations" type="IProgress" readonly="yes" safearray="yes"/> 1410 1410 1411 <attribute name="guestOSTypes" type="IGuestOSType Collection" readonly="yes"/>1411 <attribute name="guestOSTypes" type="IGuestOSType" readonly="yes" safearray="yes"/> 1412 1412 1413 1413 <attribute name="sharedFolders" type="ISharedFolder" readonly="yes" safearray="yes"> … … 7101 7101 <interface 7102 7102 name="IGuestOSType" extends="$unknown" 7103 uuid=" bc415228-eed0-402c-92f5-96fc4e2dd7e4"7103 uuid="cfe9e64c-4430-435b-9e7c-e3d8e417bd58" 7104 7104 wsmap="struct" 7105 7105 > … … 7151 7151 </attribute> 7152 7152 </interface> 7153 7154 7155 <enumerator7156 name="IGuestOSTypeEnumerator" type="IGuestOSType"7157 uuid="a3335e02-4669-4e3c-80c7-c4dc7056a07c"7158 />7159 7160 <collection7161 name="IGuestOSTypeCollection" type="IGuestOSType" enumerator="IGuestOSTypeEnumerator"7162 uuid="a5e36749-a610-498b-9f29-2e36c1042d65"7163 readonly="yes"7164 />7165 7153 7166 7154 <interface -
trunk/src/VBox/Main/include/GuestOSTypeImpl.h
r15064 r16971 5 5 6 6 /* 7 * Copyright (C) 2006-200 7Sun Microsystems, Inc.7 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 101 101 }; 102 102 103 COM_DECL_READONLY_ENUM_AND_COLLECTION (GuestOSType)104 105 103 #endif // ____H_GUESTOSTYPEIMPL 106 104 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r16966 r16971 7 7 8 8 /* 9 * Copyright (C) 2006-200 7Sun Microsystems, Inc.9 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 130 130 STDMETHOD(COMGETTER(FloppyImages)) (ComSafeArrayOut (IFloppyImage *, aFloppyImages)); 131 131 STDMETHOD(COMGETTER(ProgressOperations)) (ComSafeArrayOut (IProgress *, aOperations)); 132 STDMETHOD(COMGETTER(GuestOSTypes)) ( IGuestOSTypeCollection **aGuestOSTypes);132 STDMETHOD(COMGETTER(GuestOSTypes)) (ComSafeArrayOut (IGuestOSType *, aGuestOSTypes)); 133 133 STDMETHOD(COMGETTER(SharedFolders)) (ComSafeArrayOut (ISharedFolder *, aSharedFolders)); 134 134 STDMETHOD(COMGETTER(PerformanceCollector)) (IPerformanceCollector **aPerformanceCollector); -
trunk/src/VBox/Main/xpcom/server.cpp
r16966 r16971 5 5 6 6 /* 7 * Copyright (C) 2006-200 7Sun Microsystems, Inc.7 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 243 243 244 244 COM_IMPL_READONLY_ENUM_AND_COLLECTION(Snapshot) 245 COM_IMPL_READONLY_ENUM_AND_COLLECTION(GuestOSType)246 245 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostDVDDrive) 247 246 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostFloppyDrive)
Note:
See TracChangeset
for help on using the changeset viewer.