Commit graph

8181 commits

Author SHA1 Message Date
David Edmundson 824eeb1160 Merge branch 'Applications/18.04' 2018-04-09 22:58:59 +01:00
David Edmundson 804d0bd42a Fix rubber band selection drawing contents misaligned with scaling
Summary:
in drawPixmap(source, sourceRect) the source rect is in native pixels.

In this code the size was scaled by the DPR, but the location was not.
blendRect is the contents of a selection rectangle, offset from the
bounding darker blue rectangle. Hence we haven't really noticed.

This completely fixes the rectangle when the scale == 2.0/3.0

Some smaller artifacts remain on fractional scale factors, which is a
separate code bug with the same symptoms.

CCBUG: 386111

Reviewers: aacid, rkflx

Reviewed By: rkflx

Subscribers: sander, rkflx, anthonyfieroni, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8980
2018-04-09 22:58:37 +01:00
Albert Astals Cid b62131b7ba Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-09 23:37:41 +02:00
Albert Astals Cid 0cb59caabb increase version to 1.4.x
GIT_SILENT
2018-04-09 23:36:51 +02:00
Christoph Feck e843e85ca7 GIT_SILENT Upgrade KDE Applications version to 18.04.0. 2018-04-09 22:41:59 +02:00
Albert Astals Cid f92b2b5f4f Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-08 13:00:44 +02:00
Albert Astals Cid 5ea455fe68 xps: fix file font unloading
Don't unload all fonts, only the ones this file loaded
2018-04-08 13:00:08 +02:00
Albert Astals Cid 5bb2a5c947 Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-08 12:52:25 +02:00
Albert Astals Cid 985e06a2f5 Fix crash in some more xps files
Some more tweaks to path resolving.

Don't prepend a / in entryPath if path already starts with /
Fonts can also have relative paths, so use the absolutePath before
calling getFontByName

BUGS: 392826
2018-04-08 12:50:46 +02:00
Albert Astals Cid 3e25263d77 Use KCrash 2018-04-08 11:50:18 +02:00
Fabian Kosmale b25979121f use correct filepath
Summary:
Seems like someone forgot to consistently apply a change. Maybe the path
construction should be factored into a reusable lambda?

Test Plan:
Open Okular, open settings > configure Okular. Without the patch, you'll get a
"QFSFileEngine::open: No file name specified" warning, with the patch it
disappears. Note that there is also an unrelated "Illegal icon group:  7"
warning from KIconThemes, but I'm 99% certain that this is on KIconThemes doing
a bogus check in KIconEffect::apply, not on Okular

Reviewers: #okular, hetzenecker, aacid

Reviewed By: #okular, aacid

Subscribers: aacid, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12001
2018-04-07 01:15:41 +02:00
Fabian Kosmale c70485cd74 use correct filepath
Summary:
Seems like someone forgot to consistently apply a change. Maybe the path
construction should be factored into a reusable lambda?

Test Plan:
Open Okular, open settings > configure Okular. Without the patch, you'll get a
"QFSFileEngine::open: No file name specified" warning, with the patch it
disappears. Note that there is also an unrelated "Illegal icon group:  7"
warning from KIconThemes, but I'm 99% certain that this is on KIconThemes doing
a bogus check in KIconEffect::apply, not on Okular

Reviewers: #okular, hetzenecker, aacid

Reviewed By: #okular, aacid

Subscribers: aacid, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12001
2018-04-07 01:14:50 +02:00
Fabian Kosmale f8f7a77fed use correct filepath 2018-04-06 23:57:14 +02:00
Albert Astals Cid ce49b8f141 Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-06 11:20:31 +02:00
Albert Astals Cid d3c89a1505 Cancel request when removing an observer
There's no need to continue generating something that won't be useful.
Also fixes a crash if the request would report partial updates since at that stage it uses the observer and that is gone
2018-04-06 11:19:23 +02:00
Albert Astals Cid 3c556f32e0 Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-02 21:22:37 +02:00
Albert Astals Cid 09109dd649 Fix Presentation Mode VideoWidget sizing
This fix smells a lot like a workaround for a bug in Qt but i could not
write down a sufficiently small testcase for it to report it to Qt, and
this is not wrong anyway since we eventually add playerPage to a
layout for this. What I tracked down was that since playerPage had no
parent, at some point a nativeId for it was being created and that
broke sizing back to the default 100x30 used in Qt instead of the
size we had given it.

For some reason i needed a PDF file with more than one video to
reproduce this problem, the first video was correctly sized but the
second one was 100x30.
2018-04-02 21:21:09 +02:00
Christoph Feck 0a91e0fbee GIT_SILENT Upgrade KDE Applications version to 18.03.90. 2018-04-02 21:19:45 +02:00
Albert Astals Cid 21f2c91010 Fix crash when changing pages fast on presentation mode
The crash would happen because we were setting partial updates to true on requests
that were synchronous, because that sync request was cancelling an async one (prerender)
so now we only set newRequest partial updates to true when cancellingm another one if it's asynchronous

And a sync but with partial updates request would make stuff crash because the request
would all be processed on the main thread but generator_pdf.cpp cakks signalPartialPixmapRequest
with a queued connection so we that function was called the request would have already gone
2018-04-02 21:13:27 +02:00
Albert Astals Cid 1069b02fd3 Merge remote-tracking branch 'origin/Applications/18.04' 2018-03-21 00:31:27 +01:00
Albert Astals Cid 7e1832c57a autotests: Only compile parttest if you have the pdf support
I'm sure other tests fail to run too, but this one was failing to
compile :D
2018-03-21 00:31:05 +01:00
Albert Astals Cid 33768c683f Merge remote-tracking branch 'origin/Applications/18.04' 2018-03-20 23:38:01 +01:00
Albert Astals Cid 098a886ff1 Increase OkularCore soversion
Since we broke ABI since last release
2018-03-20 23:37:30 +01:00
Albert Astals Cid 37a46fe17f Merge remote-tracking branch 'origin/Applications/18.04' 2018-03-20 23:30:43 +01:00
Andre Heinecke 7c41ba2c66 Add test for read only set and checkbox calculate
Summary:
It's a real world screnario to have checkboxes that toggle
the read only state for other fields.

The test is a parttest because we need to trigger activiation
action when changing the field, this is handled through the
formwidgetscontroller.

Reviewers: #okular

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10869
2018-03-20 23:19:29 +01:00
Andre Heinecke 8ed1d14f8d Fix CheckBox script usage
Summary:
This implements setting / getting the value of buttons,
which is important for checkboxes in scripts. It also moves
the checkbox activate action after the value is set so that
the correct value is used when the activation script is
executed.

Reviewers: #okular

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10868
2018-03-20 23:19:29 +01:00
Andre Heinecke 6897e042df Add support to set read only from scripts
Summary:
This makes it possible to set the read only state from
scripts. Requires Poppler master with the patch attached to the parent task.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10867
2018-03-20 23:19:29 +01:00
Albert Astals Cid adfb3cc2d6 Add detection for poppler 0.64 2018-03-20 23:19:26 +01:00
Andre Heinecke 5c04f0834d Implement generic version of Form Widgets refresh
Summary:
The FormWidgetInterface now has a generic slotRefresh that
refreshes what all widgets have in common. This is the read-only state for now.

Reviewers: #okular

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10866
2018-03-20 23:14:18 +01:00
Andre Heinecke 42717e1ae8 Access readOnly state of FormWidgets dynamically
Summary:
This is more of a cleanup patch that removes the obsolete m_canBeEnabled
member variable which was a leftover IMO from a time where readOnly fields were
shown as disabled. readOnly fields are invisible, not disabled, and the code no longer assumes that
readOnly does not change over time.

Test Plan: Tested manually and with a unittest which is part of the series.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10865
2018-03-20 23:14:12 +01:00
Albert Astals Cid 1b57c7557b GIT_SILENT Upgrade KDE Applications version to 18.07.70. 2018-03-19 23:52:08 +01:00
Albert Astals Cid e6860a1194 GIT_SILENT Upgrade KDE Applications version to 18.03.80. 2018-03-19 23:37:57 +01:00
Albert Astals Cid 1a093dc572 New version for master 2018-03-19 23:36:23 +01:00
Laurent Montel 43432f2aba Add Qt5::Network 2018-03-13 09:28:55 +01:00
Yuri Chornoivan 2a8e18f539 Add documentation on the new command line option --print-and-exit 2018-03-03 19:01:25 +02:00
Dileep Sankhla 09b7b079ac Option to exit after printing
Summary:
When running okular with the parameter --print to directly open the print mode, it doesn't exit after acknowledging the print dialog. Hence adding --print_and_exit option exits Okular after acknowledging the print dialog and thus is useful for the command line batch processing or a Dolphin service as the issue suggests.

FEATURE: 318998

Test Plan:
1. open a file in Okular using the parameter --print. It will open Okular in print mode with the print dialog
2. Either print the file or cancel the print dialog
3. You will find that Okular stays open
4. Now using this patch, see for available options with the --help parameter. You will find --print_and_exit option
5. Now open a file in Okular using the parameter --print_and_exit. It will open Okular in print mode with the print dialog
6. Either print the file or cancel the print dialog
7. You will find that Okular closes after acknowledging the dialog

Reviewers: aacid, #okular, ngraham

Subscribers: ltoscano, ngraham, aacid, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10249
2018-03-03 17:36:50 +01:00
l10n daemon script 13e719b300 GIT_SILENT made messages (after extraction) 2018-02-26 03:21:12 +01:00
Albert Astals Cid aecd77d4a9 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-25 19:17:56 +01:00
Albert Astals Cid c45e2170ab Add QVERIFY to QTest::qWaitForWindowExposed
removes compiling warning
2018-02-25 19:11:17 +01:00
Tobias Deiminger 3c4f16ea4b Fix crash due to dangling pointer in MouseAnnotation
Summary:
BUG: 388228

Diff applies to Applications/17.12, and should be easy to merge to master. It's kept quite minimal as suggested by Albert.

Albert also suggested to add a dedicated unit test and I'd agree, but am not yet sure how to do it. The original bug involves several classes, including UI: Document, Page, AddAnnotationCommand, PageView, PageViewAnnotator, MouseAnnotation - to name a few. So a test for the exact bug scenario would become a bigger integration test rather than an isolated unit test. The other approach would be to do a real unit test on MouseAnnotation. But again, MouseAnnotation has nasty dependencies (e.g., needs a parent PageView) which I'd have to mock. Any ideas? I'd be interested in a discussion on this topic.

Test Plan:
 # Load a document (e.g. [[ http://www.philipebert.info/resources/WhatMathematicalKnowledgeCouldNotBe.pdf | linked PDF from bug report ]]) and enable highlight toolbar (F6).
 # Create highlight annotation.
 # Move the view port so that the annotation position is right beside the highlight tool icon.
 # Move the mouse over the annotation, and then horizontally left until you reach the tool icon; it's important to stay over the highlight annotation as long as in viewport.
 # Press ctrl-z for undo.
 # Click on highlight tool, move right into the document, create new highlight annotation.
 # Okular doesn't crash.

Reviewers: #okular

Subscribers: aacid, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9852
2018-02-25 19:11:17 +01:00
Albert Astals Cid 77ee07cef5 Build++ 2018-02-25 19:01:41 +01:00
Albert Astals Cid 5facb3514e Add test that produces bug 388288 crash 2018-02-25 18:54:27 +01:00
Albert Astals Cid 77793ff3a9 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-25 12:27:37 +01:00
Albert Astals Cid cecbc8b68c Make it compile
Though for reason it does compile for me ^_^
2018-02-25 12:27:14 +01:00
Albert Astals Cid de14b2df0c Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-25 11:47:23 +01:00
Julian Wolff d19834f231 Make Part::openUrl not discard OpenUrlArguments
Applications using Okular as a KPart might set a file's mime type in the OpenUrlArguments.
Okular currently clears the arguments while opening a document. This revision fixes this, allowing
applications to actually pass a file's mime type to Okular.

BUG: 386600
2018-02-25 11:46:52 +01:00
Yuri Chornoivan fbd0fd69af Add a note about LaTeX code in annotations
BUG: 391003
2018-02-24 15:01:22 +02:00
l10n daemon script b9bc49fb84 GIT_SILENT made messages (after extraction) 2018-02-22 06:00:37 +01:00
Andre Heinecke f0a80a675f Recalculate forms after command form changes
Summary:
notifyFormChanged is called by documentcommands when
Form fields are changed. E.g. by Undo / Redo.
We need to recalculate after such changes.

Test Plan:
Tested with simple_calculate example.

Run the unit test with the added line commented out and it failed, with the added line it passes.

Reviewers: #okular

Subscribers: aacid, ltoscano

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10547
2018-02-22 00:13:25 +01:00
Andre Heinecke 5f05e4a1fc Add autotest for AFSimple_Calculate script
Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10050
2018-02-22 00:13:12 +01:00