From: xerakko Date: Sat, 9 Sep 2006 10:21:21 +0000 (+0000) Subject: Solve the gamma problem (corrected locale when loading/saving settings file) X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=e7e1794959f6b4af0d60d69b5501adcd305f2207;p=synfig.git Solve the gamma problem (corrected locale when loading/saving settings file) git-svn-id: http://svn.voria.com/code@228 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 53f3581..26f2f30 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -31,6 +31,7 @@ #include #include +#include #ifdef HAVE_SYS_ERRNO_H #include @@ -1424,8 +1425,11 @@ App::set_time_format(synfig::Time::Format x) void App::save_settings() { + char * old_locale; try { + old_locale=strdup(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); { std::string filename=get_config_file("accelrc"); Gtk::AccelMap::save(filename); @@ -1449,6 +1453,7 @@ App::save_settings() std::string filename=get_config_file("settings"); synfigapp::Main::settings().save_to_file(filename); + setlocale(LC_NUMERIC,old_locale); } catch(...) { @@ -1459,8 +1464,11 @@ App::save_settings() void App::load_settings() { + char * old_locale; try { + old_locale=strdup(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); { std::string filename=get_config_file("accelrc"); Gtk::AccelMap::load(filename); @@ -1500,7 +1508,7 @@ App::load_settings() synfigapp::Main::settings().set_value("window.toolbox.pos","4 4"); } } - + setlocale(LC_NUMERIC,old_locale); } catch(...) {