VirtualBox

Ignore:
Timestamp:
Feb 20, 2009 12:26:19 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43138
Message:

#3551: “Main: Replace remaining collections with safe arrays”
Converted ostype collection. Tested with VBoxManage list ostypes.

File:
1 edited

Legend:

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

    r16966 r16971  
    66
    77/*
    8  * Copyright (C) 2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2008-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    55365536#endif
    55375537
    5538     /* Initialize guest OS Type list */
    5539     CGuestOSTypeCollection coll = mVBox.GetGuestOSTypes();
    5540     int osTypeCount = coll.GetCount();
     5538    /* Initialize guest OS Type list. */
     5539    CGuestOSTypeVector coll = mVBox.GetGuestOSTypes();
     5540    int osTypeCount = coll.size();
    55415541    AssertMsg (osTypeCount > 0, ("Number of OS types must not be zero"));
    55425542    if (osTypeCount > 0)
    55435543    {
    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];
    55495547        QString otherFamilyId (otherType.GetFamilyId());
    55505548
    55515549        /* Fill the lists with all the available OS Types except
    5552          * the 'Other' one type, it will 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];
    55565554            QString familyId (os.GetFamilyId());
    55575555            if (!mFamilyIDs.contains (familyId))
     
    55635561        }
    55645562
    5565         /* Append the 'Other' OS Type to the end of list */
     5563        /* Append the 'Other' OS Type to the end of list. */
    55665564        if (!mFamilyIDs.contains (otherFamilyId))
    55675565        {
     
    55725570    }
    55735571
    5574     /* Fill in OS type icon dictionary */
     5572    /* Fill in OS type icon dictionary. */
    55755573    static const char *kOSTypeIcons [][2] =
    55765574    {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette