VirtualBox

Changeset 447 in vbox for trunk/src


Ignore:
Timestamp:
Jan 30, 2007 10:21:03 PM (18 years ago)
Author:
vboxsync
Message:

Support 'VBoxInternal/Value' overlays.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r441 r447  
    53285328        char *pszExtraDataKey = (char*)strExtraDataKeyUtf8.raw() + 13;
    53295329
    5330         /* the key will be in the format "Node1/Node2/Value" */
     5330        /* the key will be in the format "Node1/Node2/Value" or simply "Value". */
     5331        PCFGMNODE pNode;
    53315332        char *pszCFGMValueName = strrchr(pszExtraDataKey, '/');
    5332         if (!pszCFGMValueName)
    5333             continue;
    5334         /* terminate the node and advance to the value */
    5335         *pszCFGMValueName = '\0';
    5336         pszCFGMValueName++;
    5337 
    5338         PCFGMNODE pNode;
    5339         /* does the node already exist? */
    5340         pNode = CFGMR3GetChild(pRoot, pszExtraDataKey);
    5341         if (pNode)
    5342         {
     5333        if (pszCFGMValueName)
     5334        {
     5335            /* terminate the node and advance to the value */
     5336            *pszCFGMValueName = '\0';
     5337            pszCFGMValueName++;
     5338   
     5339            /* does the node already exist? */
     5340            pNode = CFGMR3GetChild(pRoot, pszExtraDataKey);
     5341            if (pNode)
     5342            {
     5343                /* the value might already exist, remove it to be safe */
     5344                CFGMR3RemoveValue(pNode, pszCFGMValueName);
     5345            }
     5346            else
     5347            {
     5348                /* create the node */
     5349                rc = CFGMR3InsertNode(pRoot, pszExtraDataKey, &pNode);
     5350                AssertMsgRC(rc, ("failed to insert node '%s'\n", pszExtraDataKey));
     5351                if (VBOX_FAILURE(rc) || !pNode)
     5352                    continue;
     5353            }
     5354        }
     5355        else
     5356        {
     5357            pNode = pRoot;
     5358            pszCFGMValueName = pszExtraDataKey;
     5359            pszExtraDataKey--;
     5360
    53435361            /* the value might already exist, remove it to be safe */
    53445362            CFGMR3RemoveValue(pNode, pszCFGMValueName);
    53455363        }
    5346         else
    5347         {
    5348             /* create the node */
    5349             rc = CFGMR3InsertNode(pRoot, pszExtraDataKey, &pNode);
    5350             AssertMsgRC(rc, ("failed to insert node '%s'\n", pszExtraDataKey));
    5351             if (VBOX_FAILURE(rc) || !pNode)
    5352                 continue;
    5353         }
     5364
    53545365        /* now let's have a look at the value */
    53555366        Utf8Str strCFGMValueUtf8 = Utf8Str(strExtraDataValue);
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