VirtualBox

Changeset 46302 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
May 28, 2013 8:27:31 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86055
Message:

Main/Machine: don't forget to create a new guest property if it does not exist yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r46285 r46302  
    58935893
    58945894        bool fDelete = !RT_VALID_PTR(aValue) || *(aValue) == '\0';
    5895         HWData::GuestPropertyMap::iterator it =
    5896             mHWData->mGuestProperties.find(utf8Name);
    5897 
     5895        HWData::GuestPropertyMap::iterator it = mHWData->mGuestProperties.find(utf8Name);
    58985896        if (it == mHWData->mGuestProperties.end())
    58995897        {
     
    59405938                }
    59415939                else
    5942                 {
    59435940                    mHWData->mGuestProperties.erase(it);
    5944                 }
    59455941            }
    59465942        }
     
    1323713233         * Convert input up front.
    1323813234         */
    13239         Utf8Str     utf8Name(aName);
    13240         uint32_t    fFlags = NILFLAG;
     13235        Utf8Str  utf8Name(aName);
     13236        uint32_t fFlags = NILFLAG;
    1324113237        if (aFlags)
    1324213238        {
     
    1327513271        mHWData.backup();
    1327613272
     13273        bool fDelete = !RT_VALID_PTR(aValue) || *(aValue) == '\0';
    1327713274        HWData::GuestPropertyMap::iterator it = mHWData->mGuestProperties.find(utf8Name);
    1327813275        if (it != mHWData->mGuestProperties.end())
    1327913276        {
    13280             if (RT_VALID_PTR(aValue) && *(aValue) != '\0')
     13277            if (!fDelete)
    1328113278            {
    1328213279                it->second.strValue   = aValue;
     
    1328613283            else
    1328713284                mHWData->mGuestProperties.erase(it);
    13288 
     13285           
     13286            mData->mGuestPropertiesModified = TRUE;
     13287        }
     13288        else if (!fDelete)
     13289        {
     13290            HWData::GuestProperty prop;
     13291            prop.strValue = aValue;
     13292            prop.mTimestamp = aTimestamp;
     13293            prop.mFlags = fFlags;
     13294
     13295            mHWData->mGuestProperties[utf8Name] = prop;
    1328913296            mData->mGuestPropertiesModified = TRUE;
    1329013297        }
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