Fix the key file write path which depends on exceptions from loading before writing being swalloed.
This commit is contained in:
parent
ad45ba6df1
commit
be173412f1
@ -1741,7 +1741,9 @@ bool Thumbnail::readData (const Glib::ustring& fname)
|
|||||||
try {
|
try {
|
||||||
MyMutex::MyLock thmbLock(thumbMutex);
|
MyMutex::MyLock thmbLock(thumbMutex);
|
||||||
|
|
||||||
if (!keyFile.load_from_file (fname)) {
|
try {
|
||||||
|
keyFile.load_from_file (fname);
|
||||||
|
} catch (Glib::Error&) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1836,7 +1838,10 @@ bool Thumbnail::writeData (const Glib::ustring& fname)
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
Glib::KeyFile keyFile;
|
Glib::KeyFile keyFile;
|
||||||
|
|
||||||
|
try {
|
||||||
keyFile.load_from_file (fname);
|
keyFile.load_from_file (fname);
|
||||||
|
} catch (Glib::Error&) {}
|
||||||
|
|
||||||
keyFile.set_double ("LiveThumbData", "CamWBRed", camwbRed);
|
keyFile.set_double ("LiveThumbData", "CamWBRed", camwbRed);
|
||||||
keyFile.set_double ("LiveThumbData", "CamWBGreen", camwbGreen);
|
keyFile.set_double ("LiveThumbData", "CamWBGreen", camwbGreen);
|
||||||
|
@ -199,7 +199,10 @@ int CacheImageData::save (const Glib::ustring& fname)
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
Glib::KeyFile keyFile;
|
Glib::KeyFile keyFile;
|
||||||
|
|
||||||
|
try {
|
||||||
keyFile.load_from_file (fname);
|
keyFile.load_from_file (fname);
|
||||||
|
} catch (Glib::Error&) {}
|
||||||
|
|
||||||
keyFile.set_string ("General", "MD5", md5);
|
keyFile.set_string ("General", "MD5", md5);
|
||||||
keyFile.set_string ("General", "Version", VERSION); // Application's version
|
keyFile.set_string ("General", "Version", VERSION); // Application's version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user