Commit graph

8226 commits

Author SHA1 Message Date
Albert Astals Cid
7014e86f68 tests: Use QTRY_COMPARE instead manual timer 2018-02-18 23:18:11 +01:00
Sergio Bragin
54c741844b Fix realDpi function for Mac
Summary:
Removes old Utils::realDpi function for Mac. The old code employs functions
CGDisplayCurrentMode and CGDisplayIOServicePort, which are deprecated as
of versions 10.6 and 10.9, respectively. Now Mac uses the same code, as
Linux does, since it works out of the box.

This commit automatically fixes the long-standing bug of having an
implementation of realDpiX() and realDpiY(), which are not declared in
the utils.h file.

Reviewers: #okular, rjvbb

Reviewed By: rjvbb

Subscribers: rjvbb, cullmann, aacid, kde-mac, ltoscano, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10415
2018-02-18 19:24:19 +01:00
Albert Astals Cid
739b591e25 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-15 10:14:45 +01:00
Albert Astals Cid
e8d9feed70 Fix potential crash in document saving
Probably doesn't happen very often since most of the times people don't save while rendering is still happening
but if that is the case we need to wait for all the rendering to finish otherwise we remove the document
from under the render thread feet and bad things happen
2018-02-14 17:51:01 +01:00
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
5efba743cc Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-14 01:42:32 +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
Andre Heinecke
9f458a54cf Fix regression in refreshPixmaps 2018-02-10 00:37:19 +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
l10n daemon script
0d38577b4a 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 05:11:36 +01:00
l10n daemon script
37a30f5851 GIT_SILENT made messages (after extraction) 2018-02-08 03:27:11 +01:00
Aleix Pol
e06883d102 Fix annoying warning
Summary:
Warning for every plugin was:
The file includes the moc file "generator_tiff.moc", but does not contain a Q_OBJECT, Q_GADGET, Q_NAMESPACE, K_PLUGIN_FACTORY_WITH_JSON, K_PLUGIN_FACTORY, K_PLUGIN_FACTORY_WITH_JSON or K_PLUGIN_FACTORY macro.

Test Plan: Built

Reviewers: aacid

Reviewed By: aacid

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10022
2018-02-06 00:38:50 +01:00
Albert Astals Cid
7a182c2594 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-06 00:32:56 +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
2d8b2c7e95 Add support for cancellable image rendering and text extraction
Summary:
Only supported by the pdf backend if using poppler >= 0.63

Sadly had to change the generator API

Text cancellation is a bit wobbly still since poppler has large parts
of the code where doesn't check for the cancellation flag, but that
is something that will get automagically fixed for us if the poppler
side is improved

Test Plan: Needs https://bugs.freedesktop.org/show_bug.cgi?id=104263

Reviewers: ervin, rkflx

Reviewed By: ervin, rkflx

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9328
2018-02-01 22:53:28 +01:00
Albert Astals Cid
c762b86b2b Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 23:27:19 +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
Dileep Sankhla
de56b9c9c1 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 10:58:07 -07:00
Albert Astals Cid
46a1eb66c4 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 12:13:56 +01: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
5acb6d06f0 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 11:18:53 +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
Laurent Montel
85a91c1bb7 Fix i18n usage 2018-01-29 13:19:45 +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
l10n daemon script
29b1dec92b 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 05:04:25 +01:00
Albert Astals Cid
e043d517c5 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-23 00:40:05 +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
Michel Ludwig
6b259d7000 Use Windows ANSI versions of the PathFind... methods
Differential Revision: https://phabricator.kde.org/D9937
2018-01-19 21:23:02 +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
l10n daemon script
daaa084476 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 04:46:05 +01:00
l10n daemon script
553d69dcef GIT_SILENT made messages (after extraction) 2018-01-15 03:10:59 +01:00
Albert Astals Cid
782a5fe298 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-11 20:51:49 +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
f1e2ebbaed 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 04:50:21 +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
l10n daemon script
6ff1864dc2 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 04:48:31 +01:00
l10n daemon script
a16d67e85a GIT_SILENT made messages (after extraction) 2018-01-08 03:09:23 +01:00
Nathaniel Graham
e44d505583 Improve dialog when PDF wants to open in presentation mode
Summary:
BUG: 388511

- Describe what's actually going to happen if you answer in the affirmative
- Use expressive button text with standard ok/cancel style icons
- Remove tooltips, since they're not needed when the buttons clearly indicate what will happen when you press them

Test Plan:
New dialog:
{F5626016}

Both buttons still work to do what they say they'll do.

Reviewers: #okular, aacid, rkflx

Reviewed By: rkflx

Subscribers: rkflx

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9692
2018-01-07 11:49:32 -07: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
7c837113eb Improve error message when parttest fails due to missing pdflatex
Summary:
`PartTest::testForwardPDF` tests whether the synctex integration works
and needs to create a PDF from latex sources via `pdflatex`.
If this is not installed the test fails, but the error message
`'started' returned FALSE` requires diving into the source code to debug
the problem.

By providing a more meaningful error message we make it easier for
developers and distributions to run all autotests sucessfully (short of
build-requiring a latex installation). Note that Albert does not want to
simply skip the tests in that case, so no optional build-time dependency
either.

Ref T7532

Test Plan:
Run `parttest testForwardPDF` w/ and w/o `pdflatex` executable
available.

Reviewers: aacid, #okular

Reviewed By: aacid, #okular

Subscribers: #okular

Tags: #okular

Maniphest Tasks: T7532

Differential Revision: https://phabricator.kde.org/D9578
2018-01-02 21:33:24 +01:00
Henrik Fehlauer
804bb086a2 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-02 21:32:19 +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
Henrik Fehlauer
9f0aa37906 Document ".okular" filename extension
Summary:
In general Okular makes it very hard to get the filename extension for
document archives wrong when saving. Still it would be nice to document
this.

BUG: 291176

Test Plan: `meinproc5` still happy.

Reviewers: lueck, yurchor

Reviewed By: yurchor

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9577
2018-01-01 08:41:09 +01:00