Commit graph

7916 commits

Author SHA1 Message Date
Albert Astals Cid 83374b97df PDF: Fix potential crash
Probably doesn't happen often but pdfdoc usage also needs to be protected by the mutex
2018-02-14 17:51:01 +01:00
Albert Astals Cid 42d4710198 XPS: Fix crash opening some files
Yet another QUrl porting mistake, i think this time is the correct one,
at least i can open all the 6 xps files i have

BUGS: 390355
2018-02-14 01:40:42 +01:00
l10n daemon script b9a392d6b8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-02-08 07:00:06 +01:00
l10n daemon script d82ca473d5 GIT_SILENT made messages (after extraction) 2018-02-08 05:51:57 +01:00
Albert Astals Cid 4e678cdc33 Add pdf.gz file save test 2018-02-06 00:32:15 +01:00
Henrik Fehlauer ad1160be1b Fix saving annotations to gzipped files
Okular supports opening zipped files like document.pdf.gz by
transparently extracting them. However, since 559836c392 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
2018-02-06 00:31:36 +01:00
Albert Astals Cid defe26ff1c GIT_SILENT Upgrade KDE Applications version to 17.12.2. 2018-02-03 00:41:15 +01:00
Albert Astals Cid f656f1b23f Fix crash on save when we had edited forms
We need to store the id locally since we need it to map
"old form" to "new form" after save and at that stage the "old form"
poppler side is gone so we're accessing invalid memory
2018-01-31 23:24:33 +01:00
Albert Astals Cid 8a0f70cb16 parttest: make the mouse selection be a few steps
Makes it more reliable for me here
2018-01-31 23:24:33 +01:00
Dileep Sankhla 1e80804c1b Use correct arrow cursor for Annotations' close buttons
Summary:
When hovering the mouse over the X symbol to close a note the cursor remains the same of the current shape (hand, selection cursor) based on the tool selected.
This patch morphe the cursor to the standard arrow over the X symbol to close a note by adding setCursor() call in the CloseButton constructor

 BUG: 384381

Test Plan:
1.  Open okular and select Tools -> Review or press F6 to create a new pop-up note
2. Hover the mouse cursor over the close button (X) of the pop-up note window
3. You will see the standard arrow instead of the current tool based cursor.

Screenshot below (the tooltip saying "Close this note" was not captured by Spectacle application)
{F5685539}

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10209
2018-01-31 11:02:17 -07:00
Albert Astals Cid 60daf5c2d8 Improve parttest a bit
add QVERIFY to qWaitForWindowExposed calls so that compiler shuts up
Add code to wait for the menus singleshot to have finished
2018-01-31 12:12:45 +01:00
Albert Astals Cid acd3c81e23 Fix regression due to more QTemporaryFile behaviour changes
Make sure we call fileName because otherwise things break
2018-01-31 11:18:09 +01:00
l10n daemon script 9c6494b353 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-01-29 06:49:13 +01:00
Albert Astals Cid 4a80d3f963 Fix crash when exporting
We had a off by one from when we removed the document archive option from the export menu.

BUGS: 389216
2018-01-23 00:37:44 +01:00
l10n daemon script 89caa09be9 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-01-15 06:15:40 +01:00
Albert Astals Cid dcf544f826 djvu: Fix printing
Seems this is a Qt regression? I had to move the tf.fileName() call earlier
because otherwise i was getting an empty string as name

BUGS: 388514
2018-01-11 20:50:53 +01:00
l10n daemon script 2daff2a344 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-01-11 06:26:36 +01:00
l10n daemon script 6ed35fcca3 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-01-08 06:05:50 +01:00
Albert Astals Cid e7f90332ea GIT_SILENT Upgrade KDE Applications version to 17.12.1. 2018-01-04 18:50:10 +01:00
Pino Toscano 9008803b32 remove deprecated Encoding key from desktop files
... even when only mentioned in apidox
2018-01-02 22:35:40 +01:00
Henrik Fehlauer 454a53ff72 Fix testSaveAsUndoStackAnnotations autotest
Summary:
Okular allows to drop changes when saving to a file format not
supporting those. However, this is only sensible for {nav Save As},
while for {nav Save} the {nav Continue} button is not needed. When this
behaviour was introduced in 481676dced, the `jpg` test row failed
subsequently, because `closeDialogHelper` relies on the availability of
the {nav Continue} button. The `epub` test row is similar, but `returns`
early because it does not allow `canSwapBackingFile` and therefore does
not fail the test afterwards.

As the test progresses, the initial {nav Save As} (`potato.jpg` to
`/tmp/123.jpg`) is implicitly followed by {nav Save} (`/tmp/123.jpg` to
`/tmp/123.jpg`) for each subsequent `part.saveAs`. This causes the
{nav Continue} button to vanish, so eventually the test will fail.

Forcing {nav Save As} so the {nav Continue} button continues to exist
could be done in multiple ways, but just alternating between two
different files to save seems like the most efficient and most readable
approach.

Test Plan:
- `./autotests/parttest testSaveAsUndoStackAnnotations:jpg` now passes.
- Other test rows still pass.
- No changes to non-test code needed.

Reviewers: aacid, #okular

Reviewed By: aacid, #okular

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9579
2018-01-02 21:29:28 +01:00
l10n daemon script e7b43fd0c3 GIT_SILENT made messages (after extraction) 2017-12-31 05:26:50 +01:00
l10n daemon script 26450b97e6 GIT_SILENT made messages (after extraction) 2017-12-28 05:17:11 +01:00
Albert Astals Cid 9504d91c61 Don't call m_formsMessage->setVisible( true ) on unsetDummyMode
The only reasons to show m_formsMessage are on openFile if we have forms (to show the toggle button) or if we have xfa forms (unsuppported warning)
2017-12-15 00:32:03 +01:00
Albert Astals Cid 4e6c9f8f7a Fix crash when accessing text page after save
text page was storing a pointer to a PagePrivate pointer but those die
after saving so we need to store a Page pointer since those are stable.

BUGS: 387247
2017-12-05 23:07:10 +01:00
Albert Astals Cid 26367babb4 Unbreak compilation of the chm backend
CCMAIL: faure@kde.org
2017-12-05 00:57:04 +01:00
Albert Astals Cid 2b7b8e94f8 We broke ABI by adding a new virtual to generator 2017-12-05 00:53:34 +01:00
Albert Astals Cid deb01dce88 Increase version now that we're not on unstable versioning anymore 2017-12-05 00:30:48 +01:00
Christoph Feck 2f77b3294d GIT_SILENT Upgrade KDE Applications version to 17.12.0. 2017-12-05 00:03:16 +01:00
l10n daemon script ad559c5d93 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-12-04 06:13:21 +01:00
l10n daemon script f8cf8acd7c GIT_SILENT made messages (after extraction) 2017-12-04 05:19:54 +01:00
l10n daemon script 78dc6e4d95 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-12-03 06:11:47 +01:00
David Faure 711e4e75ef Enable -DQT_NO_URL_CAST_FROM_STRING and fix compilation 2017-12-02 21:12:47 +01:00
Christoph Feck 27b8c8cc27 GIT_SILENT Upgrade KDE Applications version to 17.11.90. 2017-11-30 22:20:28 +01:00
Henrik Fehlauer dccd83783d Prevent Okular from crashing when synctex logs an error
bd20e48c3c updated Okular's copy of the synctex code to 1.19.
Unfortunately since this version the upstream code logs errors like
`"! SyncTeX Error : Ignored record...` when accessing selected synctex
files created with older versions of synctex.

The upstream `_synctex_log` contains `va_list arg` as a parameter, but
fails to initialize and tear down this properly via `va_start` and
`va_end`. In general this seems to work for the single argument case.
However, once we apply our hardening patch to get rid of the
`gnu_printf format attribute` warning and thus introduce a variadic
argument, things go wrong.

To fix this, we add the missing code. The remaining changes are just
refreshing the patches.

BUG: 383915

Test Plan:
Opening `empty.pdf` with `empty.synctex.gz` from
https://bugs.kde.org/attachment.cgi?id=109116 located
in the same folder does not lead to Okular segfaulting anymore.
2017-11-30 14:57:05 +01:00
Henrik Fehlauer b6573a2713 Change whitespace in synctex patches
15-prevent-leaks-and-segfault.diff did not apply cleanly with quilt.
After fixing this, some of the other patches needed a refresh.
2017-11-30 12:45:58 +01:00
l10n daemon script 02a4cfb26a SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-11-28 06:52:56 +01:00
l10n daemon script 0ef249b5a5 GIT_SILENT made messages (after extraction) 2017-11-28 05:48:07 +01:00
l10n daemon script 379edd6757 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-11-27 07:00:46 +01:00
l10n daemon script cdf2921e32 GIT_SILENT made messages (after extraction) 2017-11-27 05:54:12 +01:00
David Edmundson ab433f701a Fix highlight/annotation clipping with Qt scaling
Summary:
pixelValue/pixelValue will give us a normalised value.

Normalised values shouldn't be modified by a device pixel ratio.
We want scaledRect not dScaledRect.

BUG: 386110

Test Plan:
Searched for text. Zoomed in, panned about
Created annotations, they still seemed to work

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8832
2017-11-23 23:29:47 +00:00
l10n daemon script 22ee80d317 GIT_SILENT made messages (after extraction) 2017-11-21 05:09:38 +01:00
Albert Astals Cid 559836c392 Give warnings when the file is modified externally
Summary:
Unfortunately, poppler (the only backed that supports saving) is not able
to save properly if the file is modified by a third party while it is opened

So we give the user a warning saying things went wrong and give him the option
to not reload/close, that way if there was something very important in the annotations
she added she can try to save them (even if by copy&paste the contents to a third program)

Reviewers: rkflx

Reviewed By: rkflx

Subscribers: ngraham, rkflx, ltoscano, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8863
2017-11-20 14:53:17 +01:00
Heiko Becker f099d5fa2a generators: Use a specific description for libzip
Summary:
It appears it's copied and pasted from LibCHM and while it's indeed
needed to support displaying CHM files, it's a library of its
own.

Reviewers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8879
2017-11-18 12:22:43 +01:00
l10n daemon script 7eaa3cb659 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-11-17 06:38:51 +01:00
l10n daemon script d6e1a6808d GIT_SILENT made messages (after extraction) 2017-11-17 05:44:04 +01:00
Albert Astals Cid 9c352ca67c Workaround to build with older Qt
As explained in the comment we can do with using an older Qt since what this adds is really a small nicety in a corner case
2017-11-16 15:35:50 +01:00
Albert Astals Cid 3957683d76 Merge branch 'dont-use-docdata-for-annots-and-forms' into Applications/17.12 2017-11-16 15:00:23 +01:00
Albert Astals Cid 1420c9411e Save or Discard dialog: show only the file name and not the full url 2017-11-16 12:03:23 +01:00
Albert Astals Cid 19b7e3c112 The work in this branch was sponsored by LiMux
give them some credit in the headers
2017-11-16 09:58:31 +01:00