- Unify interface of string_utils. I dropped most of the exception
handling, hoping it's unnecessary. Code should be slightly more maintainable now. git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@943 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
696c513ed2
commit
231662825d
8 changed files with 55 additions and 185 deletions
|
@ -155,11 +155,11 @@ GlobalPreferences::key_file_read(KeyFile& kf)
|
|||
_pol_dirs.clear();
|
||||
// read speed
|
||||
{
|
||||
int new_speed;
|
||||
int new_speed = 1000; // use a default value
|
||||
const Glib::ustring* val = kf.search_value(Glib::ustring("speed"));
|
||||
if (val)
|
||||
{
|
||||
string_to_int(*val, new_speed);
|
||||
new_speed = string_to<int>(*val);
|
||||
set_speed(new_speed);
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ GlobalPreferences::key_file_write(KeyFile& kf)
|
|||
{
|
||||
Glib::ustring key("speed");
|
||||
Glib::ustring value;
|
||||
int_to_string(_speed, value);
|
||||
to_string<int>(_speed, value);
|
||||
kf.insert_key_value(key, value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue