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