VirtualBox

Changeset 53065 in vbox for trunk


Ignore:
Timestamp:
Oct 15, 2014 1:00:00 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI rework/cleanup for 7115 (part #21): Using cached getters in UIMachineLogic sub-classes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r53046 r53065  
    6767bool UIMachineLogicFullscreen::checkAvailability()
    6868{
    69     /* Temporary get a machine object: */
    70     const CMachine &machine = uisession()->session().GetMachine();
    71 
    7269    /* Check if there is enough physical memory to enter fullscreen: */
    7370    if (uisession()->isGuestAdditionsActive())
    7471    {
    75         quint64 availBits = machine.GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
     72        quint64 availBits = machine().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
    7673        quint64 usedBits = m_pScreenLayout->memoryRequirements();
    7774        if (availBits < usedBits)
     
    536533
    537534    /* Create machine-window(s): */
    538     for (uint cScreenId = 0; cScreenId < session().GetMachine().GetMonitorCount(); ++cScreenId)
     535    for (uint cScreenId = 0; cScreenId < machine().GetMonitorCount(); ++cScreenId)
    539536        addMachineWindow(UIMachineWindow::create(this, cScreenId));
    540537
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r52978 r53065  
    206206    LONG uOriginX, uOriginY;
    207207    KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
    208     CDisplay display = session().GetConsole().GetDisplay();
    209     display.GetScreenResolution(iIndex, uWidth, uHeight, uBitsPerPixel, uOriginX, uOriginY, monitorStatus);
     208    display().GetScreenResolution(iIndex, uWidth, uHeight, uBitsPerPixel, uOriginX, uOriginY, monitorStatus);
    210209    if (!fEnabled)
    211         display.SetVideoModeHint(iIndex, false, false, 0, 0, 0, 0, 0);
     210        display().SetVideoModeHint(iIndex, false, false, 0, 0, 0, 0, 0);
    212211    else
    213212    {
     
    217216        if (!uHeight)
    218217            uHeight = 600;
    219         display.SetVideoModeHint(iIndex, true, false, 0, 0, uWidth, uHeight, 32);
     218        display().SetVideoModeHint(iIndex, true, false, 0, 0, uWidth, uHeight, 32);
    220219    }
    221220}
     
    224223{
    225224    /* Resize guest to required size: */
    226     CDisplay display = session().GetConsole().GetDisplay();
    227     display.SetVideoModeHint(iIndex, uisession()->isScreenVisible(iIndex),
     225    display().SetVideoModeHint(iIndex, uisession()->isScreenVisible(iIndex),
    228226                             false, 0, 0, size.width(), size.height(), 0);
    229227}
     
    268266
    269267    /* Get monitors count: */
    270     ulong uMonitorCount = session().GetMachine().GetMonitorCount();
     268    ulong uMonitorCount = machine().GetMonitorCount();
    271269    /* Create machine window(s): */
    272270    for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp

    r52730 r53065  
    126126
    127127    /* Get monitors count: */
    128     ulong uMonitorCount = session().GetMachine().GetMonitorCount();
     128    ulong uMonitorCount = machine().GetMonitorCount();
    129129    /* Create machine window(s): */
    130130    for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r52937 r53065  
    6565bool UIMachineLogicSeamless::checkAvailability()
    6666{
    67     /* Temporary get a machine object: */
    68     const CMachine &machine = uisession()->session().GetMachine();
    69 
    7067    /* Check if there is enough physical memory to enter seamless: */
    7168    if (uisession()->isGuestAdditionsActive())
    7269    {
    73         quint64 availBits = machine.GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
     70        quint64 availBits = machine().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
    7471        quint64 usedBits = m_pScreenLayout->memoryRequirements();
    7572        if (availBits < usedBits)
     
    261258
    262259    /* Create machine-window(s): */
    263     for (uint cScreenId = 0; cScreenId < session().GetMachine().GetMonitorCount(); ++cScreenId)
     260    for (uint cScreenId = 0; cScreenId < machine().GetMonitorCount(); ++cScreenId)
    264261        addMachineWindow(UIMachineWindow::create(this, cScreenId));
    265262
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