Fix saving annotations to gzipped files

Authored by rkflx on Feb 5 2018, 11:30 PM.

Description

Fix saving annotations to gzipped files

Okular supports opening zipped files like document.pdf.gz by
transparently extracting them. However, since 559836c39270 saving
annotations back was broken. This is because this commit tries to
prevent saving back changes to externally modified files to prevent data
loss. The way this is checked by comparing timestamps mistakenly
triggered for unchanged zipped files, too.

This can be solved by always comparing the before/after timestamps of
the actual file, instead of the timestamp of the temporary copy of the
extracted file. The change has to be done in two places so saving
repeatedly works too.

BUG: 338742

Test plan

gzip autotests/data/file1.pdf && okular file1.pdf.gz
Add annotation, saving works now instead of showing an error.
touch normal.pdf still triggers modification warning.

Differential Revision: https://phabricator.kde.org/D9580

Details

Committed
aacidFeb 5 2018, 11:31 PM
Differential Revision
D9580: Fix saving annotations to gzipped files
Parents
R223:defe26ff1cc1: GIT_SILENT Upgrade KDE Applications version to 17.12.2.
Branches
Unknown
Tags
Unknown