aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-13 10:33:30 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-13 10:33:30 -0700
commit7b51a4c1bee4db3bdd52b3706c86ef96e68e1c70 (patch)
tree2811b6b629c78ad769cb0152c2b4cdc8b11c4504
parent50421f1fa8c6d999d13348a89527df7adcc02fd9 (diff)
downloadsubsurface-7b51a4c1bee4db3bdd52b3706c86ef96e68e1c70.tar.gz
Only mark the divelist changed if something actually changed
Otherwise you could end up in a situation where the data file is always marked as changed when opened (for example if your data file references a picture that doesn't exist at that path and can't be found, either). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qthelper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index a963ad73f..c74dba647 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1148,9 +1148,11 @@ void updateHash(struct picture *picture) {
void hashPicture(struct picture *picture)
{
+ char *oldHash = copy_string(picture->hash);
learnHash(picture, hashFile(QString(picture->filename)));
- mark_divelist_changed((true));
-
+ if (!same_string(picture->hash, "") && !same_string(picture->hash, oldHash))
+ mark_divelist_changed((true));
+ free(oldHash);
}
extern "C" void cache_picture(struct picture *picture)