Changeset 33598 in vbox
- Timestamp:
- Oct 29, 2010 11:08:42 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67209
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r33596 r33598 950 950 951 951 /** 952 * Returns the user's home directory. Wrapper around RTPathUserHome(). 953 * @param strPath 954 * @return 955 */ 956 HRESULT SystemProperties::getUserHomeDirectory(Utf8Str &strPath) 957 { 958 char szHome[RTPATH_MAX]; 959 int vrc = RTPathUserHome(szHome, sizeof(szHome)); 960 if (RT_FAILURE(vrc)) 961 return setError(E_FAIL, 962 tr("Cannot determine user home directory (%Rrc)"), 963 vrc); 964 strPath = szHome; 965 return S_OK; 966 } 967 968 /** 952 969 * Internal implementation to set the default machine folder. Gets called 953 970 * from the public attribute setter as well as loadSettings(). With 4.0, … … 967 984 { 968 985 // 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; 986 HRESULT rc = getUserHomeDirectory(path); 987 if (FAILED(rc)) return rc; 977 988 path += RTPATH_SLASH_STR "VirtualBox VMs"; 978 989 } -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r33596 r33598 118 118 typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList; 119 119 120 HRESULT getUserHomeDirectory(Utf8Str &strPath); 120 121 HRESULT setDefaultMachineFolder(const Utf8Str &aPath); 121 122 HRESULT setDefaultHardDiskFormat(const Utf8Str &aFormat);
Note:
See TracChangeset
for help on using the changeset viewer.