From 32c864b996933e9c0270910c14ca603c765de43c Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 30 Jul 2010 16:39:57 +0000 Subject: [PATCH] * ./vlsisapd/src/configuration: - Bug: In Configuration::writeToStream(), percentage parameters values where incorrectly written (divideds by 100). - Bug: In ConfEditorMain, read the "dot" configuration file *after* the system one. --- vlsisapd/src/configuration/src/ConfEditorMain.cpp | 14 +++++++------- vlsisapd/src/configuration/src/Configuration.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/vlsisapd/src/configuration/src/ConfEditorMain.cpp b/vlsisapd/src/configuration/src/ConfEditorMain.cpp index afa1c6b3..c0e6976b 100644 --- a/vlsisapd/src/configuration/src/ConfEditorMain.cpp +++ b/vlsisapd/src/configuration/src/ConfEditorMain.cpp @@ -70,13 +70,7 @@ int main ( int argc, char* argv[] ) bfs::path::default_name_check ( bfs::portable_posix_name ); - Configuration* conf = Configuration::get (); - bfs::path dotConfPath ( "./.coriolis2.configuration.xml" ); - - if ( bfs::exists(dotConfPath) ) { - cout << "Reading dot configuration: <" << dotConfPath.string() << ">." << endl; - conf->readFromFile ( dotConfPath.string() ); - } + Configuration* conf = Configuration::get (); if ( arguments.count("conf") ) { bfs::path confPath = ( arguments["conf"].as() ); @@ -88,6 +82,12 @@ int main ( int argc, char* argv[] ) } } + bfs::path dotConfPath ( "./.coriolis2.configuration.xml" ); + if ( bfs::exists(dotConfPath) ) { + cout << "Reading dot configuration: <" << dotConfPath.string() << ">." << endl; + conf->readFromFile ( dotConfPath.string() ); + } + ConfEditorWidget* editor = new ConfEditorWidget (); editor->show (); diff --git a/vlsisapd/src/configuration/src/Configuration.cpp b/vlsisapd/src/configuration/src/Configuration.cpp index 63b9ee45..eafe7f5b 100644 --- a/vlsisapd/src/configuration/src/Configuration.cpp +++ b/vlsisapd/src/configuration/src/Configuration.cpp @@ -435,11 +435,16 @@ namespace Cfg { string id = "\"" + p->getId() + "\""; string type = "\"" + Parameter::typeToString(p->getType()) + "\""; + out << " asString() << "\"/>" - << endl; + << " value=\""; + + if ( p->getType() == Parameter::Percentage ) out << p->asPercentage(); + else out << p->asString(); + + out << "\"/>" << endl; } out << "" << endl;