Changeset 22188 in vbox for trunk/src/VBox
- Timestamp:
- Aug 11, 2009 6:06:11 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r22187 r22188 31 31 #include <iprt/env.h> 32 32 #include <iprt/cpputils.h> 33 #include <iprt/xml_cpp.h> 33 34 34 35 #include <VBox/com/com.h> … … 164 165 VBOX_GLOBAL_SETTINGS_FILE); 165 166 HRESULT rc = S_OK; 167 bool fCreate = false; 166 168 try 167 169 { 168 170 // load and parse VirtualBox.xml; this will throw on XML or logic errors 169 171 m_pMainConfigFile = new settings::MainConfigFile(&m_strSettingsFilePath); 170 171 // either a) valid XML file loaded or b) file not found and defaults loaded: 172 // now construct our global objects from that data 172 } 173 catch (xml::EIPRTFailure &e) 174 { 175 // this is thrown by the XML backend if the RTOpen() call fails; 176 // only if the main settings file does not exist, create it, 177 // if there's something more serious, then do fail! 178 if (e.rc() == VERR_FILE_NOT_FOUND) 179 fCreate = true; 180 } 181 catch (HRESULT err) 182 { 183 /* we assume that error info is set by the thrower */ 184 rc = err; 185 } 186 catch (...) 187 { 188 rc = VirtualBox::handleUnexpectedExceptions(RT_SRC_POS); 189 } 190 191 try 192 { 193 if (fCreate) 194 m_pMainConfigFile = new settings::MainConfigFile(NULL); 173 195 174 196 #ifdef VBOX_WITH_RESOURCE_USAGE_API … … 2986 3008 2987 3009 // now write out the XML 2988 m_pMainConfigFile->write( );3010 m_pMainConfigFile->write(m_strSettingsFilePath); 2989 3011 } 2990 3012 catch (HRESULT err) -
trunk/src/VBox/Main/xml/Settings.cpp
r22173 r22188 786 786 * builds an XML DOM tree and writes it out to disk. 787 787 */ 788 void MainConfigFile::write() 789 { 788 void MainConfigFile::write(const com::Utf8Str strFilename) 789 { 790 m->strFilename = strFilename; 790 791 createStubDocument(); 791 792 … … 1952 1953 { 1953 1954 m->strFilename = strFilename; 1954 1955 1955 createStubDocument(); 1956 1956
Note:
See TracChangeset
for help on using the changeset viewer.