mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
50421f1fa8
commit
7b51a4c1be
1 changed files with 4 additions and 2 deletions
|
@ -1148,9 +1148,11 @@ void updateHash(struct picture *picture) {
|
||||||
|
|
||||||
void hashPicture(struct picture *picture)
|
void hashPicture(struct picture *picture)
|
||||||
{
|
{
|
||||||
|
char *oldHash = copy_string(picture->hash);
|
||||||
learnHash(picture, hashFile(QString(picture->filename)));
|
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)
|
extern "C" void cache_picture(struct picture *picture)
|
||||||
|
|
Loading…
Add table
Reference in a new issue