From 3ce41917892dc242817665c44ecc26840b47d561 Mon Sep 17 00:00:00 2001 From: Ingo Date: Mon, 25 May 2015 19:55:59 +0200 Subject: [PATCH] g-key-file-error-quark occures rather often and freezes RT, Issue 807 --- rtengine/procparams.cc | 3 ++- rtengine/rtthumbnail.cc | 3 ++- rtgui/cacheimagedata.cc | 3 ++- rtgui/main.cc | 2 +- rtgui/multilangmgr.cc | 1 + rtgui/options.cc | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e1de0b4cb..abc81b765 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -34,6 +34,7 @@ #include "../rtgui/paramsedited.h" #include "dcp.h" #include "../rtgui/options.h" +#include #define APPVERSION VERSION using namespace std; @@ -1854,7 +1855,7 @@ int ProcParams::write (Glib::ustring &fname, Glib::ustring &content) const { } int ProcParams::load (Glib::ustring fname, ParamsEdited* pedited) { - + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." if (fname.empty()) return 1; diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 8030df11e..557b791a4 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -39,6 +39,7 @@ #include "jpeg.h" #include "../rtgui/ppversion.h" #include "improccoordinator.h" +#include extern Options options; @@ -1528,7 +1529,7 @@ bool Thumbnail::readImage (const Glib::ustring& fname) { } bool Thumbnail::readData (const Glib::ustring& fname) { - + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." SafeKeyFile keyFile; try { diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index 6516d38c8..ca210cf6d 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -22,6 +22,7 @@ #include "../rtengine/safekeyfile.h" #include "../rtengine/safegtk.h" #include "version.h" +#include CacheImageData::CacheImageData () : md5(""), supported(false), format(FT_Invalid), rankOld(-1), inTrashOld(false), recentlySaved(false), @@ -32,7 +33,7 @@ CacheImageData::CacheImageData () * Load the General, DateTime, ExifInfo, File info and ExtraRawInfo sections of the image data file */ int CacheImageData::load (const Glib::ustring& fname) { - + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." rtengine::SafeKeyFile keyFile; try { diff --git a/rtgui/main.cc b/rtgui/main.cc index 8f9bc4695..8e536d663 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -98,7 +98,7 @@ int processLineParams( int argc, char **argv ); int main(int argc, char **argv) { setlocale(LC_ALL,""); - + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." // Uncomment the following line if you want to use the "--g-fatal-warnings" command line flag //gtk_init (&argc, &argv); diff --git a/rtgui/multilangmgr.cc b/rtgui/multilangmgr.cc index 12b3173a0..1bed66dc4 100755 --- a/rtgui/multilangmgr.cc +++ b/rtgui/multilangmgr.cc @@ -140,6 +140,7 @@ Glib::ustring MultiLangMgr::getOSUserLanguage() { #elif defined(__linux__) || defined(__APPLE__) char *tmplocale; tmplocale = setlocale(LC_CTYPE,""); + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." if(tmplocale) langName = TranslateRFC2Language(tmplocale); #endif diff --git a/rtgui/options.cc b/rtgui/options.cc index 416618229..7ffb9d4b4 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -646,7 +646,7 @@ void Options::filterOutParsedExtensions () { } int Options::readFromFile (Glib::ustring fname) { - + setlocale(LC_NUMERIC, "C"); // to set decimal point to "." rtengine::SafeKeyFile keyFile; if( !safe_file_test(fname,Glib::FILE_TEST_EXISTS))