This is a squash of the original branch
It also contains fixes/rework from Albert Astals Cid
If you're interested in its history have a look at the
gsoc2018_digitalsignature branch
The poppler dependency situation is:
* With 0.51 you get most signature information
* With 0.68 you also get signature location/reason information
* With 0.73 you also get signature certificate information
Summary:
This diff unifies the calculation of the viewport position from a given DocumentViewport. PageView::notifyViewportChanged and PageView::slotRelayoutPages used to handle it differntly, which resulted in viewport jumps for no reason.
It happened in various situations, e.g. when jumping to a page using the footer page navigation, or when reloading the document after presentation mode left, or when resizing the main window after presentation mode left.
The diff selects the notifyViewportChanged way (align viewport top border with page top margin) as golden behavior in case of rePos.enabled == false.
BUGS: 357958
CCBUG: 341939
CCBUG: 400890
341939 and 400890 are fixed partially. These two still suffer from a minor displacement that happens when finished signal arrives from pixmap generation thread.
Test Plan:
- When using the footer page navigation to jump to different pages, new page top is always algined with viewport top.
- After changing page with footer page navigation, press F5 to reload. Page top stays aligned with viewport top.
- When exiting presentation mode, and touching the file, page top stays aligned with viewport top.
- When exiting presentation mode, and changing main window size, page top stays aligned with viewport top.
Reviewers: #okular, sander
Reviewed By: sander
Subscribers: ngraham, sander, aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D16941
* saving as on a non existing file works
* saving as on a symlink doesn't destroy the symlink
* saving on the symlink used to open the file doesn't destroy the
symlink
Summary:
When save/save as functions are called they internally call the openFile() function, in the open file function the side bar item is set to Table of Contents (ToC) item
```
if ( m_document->metaData( QStringLiteral("OpenTOC") ).toBool() && m_sidebar->isItemEnabled( m_toc ) && !m_sidebar->isCollapsed() && m_sidebar->currentItem() != m_toc )
{
m_sidebar->setCurrentItem( m_toc, Sidebar::DoNotUncollapseIfCollapsed );
}
```
so I just store the sidebar's item before saving and then set this item back if changed.
BUG: 389668
Reviewers: #okular
Subscribers: aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D14740
Summary: This tests the newly added additional widget actions.
Test Plan:
Passes for me. Is my first GUI test, maybe the timing
needs to be slower for slower machines?
Reviewers: aacid
Reviewed By: aacid
Subscribers: okular-devel
Tags: #okular
Maniphest Tasks: T8627
Differential Revision: https://phabricator.kde.org/D13170
Summary:
This adds support for multiple actions following each
other through the "Next" value of Action dictionaries.
Test Plan: Activates the corresponding part of the visibilitytest.
Reviewers: #okular
Subscribers: sander, aacid
Tags: #okular
Maniphest Tasks: T8278
Differential Revision: https://phabricator.kde.org/D11609
The test only tests what is currently supported so it does
not yet test radio buttons and action chains. But
the visibilitytest.pdf already provides these, too.
Differential Revision: https://phabricator.kde.org/D11597
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
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
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
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
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
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
It was only used in tests as a way to "hide" warning dialogs, now we have a proper way to
close them, this way we make sure that dialogs are should when they should not not when they should not
Allow user to click on url while on any selection mode
Based on https://git.reviewboard.kde.org/r/124961/ by Jake Linder <JakeLinder@mail.com>
Includes several autotests to try to minimize possible regressions as much as possible
BUGS: 318078
REVIEW: 130246
Summary:
The checkbox is checked and says "Warn me on closing more than one tab",
for that reason we can't use the default KMessageBox::questionYesNo since
there the checkbox is always not checked and it's when checked that you enable it
Inspired by code from torham zed torhamzed@yahoo.com at review request 126406
Reviewers: #okular, #kde_applications
Subscribers: alexeymin, ngraham, colomar, rkflx, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D7714
Summary:
This should prevent crashes when reloading some synctex-enabled pdf
files created with newer versions of TeXLive. We also gain bugfixes,
features and improved accuracy from the last 6 years of synctex
development.
Procedure followed:
- svn co svn://tug.org/texlive/trunk/Build/source/texk/web2c/synctexdir
- Check out revision 45150
- Update files present in core/synctex/*
- Adapt Okular code to changes
- Review and drop or update/apply old patches using quilt
- Create missing patches for local synctex changes
- New patch: Omit warning message when opening non-synctex pdf
- Two new patches to fix more compiler warnings
- New patch: Plug multiple leaks and prevent a segfault
TODO for later:
- Move sync file detection code to Okular to never call into synctex C code for non-synctex files
- Evaluate feasibility of upstreaming all patches for TeXLive 2018 and using synctex as a library
BUG: 383915
FIXED-IN: 17.12.0
Test Plan:
- No crash in synctex on reloading empty.pdf from bugreport anymore.
- Shift-clicking on a word in a simple pdf opens Kate with the corresponding tex line.
- Forward and backward search in Kile seems to work.
- Works with synctex files from both TeXLive 2015 and 2017.
- PartTest::testForwardPDF still passes.
- No additional memory leaks in autotests and with basic synctex and non-synctex usage of Okular.
Reviewers: #okular, sander, #kile, aacid
Reviewed By: #okular, aacid
Subscribers: mludwig, aacid
Tags: #okular
Differential Revision: https://phabricator.kde.org/D7594
Try fixing mainshelltest: one more passes now
QUrl is not automatically exposed to DBus so the DBus call would fail.
Changed the parameter to QString instead so that DBus invocation works.
mainshelltest: set QStandardPaths to test mode
Parse command line flags with a single dash as a long option
Unlike KCmdLineArgs QCommandLineParser treats options starting with a
single minus as multiple short options by default.
Previously okular -unique would fail with the following error:
Unknown options: u, n, i, q, u, e.
Also changed mainshelltest to use two dashes in case this behaviour
should change in the future.
mainshelltest failures have been reduced from 15 to 4 by this commit.
Fix docdata saving and added a warning message if it fails
If the ~/.local/okular/docdata directory didn't exist previously
creating the docdata file would fail as there are missing paths.
It seems that KStandardDirs used to create the okular/docdata directory
automatically, with QStandardPaths we have to create it manually.
mainshelltest is down to one failed test now
Fix final test case in mainshelltest
as we call QProcess::terminate the exit code will not be 0
REVIEW: 126192
Our goal is better integration with Plasma and other KDE components.
We have made a conscious decision to reduce our code a bit by removing
the legacy #ifdefs. That way we do not have to support a build
configuration which is going to be used by just a tiny minority of our
users, and one that we are not terribly interested in. Without
KActivities, there is for example no support for recording and listing
of recent documents, PDF sharing etc etc, and we honestly believe that
the majority of our audience wants these features.
REVIEW: 123249