Update of /cvsroot/audacity/audacity-src/src/prefs
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv14899/prefs
Modified Files:
KeyConfigPrefs.cpp
Log Message:
* XMLFileWriter now throws an exception if writing the .xml file fails
* Add error checking (exception handling) to most places where XML files are
written
* If the new .aup file was successfully saved, delete the old .aup.bak file in
order not to confuse users
* Never open .aup.bak files, show an informational message instead
Index: KeyConfigPrefs.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/prefs/KeyConfigPrefs.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- KeyConfigPrefs.cpp 4 Apr 2009 10:55:55 -0000 1.79
+++ KeyConfigPrefs.cpp 1 May 2009 18:26:33 -0000 1.80
@@ -265,18 +265,20 @@
XMLFileWriter prefFile;
- prefFile.Open(file, wxT("wb"));
-
- if (!prefFile.IsOpened()) {
+ try
+ {
+ prefFile.Open(file, wxT("wb"));
+ mManager->WriteXML(prefFile);
+ prefFile.Close();
+ }
+ catch (XMLFileWriterException* pException)
+ {
wxMessageBox(_("Couldn't write to file: ") + file,
_("Error saving keyboard shortcuts"),
wxOK | wxCENTRE, this);
- return;
- }
- mManager->WriteXML(prefFile);
-
- prefFile.Close();
+ delete pException;
+ }
}
void KeyConfigPrefs::OnDefaults(wxCommandEvent & e)
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs