VirtualBox

Changeset 74915 in vbox


Ignore:
Timestamp:
Oct 18, 2018 12:24:32 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125916
Message:

FE/Qt: bugref:9261: VirtualBox Manager: Fixing regression for group saving mechanism after QString => QUuid change.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r74878 r74915  
    17691769
    17701770    /* Which VM we are loading: */
    1771     LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toString().toUtf8().constData()));
     1771    LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", toOldStyleUuid(machine.GetId()).toUtf8().constData()));
    17721772    /* Is that machine accessible? */
    17731773    if (machine.GetAccessible())
     
    17931793        }
    17941794        /* Update group definitions: */
    1795         m_groups[machine.GetId().toString()] = groupList;
     1795        m_groups[toOldStyleUuid(machine.GetId())] = groupList;
    17961796    }
    17971797    /* Inaccessible machine: */
     
    17991799    {
    18001800        /* VM is accessible: */
    1801         LogRelFlow(("UIChooserModel:  VM {%s} is inaccessible.\n", machine.GetId().toString().toUtf8().constData()));
     1801        LogRelFlow(("UIChooserModel:  VM {%s} is inaccessible.\n", toOldStyleUuid(machine.GetId()).toUtf8().constData()));
    18021802        /* Create machine-item with main-root group-item as parent: */
    18031803        createMachineItem(machine, mainRoot());
     
    19111911            /* Which position should be current item placed by definitions? */
    19121912            QString strDefinitionName = pItem->type() == UIChooserItemType_Group ? pItem->name() :
    1913                                         pItem->type() == UIChooserItemType_Machine ? pItem->toMachineItem()->id().toString() :
     1913                                        pItem->type() == UIChooserItemType_Machine ? toOldStyleUuid(pItem->toMachineItem()->id()) :
    19141914                                        QString();
    19151915            AssertMsg(!strDefinitionName.isEmpty(), ("Wrong definition name!"));
     
    19781978{
    19791979    /* Create machine-item: */
    1980     new UIChooserItemMachine(pParentItem, machine, getDesiredPosition(pParentItem, UIChooserItemType_Machine, machine.GetId().toString()));
     1980    new UIChooserItemMachine(pParentItem, machine, getDesiredPosition(pParentItem, UIChooserItemType_Machine, toOldStyleUuid(machine.GetId())));
    19811981}
    19821982
     
    21602160        if (UIChooserItemMachine *pMachineItem = pItem->toMachineItem())
    21612161            if (pMachineItem->accessible())
    2162                 definitions[pMachineItem->id().toString()] << pParentGroup->fullName();
     2162                definitions[toOldStyleUuid(pMachineItem->id())] << pParentGroup->fullName();
    21632163    /* Iterate over all the group-items: */
    21642164    foreach (UIChooserItem *pItem, pParentGroup->items(UIChooserItemType_Group))
     
    21802180    /* Iterate over all the machine-items: */
    21812181    foreach (UIChooserItem *pItem, pParentItem->items(UIChooserItemType_Machine))
    2182         orders[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id().toString());
     2182        orders[strExtraDataKey] << QString("m=%1").arg(toOldStyleUuid(pItem->toMachineItem()->id()));
    21832183}
    21842184
     
    21952195    if (UIThreadGroupOrderSave::instance())
    21962196        UIThreadGroupOrderSave::cleanup();
     2197}
     2198
     2199/* static */
     2200QString UIChooserModel::toOldStyleUuid(const QUuid &uId)
     2201{
     2202    return uId.toString().remove(QRegExp("[{}]"));
    21972203}
    21982204
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r74878 r74915  
    456456        /** Makes sure group orders saving is finished. */
    457457        void makeSureGroupOrdersSaveIsFinished();
     458
     459        /** Returns QString representation for passed @a uId, wiping out {} symbols.
     460          * @note  Required for backward compatibility after QString=>QUuid change. */
     461        static QString toOldStyleUuid(const QUuid &uId);
    458462    /** @} */
    459463
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