* ./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.
This commit is contained in:
Jean-Paul Chaput 2010-07-30 16:39:57 +00:00
parent 0b9a17f85d
commit 32c864b996
2 changed files with 14 additions and 9 deletions

View File

@ -70,13 +70,7 @@ int main ( int argc, char* argv[] )
bfs::path::default_name_check ( bfs::portable_posix_name ); bfs::path::default_name_check ( bfs::portable_posix_name );
Configuration* conf = Configuration::get (); 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() );
}
if ( arguments.count("conf") ) { if ( arguments.count("conf") ) {
bfs::path confPath = ( arguments["conf"].as<string>() ); bfs::path confPath = ( arguments["conf"].as<string>() );
@ -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 (); ConfEditorWidget* editor = new ConfEditorWidget ();
editor->show (); editor->show ();

View File

@ -435,11 +435,16 @@ namespace Cfg {
string id = "\"" + p->getId() + "\""; string id = "\"" + p->getId() + "\"";
string type = "\"" + Parameter::typeToString(p->getType()) + "\""; string type = "\"" + Parameter::typeToString(p->getType()) + "\"";
out << " <parameter" out << " <parameter"
<< " id=" << setw(40) << left << id << " id=" << setw(40) << left << id
<< " type=" << setw(12) << left << type << " type=" << setw(12) << left << type
<< " value=\"" << p->asString() << "\"/>" << " value=\"";
<< endl;
if ( p->getType() == Parameter::Percentage ) out << p->asPercentage();
else out << p->asString();
out << "\"/>" << endl;
} }
out << "</configuration>" << endl; out << "</configuration>" << endl;