VirtualBox

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


Ignore:
Timestamp:
Mar 14, 2013 1:46:26 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84288
Message:

Reverting r84283: Have to rework it according further similar code.

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

Legend:

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

    r45035 r45040  
    6060const char* UIDefs::GUI_SaveMountedAtRuntime = "GUI/SaveMountedAtRuntime";
    6161const char* UIDefs::GUI_PassCAD = "GUI/PassCAD";
    62 const char* UIDefs::GUI_HideFromManager = "GUI/HideFromManager";
    6362
    6463/* Mini tool-bar definitions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r45035 r45040  
    137137    extern const char* GUI_SaveMountedAtRuntime;
    138138    extern const char* GUI_PassCAD;
    139     extern const char* GUI_HideFromManager;
    140139
    141140    /* Mini tool-bar declarations: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r45035 r45040  
    597597void UIGChooserModel::sltMachineRegistered(QString strId, bool fRegistered)
    598598{
    599     /* New machine registered? */
     599    /* New VM registered? */
    600600    if (fRegistered)
    601601    {
    602602        /* Search for corresponding machine: */
    603603        CMachine machine = vboxGlobal().virtualBox().FindMachine(strId);
    604         /* Should we show this machine? */
    605         if (shouldWeShowMachine(machine))
     604        /* Machine was found? */
     605        if (!machine.isNull())
    606606        {
    607607            /* Add new machine-item: */
     
    615615        }
    616616    }
    617     /* Existing machine unregistered? */
     617    /* Existing VM unregistered? */
    618618    else
    619619    {
     
    884884    /* Remove all the items first: */
    885885    mainRoot()->removeAll(strId);
    886     /* Update model: */
     886
     887    /* Check if such machine still present: */
     888    CMachine machine = vboxGlobal().virtualBox().FindMachine(strId);
     889    if (machine.isNull())
     890        return;
     891
     892    /* Add machine into the tree: */
     893    addMachineIntoTheTree(machine);
     894
     895    /* And update model: */
    887896    cleanupGroupTree();
    888 
    889     /* Should we show this machine? */
    890     CMachine machine = vboxGlobal().virtualBox().FindMachine(strId);
    891     if (shouldWeShowMachine(machine))
    892         addMachineIntoTheTree(machine);
    893 
    894     /* Update model: */
    895897    updateNavigation();
    896898    updateLayout();
     
    16141616void UIGChooserModel::loadGroupTree()
    16151617{
    1616     /* Add all the approved machines we have into the group-tree: */
     1618    /* Add all the machines we have into the group-tree: */
    16171619    LogRel(("Loading VMs started...\n"));
    1618     foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines())
    1619         if (shouldWeShowMachine(machine))
    1620             addMachineIntoTheTree(machine);
     1620    foreach (const CMachine &machine, vboxGlobal().virtualBox().GetMachines())
     1621        addMachineIntoTheTree(machine);
    16211622    LogRel(("Loading VMs finished.\n"));
    16221623}
     
    18341835}
    18351836
    1836 /* static */
    1837 bool UIGChooserModel::shouldWeShowMachine(CMachine &machine)
    1838 {
    1839     /* False for null machines: */
    1840     if (machine.isNull())
    1841         return false;
    1842 
    1843     /* Check corresponding extra-data flag: */
    1844     QString strMachineIgnored(machine.GetExtraData(GUI_HideFromManager));
    1845     return    strMachineIgnored.compare("true", Qt::CaseInsensitive) != 0
    1846            && strMachineIgnored.compare("yes", Qt::CaseInsensitive) != 0
    1847            && strMachineIgnored != "1";
    1848 }
    1849 
    18501837void UIGChooserModel::saveGroupDefinitions()
    18511838{
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h

    r45035 r45040  
    266266    int positionFromDefinitions(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName);
    267267    void createMachineItem(const CMachine &machine, UIGChooserItem *pParentItem);
    268     static bool shouldWeShowMachine(CMachine &machine);
    269268
    270269    /* Helpers: Saving stuff: */
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