VirtualBox

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


Ignore:
Timestamp:
Jul 18, 2012 2:24:58 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79221
Message:

Frontends/VBoxBalloonCtrl: switch to the machine groups API

Location:
trunk/src/VBox/Frontends/VBoxBalloonCtrl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp

    r41360 r42211  
    347347        Assert(!machine.isNull());
    348348
    349         /* Note: Currently only one group per VM supported? We don't care. */
    350         Bstr strGroups;
    351         CHECK_ERROR_BREAK(machine, GetExtraData(Bstr("VBoxInternal2/VMGroup").raw(),
    352                                                 strGroups.asOutParam()));
     349        /*
     350         * Get groups for this machine.
     351        */
     352        com::SafeArray<BSTR> groups;
     353        CHECK_ERROR_BREAK(machine, COMGETTER(Groups)(ComSafeArrayAsOutParam(groups)));
     354        Utf8Str strGroups;
     355        for (size_t i = 0; i < groups.size(); i++)
     356        {
     357            if (i != 0)
     358                strGroups.append(",");
     359            strGroups.append(Utf8Str(groups[i]));
     360        }
    353361
    354362        /*
     
    357365        VBOXWATCHDOG_MACHINE m;
    358366        m.machine = machine;
    359         int rc2 = groupAdd(m.groups, Utf8Str(strGroups).c_str(), 0 /* Flags */);
     367        int rc2 = groupAdd(m.groups, strGroups.c_str(), 0 /* Flags */);
    360368        AssertRC(rc2);
    361369
     
    699707        vboxListenerImpl->init(new VirtualBoxEventListener());
    700708
    701         com::SafeArray <VBoxEventType_T> eventTypes;
     709        com::SafeArray<VBoxEventType_T> eventTypes;
    702710        eventTypes.push_back(VBoxEventType_OnMachineRegistered);
    703711        eventTypes.push_back(VBoxEventType_OnMachineStateChanged);
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogInternal.h

    r41422 r42211  
    9191    ComPtr<IPerformanceCollector> collector;
    9292#endif
    93     /** The VM group(s) this machine belongs to.
    94      *  Contains groups from per-machine "VBoxInternal2/VMGroup". */
     93    /** The group(s) this machine belongs to. */
    9594    mapGroups groups;
    96     /** Map containing the individual
    97      *  module payloads. */
     95    /** Map containing the individual module payloads. */
    9896    mapPayload payload;
    9997} VBOXWATCHDOG_MACHINE, *PVBOXWATCHDOG_MACHINE;
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