VirtualBox

Changeset 17260 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 3, 2009 9:16:15 AM (16 years ago)
Author:
vboxsync
Message:

#3551: “Main: Replace remaining collections with safe arrays”
Replace SnapshotCollection. Reviewed by dmik. Tested with GUI.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r17078 r17260  
    6666
    6767    /* get the children */
    68     ComPtr<ISnapshotCollection> coll;
    69     rootSnapshot->COMGETTER(Children)(coll.asOutParam());
    70     if (coll)
    71     {
    72         ComPtr<ISnapshotEnumerator> enumerator;
    73         coll->Enumerate(enumerator.asOutParam());
    74         ULONG index = 0;
    75         BOOL hasMore = FALSE;
    76         while (enumerator->HasMore(&hasMore), hasMore)
    77         {
    78             ComPtr<ISnapshot> snapshot;
    79             enumerator->GetNext(snapshot.asOutParam());
     68    SafeIfaceArray <ISnapshot> coll;
     69    rootSnapshot->COMGETTER(Children)(ComSafeArrayAsOutParam(coll));
     70    if (!coll.isNull())
     71    {
     72        for (size_t index = 0; index < coll.size(); ++index)
     73        {
     74            ComPtr<ISnapshot> snapshot = coll[index];
    8075            if (snapshot)
    8176            {
     
    8883                showSnapshots(snapshot, details, newPrefix, level + 1);
    8984            }
    90             index++;
    9185        }
    9286    }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r17255 r17260  
    26712671                               regExp.cap (1).toInt() : maxSnapShotIndex;
    26722672        /* Traversing to the next child */
    2673         index = index.GetChildren().GetItemAt (0);
     2673        index = index.GetChildren()[0];
    26742674    }
    26752675    dlg.mLeName->setText (snapShotName.arg (maxSnapShotIndex + 1));
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp

    r13580 r17260  
    800800    }
    801801
    802     CSnapshotEnumerator en = aSnapshot.GetChildren().Enumerate();
    803     while (en.HasMore())
    804     {
    805         CSnapshot sn = en.GetNext();
     802    CSnapshotVector snapvec = aSnapshot.GetChildren();
     803    for (int i = 0; i < snapvec.size(); ++i)
     804    {
     805        CSnapshot sn = snapvec[i];
    806806        populateSnapshots (sn, si);
    807807    }
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