Changeset 33596 in vbox
- Timestamp:
- Oct 29, 2010 10:47:07 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 67207
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r33595 r33596 245 245 /** 246 246 * Initializes a new machine instance; this init() variant creates a new, empty machine. 247 * This gets called from VirtualBox::CreateMachine() or VirtualBox::CreateLegacyMachine().247 * This gets called from VirtualBox::CreateMachine(). 248 248 * 249 249 * @param aParent Associated parent object … … 771 771 772 772 // uninit media from this machine's media registry, if they're still there 773 mParent->unregisterMachineMedia(getId()); 773 Guid uuidMachine(getId()); 774 if (!uuidMachine.isEmpty()) // can be empty if we're called from a failure of Machine::init 775 mParent->unregisterMachineMedia(uuidMachine); 774 776 775 777 /* the lock is no more necessary (SessionMachine is uninitialized) */ -
trunk/src/VBox/Main/MediumImpl.cpp
r33567 r33596 1170 1170 { 1171 1171 strFull = strMachineFolder; 1172 strFull += RTPATH_ DELIMITER;1172 strFull += RTPATH_SLASH; 1173 1173 strFull += data.strLocation; 1174 1174 } -
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r33567 r33596 547 547 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 548 548 549 m _strDefaultMachineFolderFull.cloneTo(aDefaultMachineFolder);549 m->strDefaultMachineFolder.cloneTo(aDefaultMachineFolder); 550 550 551 551 return S_OK; … … 949 949 ///////////////////////////////////////////////////////////////////////////// 950 950 951 HRESULT SystemProperties::setDefaultMachineFolder(const Utf8Str &aPath) 952 { 953 Utf8Str path(aPath); 954 if (path.isEmpty()) 955 path = "Machines"; 956 957 /* get the full file name */ 958 Utf8Str folder; 959 int vrc = mParent->calculateFullPath(path, folder); 960 if (RT_FAILURE(vrc)) 961 return setError(E_FAIL, 962 tr("Invalid default machine folder '%s' (%Rrc)"), 963 path.c_str(), 964 vrc); 951 /** 952 * Internal implementation to set the default machine folder. Gets called 953 * from the public attribute setter as well as loadSettings(). With 4.0, 954 * the "default default" machine folder has changed, and we now require 955 * a full path always. 956 * @param aPath 957 * @return 958 */ 959 HRESULT SystemProperties::setDefaultMachineFolder(const Utf8Str &strPath) 960 { 961 Utf8Str path(strPath); // make modifiable 962 if ( path.isEmpty() // used by API calls to reset the default 963 || path == "Machines" // this value (exactly like this, without path) is stored 964 // in VirtualBox.xml if user upgrades from before 4.0 and 965 // has not changed the default machine folder 966 ) 967 { 968 // new default with VirtualBox 4.0: "$HOME/VirtualBox VMs" 969 char szHome[200]; // RTPATH_MAX is ridiculously large 970 int vrc = RTPathUserHome(szHome, sizeof(szHome)); 971 if (RT_FAILURE(vrc)) 972 return setError(E_FAIL, 973 tr("Cannot determine user home directory (%Rrc)"), 974 vrc); 975 976 path = szHome; 977 path += RTPATH_SLASH_STR "VirtualBox VMs"; 978 } 979 980 if (!RTPathStartsWithRoot(path.c_str())) 981 return setError(E_INVALIDARG, 982 tr("Given default machine folder '%s' is not fully qualified"), 983 path.c_str()); 965 984 966 985 m->strDefaultMachineFolder = path; 967 m_strDefaultMachineFolderFull = folder;968 986 969 987 return S_OK; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r33556 r33596 7244 7244 <desc> 7245 7245 Full path to the default directory used to create new or open 7246 existing machines when a settings file name contains no7246 existing machines when a machine settings file name contains no 7247 7247 path. 7248 7248 7249 The initial value of this property is 7250 <tt><</tt><link to="IVirtualBox::homeFolder"> 7251 VirtualBox_home</link><tt>>/Machines</tt>. 7252 7253 <note> 7254 Setting this property to @c null or an empty string will restore the 7255 initial value. 7256 </note> 7257 <note> 7258 When settings this property, the specified path can be 7259 absolute (full path) or relative 7260 to the <link to="IVirtualBox::homeFolder"> 7261 VirtualBox home directory</link>. 7262 When reading this property, a full path is 7263 always returned. 7264 </note> 7265 <note> 7266 The specified path may not exist, it will be created 7267 when necessary. 7268 </note> 7249 Starting with VirtualBox 4.0, by default, this attribute contains 7250 the full path of folder named "VirtualBox VMs" in the user's 7251 home directory, which depends on the host platform. 7252 7253 When setting this attribute, a full path must be specified. 7254 Setting this property to @c null or an empty string or the 7255 special value "Machines" (for compatibility reasons) will restore 7256 that default value. 7257 7258 If the folder specified herein does not exist, it will be created 7259 automatically as needed. 7269 7260 7270 7261 <see> -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r33386 r33596 129 129 settings::SystemProperties *m; 130 130 131 Utf8Str m_strDefaultMachineFolderFull;132 133 131 MediumFormatList m_llMediumFormats; 134 132
Note:
See TracChangeset
for help on using the changeset viewer.