diff options
Diffstat (limited to 'subsurface-core/qthelper.cpp')
-rw-r--r-- | subsurface-core/qthelper.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp index 7c67e0993..e103b44e5 100644 --- a/subsurface-core/qthelper.cpp +++ b/subsurface-core/qthelper.cpp @@ -1108,11 +1108,14 @@ QString fileFromHash(char *hash) return localFilenameOf[QByteArray::fromHex(hash)]; } +// This needs to operate on a copy of picture as it frees it after finishing! void updateHash(struct picture *picture) { QByteArray hash = hashFile(fileFromHash(picture->hash)); learnHash(picture, hash); + picture_free(picture); } +// This needs to operate on a copy of picture as it frees it after finishing! void hashPicture(struct picture *picture) { char *oldHash = copy_string(picture->hash); @@ -1120,13 +1123,14 @@ void hashPicture(struct picture *picture) if (!same_string(picture->hash, "") && !same_string(picture->hash, oldHash)) mark_divelist_changed((true)); free(oldHash); + picture_free(picture); } extern "C" void cache_picture(struct picture *picture) { QString filename = picture->filename; if (!hashOf.contains(filename)) - QtConcurrent::run(hashPicture, picture); + QtConcurrent::run(hashPicture, clone_picture(picture)); } void learnImages(const QDir dir, int max_recursions) @@ -1476,7 +1480,12 @@ void loadPreferences() s.beginGroup("CloudStorage"); GET_TXT("email", cloud_storage_email); +#ifndef SUBSURFACE_MOBILE GET_BOOL("save_password_local", save_password_local); +#else + // always save the password in Subsurface-mobile + prefs.save_password_local = true; +#endif if (prefs.save_password_local) { // GET_TEXT macro is not a single statement GET_TXT("password", cloud_storage_password); } @@ -1513,6 +1522,11 @@ void loadPreferences() GET_ENUM("cat2", taxonomy_category, geocoding.category[2]); s.endGroup(); + // GPS service time and distance thresholds + s.beginGroup("LocationService"); + GET_INT("time_threshold", time_threshold); + GET_INT("distance_threshold", distance_threshold); + s.endGroup(); } extern "C" bool isCloudUrl(const char *filename) |