diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:53 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:53 +0200 |
commit | 618dfb51d93898632830f1b87443d3f748780871 (patch) | |
tree | bac520a2e261154f8d35b0cb8aa345f5ab373811 /RealtimeSync/xmlProcessing.cpp | |
parent | 3.4 (diff) | |
download | FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.tar.gz FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.tar.bz2 FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.zip |
3.5
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); } |