diff options
Diffstat (limited to 'RealtimeSync/xmlProcessing.cpp')
-rw-r--r-- | RealtimeSync/xmlProcessing.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/RealtimeSync/xmlProcessing.cpp b/RealtimeSync/xmlProcessing.cpp index 7cf78c7a..e9420d1b 100644 --- a/RealtimeSync/xmlProcessing.cpp +++ b/RealtimeSync/xmlProcessing.cpp @@ -27,17 +27,16 @@ void xmlAccess::readRealConfig(const wxString& filename, XmlRealConfig& config) { //load XML if (!wxFileExists(filename)) - throw XmlError(wxString(_("File does not exist:")) + wxT(" \"") + filename + wxT("\"")); + throw XmlError(wxString(_("File does not exist:")) + wxT("\n\"") + filename + wxT("\"")); TiXmlDocument doc; - if (!loadXmlDocument(filename, XML_REAL_CONFIG, doc)) - throw XmlError(wxString(_("Error reading file:")) + wxT(" \"") + filename + wxT("\"")); + loadXmlDocument(filename, XML_REAL_CONFIG, doc); //throw (XmlError) RtsXmlParser parser(doc.RootElement()); parser.readXmlRealConfig(config); //read GUI layout configuration if (parser.errorsOccured()) - throw XmlError(wxString(_("Error parsing configuration file:")) + wxT(" \"") + filename + wxT("\"\n\n") + + throw XmlError(wxString(_("Error parsing configuration file:")) + wxT("\n\"") + filename + wxT("\"\n\n") + parser.getErrorMessageFormatted(), XmlError::WARNING); } @@ -48,10 +47,10 @@ void xmlAccess::writeRealConfig(const XmlRealConfig& outputCfg, const wxString& getDefaultXmlDocument(XML_REAL_CONFIG, doc); //populate and write XML tree - if ( !writeXmRealSettings(outputCfg, doc) || //add GUI layout configuration settings - !saveXmlDocument(filename, doc)) //save XML - throw XmlError(wxString(_("Error writing file:")) + wxT(" \"") + filename + wxT("\"")); - return; + if (!writeXmRealSettings(outputCfg, doc)) //add GUI layout configuration settings + throw XmlError(wxString(_("Error writing file:")) + wxT("\n\"") + filename + wxT("\"")); + + saveXmlDocument(filename, doc); //throw (XmlError) } //-------------------------------------------------------------------------------- @@ -60,15 +59,15 @@ void xmlAccess::writeRealConfig(const XmlRealConfig& outputCfg, const wxString& void RtsXmlParser::readXmlRealConfig(xmlAccess::XmlRealConfig& outputCfg) { //read directories for monitoring - const TiXmlElement* directoriesToWatch = TiXmlHandleConst(root).FirstChild("Directories").ToElement(); + const TiXmlElement* directoriesToWatch = TiXmlHandleConst(getRoot()).FirstChild("Directories").ToElement(); readXmlElementLogging("Folder", directoriesToWatch, outputCfg.directories); //commandline to execute - readXmlElementLogging("Commandline", root, outputCfg.commandline); + readXmlElementLogging("Commandline", getRoot(), outputCfg.commandline); //delay - readXmlElementLogging("Delay", root, outputCfg.delay); + readXmlElementLogging("Delay", getRoot(), outputCfg.delay); } |