Fix issue where jrnl would erroneously mark entries from DayOne as modified due to whitespace differences

This commit is contained in:
Nik van der Ploeg 2015-09-06 17:41:09 +08:00
parent 15ef9749ae
commit 42b8f2bdb8

View file

@ -127,7 +127,11 @@ class DayOne(Journal.Journal):
match = matched_entries[0] match = matched_entries[0]
if match != entry: if match != entry:
self.entries.remove(match) self.entries.remove(match)
entry.modified = True # DayOne's whitespace conventions are different from jrnl's, so compare 'split()'-ed entry
# bodies instead of comparing the objects directly. This way whitespace differences won't
# mark entries as modified
if match.body.split() != entry.body.split():
entry.modified = True
self.entries.append(entry) self.entries.append(entry)
else: else:
# This entry seems to be new... save it. # This entry seems to be new... save it.