VirtualBox

Ignore:
Timestamp:
Feb 27, 2009 9:17:19 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43482
Message:

#3551: “Main: Replace remaining collections with safe arrays”
Converted HostDVDDriveCollection.

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

Legend:

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

    r17175 r17192  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    31333133
    31343134    hostDVDMap.clear();
    3135     CHostDVDDriveEnumerator en =
    3136         vboxGlobal().virtualBox().GetHost().GetDVDDrives().Enumerate();
    3137     while (en.HasMore())
    3138     {
    3139         CHostDVDDrive hostDVD = en.GetNext();
     3135    CHostDVDDriveVector drvvec =
     3136        vboxGlobal().virtualBox().GetHost().GetDVDDrives();
     3137    for (int i = 0; i < drvvec.size(); ++i)
     3138    {
     3139        CHostDVDDrive hostDVD = drvvec[i];
    31403140        /** @todo set icon */
    31413141        QString drvName = hostDVD.GetName();
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMFirstRunWzd.cpp

    r16867 r17192  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    176176    {
    177177        /* Search for the host dvd-drives */
    178         CHostDVDDriveCollection coll =
     178        CHostDVDDriveVector coll =
    179179            vboxGlobal().virtualBox().GetHost().GetDVDDrives();
    180         mHostDVDs.resize (coll.GetCount());
    181         int id = 0;
    182         CHostDVDDriveEnumerator en = coll.Enumerate();
    183         while (en.HasMore())
    184         {
    185             CHostDVDDrive hostDVD = en.GetNext();
     180        mHostDVDs.resize (coll.size());
     181
     182        for (int id = 0; id < coll.size(); ++id)
     183        {
     184            CHostDVDDrive hostDVD = coll[id];
    186185            QString name = hostDVD.GetName();
    187186            QString description = hostDVD.GetDescription();
     
    190189            mCbHost->insertItem (id, fullName);
    191190            mHostDVDs [id] = hostDVD;
    192             ++ id;
    193191        }
    194192
     
    222220
    223221    /* Repopulate the media list */
    224         mCbImage->repopulate();
     222    mCbImage->repopulate();
    225223
    226224    /* Revalidate updated page */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsCD.cpp

    r16853 r17192  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5959
    6060    /* Read out the host DVD drive list and prepare the combobox */
    61     CHostDVDDriveCollection coll =
     61    CHostDVDDriveVector coll =
    6262        vboxGlobal().virtualBox().GetHost().GetDVDDrives();
    63     mHostCDs.resize (coll.GetCount());
     63    mHostCDs.resize (coll.size());
    6464    mCbHostCD->clear();
    65     int id = 0;
    66     CHostDVDDriveEnumerator en = coll.Enumerate();
    67     while (en.HasMore())
    68     {
    69         CHostDVDDrive hostDVD = en.GetNext();
     65
     66    for (int id = 0; id < coll.size(); ++id)
     67    {
     68        CHostDVDDrive hostDVD = coll[id];
    7069        /// @todo (r=dmik) set icon?
    7170        QString name = hostDVD.GetName();
     
    7574        mCbHostCD->insertItem (id, fullName);
    7675        mHostCDs [id] = hostDVD;
    77         ++ id;
    7876    }
    7977
     
    8987                name :
    9088                QString ("%1 (%2)").arg (description, name);
    91             if (coll.FindByName (name).isNull())
     89            if (vboxGlobal().virtualBox().GetHost().FindHostDVDDrive (name).isNull())
    9290            {
    9391                /* If the DVD drive is not currently available,
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