Commit graph

265 commits

Author SHA1 Message Date
Albert Astals Cid
874c1fd5e4 Switch QCOMPARE to the proper order 2019-08-15 00:15:27 +02:00
João Netto
f54d65ca86 Changed util.printd to work with the default locale set on QLocale::setDefault to allow consistent results in tests 2019-08-14 21:49:04 +00:00
João Netto
c7432cdae6 Implemented support for AFSpecial_Format and AFSpecial_Keystroke 2019-08-12 12:47:56 -03:00
João Netto
052662d78d Implemented support for AFTime_Format and AFTime_Keystroke 2019-08-12 11:13:03 -03:00
João Netto
f9e6b3e6e6 Extended util.printd support to cover new formats 2019-08-08 21:31:12 +00:00
João Netto
7c361d058d Implemented tests for app.alert and util.printd 2019-08-08 21:31:12 +00:00
Albert Astals Cid
0dd5419621 Hide the cursor with tricks so then hidden delay mode keeps working fine 2019-08-01 21:57:48 +00:00
Oliver Sander
b1b2f93e58 Test whether tablet proximity properly controls the cursor shape
... in presentation mode.

Thanks to Tobias Deiminger for his help.
2019-08-01 21:57:48 +00:00
Albert Astals Cid
d84f781e81 Stop using QRegion:: rects and just iterate over the region
QRegion::rects is deprecated
2019-07-27 20:48:29 +00:00
João Netto
ad858267d1 Implemented display support and updated dependencies to Poppler > 0.79
Moved executeScript to document private and support to display options for JavaScript
2019-07-20 12:06:12 +02:00
João Netto
f3c8bb9299 Changed button code to be transparent when there's no text. 2019-07-20 12:04:59 +02:00
João Netto
7555212d29 Implemented the getOCGs and OCGs methods to support layer changing by JavaScript.
Implemented more unit tests to cover the OCGs
2019-07-20 12:04:59 +02:00
João Netto
cc10164d34 Implemented initial support for animatedPDF
When refreshing, widgets must check if they should be visible

Implemented unit tests to the JavaScript functions.
2019-07-20 12:04:45 +02:00
Albert Astals Cid
a797d2aeb9 parttest: Move calculating the width/height to a bit later
Seems to make tests more stable
2019-07-17 22:35:28 +02:00
Laurent Montel
398dd7e250 Use QString::fromUtf8 as asked by Albert
"QStringliteral is broken on windows with non ascii chars"
2019-05-27 08:04:57 +02:00
Laurent Montel
cb691f70dc Fix some clazy warning
Summary: fix clazy warning

Reviewers: aacid

Reviewed By: aacid

Subscribers: nicolasfella, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20832
2019-05-27 08:02:57 +02:00
Albert Astals Cid
a16c0be349 testShell: Check that the test on the find bar is the text we want to be there 2019-02-14 00:00:16 +01:00
Joao Netto
716b234100 Implemented find function from console
Summary:
Implemented feature request to find from console.

BUG: 362038

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: ngraham, aacid, yurchor, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18144
2019-02-13 23:59:52 +01:00
Chinmoy Ranjan Pradhan
a234a902dc Implement digital signature support for PDF
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
2019-01-10 23:13:54 +01:00
Tobias Deiminger
09a2d6ed67 Merge remote-tracking branch 'origin/Applications/18.12' 2018-11-29 21:42:35 +01:00
Tobias Deiminger
a29e4eaff5 Fix inconsistent viewport positioning in PageView
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
2018-11-29 21:41:43 +01:00
Yuri Chornoivan
5478b2ec92 Fix minor typos 2018-11-14 21:12:15 +02:00
Albert Astals Cid
ec692e459b Remove unused variables 2018-11-02 18:03:26 +01:00
Albert Astals Cid
e88607afec Merge remote-tracking branch 'origin/Applications/18.08' 2018-10-24 00:32:18 +02:00
Albert Astals Cid
05462e2670 Add three autotests for part saving
* 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
2018-10-24 00:31:48 +02:00
Yuri Chornoivan
c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Ahmad Osama
5e622484c8 Fix problem of saving pdf switches from thumbnail view in sidebar to contents view
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
2018-08-13 11:13:00 +02:00
Albert Astals Cid
4f06f742f9 Fix properties dialog path not being correct on Save As
We need to clear DocumentInfo because otherwise it is cached and refers
to the old file

BUGS: 397039
2018-08-09 00:27:42 +02:00
Andre Heinecke
5103e8db6f Add test for additional form actions
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
2018-05-30 10:05:21 +02:00
Simone Gaiarin
48b9ca66a6 Raise annotation window when clicking on annotation
Summary:
Raise annotation window when clicking on the window title, window text edit, or the associated annotation.

BUG: 388532

Reviewers: #okular, aacid

Subscribers: okular-devel, ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10792
2018-05-18 15:17:58 +02:00
Andre Heinecke
1de0f5465b Add support for chained / next actions
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
2018-04-30 14:02:49 +02:00
Albert Astals Cid
1ab8dd7c62 Fix autotest build if poppler is not installed 2018-04-24 11:59:07 +02:00
Andre Heinecke
7eb72911f8 Add test for visibility changes
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
2018-04-23 23:58:11 +02:00
Albert Astals Cid
33a2eaf3c4 Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-22 19:46:41 +02:00
Albert Astals Cid
3cea7c9927 Fix crash on exit when having edited a text area
For some reason Q/KTextEdit is sending textChanged inside the
destructor, so protect us from that.

BUG: 393334
2018-04-22 19:46:04 +02:00
Aleix Pol
c325b342f3 Make some frameworks optional so okular can be built on Android
Summary:
Disables KWallet integration if there's no KWallet, KJS if there's no
KJS and KDocTools.
Here's a list of frameworks that don't work on Android:
https://cgit.kde.org/sysadmin/ci-tooling.git/tree/local-metadata/project-ignore-rules.yaml

Test Plan: Still works locally, ran Okular and Okular Mobile on Android.

Reviewers: #okular, aacid

Subscribers: aacid

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12177
2018-04-16 22:41:19 +02: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
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
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
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
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
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
Albert Astals Cid
7014e86f68 tests: Use QTRY_COMPARE instead manual timer 2018-02-18 23:18:11 +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
Albert Astals Cid
c762b86b2b Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 23:27:19 +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
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
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
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
David Faure
711e4e75ef Enable -DQT_NO_URL_CAST_FROM_STRING and fix compilation 2017-12-02 21:12:47 +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
Albert Astals Cid
f63aa211dc test: Actually do the migration instead of faking it 2017-11-15 12:09:17 +01:00
Albert Astals Cid
3e423eeb7c Add missing test file 2017-11-13 10:16:25 +01:00
Albert Astals Cid
ae4f0671bf Unsplit some lines in tests 2017-11-06 06:05:22 +01:00
Albert Astals Cid
fcbe97bdc0 Fix leaks in documenttest 2017-11-06 05:57:20 +01:00
Albert Astals Cid
cd24ad31c8 Implement missing todo in Document::swapBackingFileArchive
And extend tests to include archive files
2017-10-30 17:01:46 +01:00
Albert Astals Cid
946d54fb3e Add saveas+undo/redo for forms 2017-10-30 16:03:40 +01:00
Albert Astals Cid
c14fbe5eb6 Remove SaveAsDontShowWarning
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
2017-10-30 11:12:00 +01:00
Albert Astals Cid
835c9c495d Add test for saveAs + undo/redo stack
Proves that if the backend supports swapping the file we keep the undo/stack around correctly
2017-10-27 10:12:29 +02:00
Albert Astals Cid
c86c9a04a2 Add a jpg to the saveAs tests
This way we're also testing a backend that supports swapBackingFile but doesn't natively support annotations
2017-10-27 09:35:11 +02:00
Albert Astals Cid
8d7ea894f3 make parttest pass again 2017-10-26 21:24:09 +02:00
Albert Astals Cid
54bcb44559 Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-10-23 16:03:18 +02:00
Albert Astals Cid
a78d2da440 QTest::addRow -> QTest::newRow
addRow is only in since Qt 5.9 and we don't need it
2017-10-15 23:42:45 +02:00
Renato Araujo Oliveira Filho
6d7403ff13 Interact with hyperlinks in TextSelect mode
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
2017-10-11 15:03:36 +02:00
Albert Astals Cid
a93661e892 Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-09-27 15:01:57 +02:00
Albert Astals Cid
95a32d7730 Show dialog to ask when closing when more than tab open
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
2017-09-17 23:50:27 +02:00
Henrik Fehlauer
bd20e48c3c Update to synctex 1.19
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
2017-09-12 21:56:49 +02:00
Albert Astals Cid
729a622a49 This test file was lost at some point
Or was never added
2017-09-11 19:52:04 +02:00
Albert Astals Cid
04ed10d3ea Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-09-11 19:51:51 +02:00
Kevin Funk
a53a2402ca clang-tidy: modernize-use-nullptr run
Semi-ACK'd by Albert :)
2017-09-06 00:19:48 +02:00
Oliver Sander
3859fba07d Remove dependency on KActivities on Windows.
REVIEW: 130022
REVIEW: 126378
2017-03-18 01:58:47 +01:00
Albert Astals Cid
b13fc1d3be Readd test for file existance when opening files with # on the path
BUGS: 373855
2017-01-16 00:33:25 +01:00
Albert Astals Cid
964e3eb2e5 Test: Be really patient
just to make sure it's not the machine being slow and it's the test that actually is failing
2016-12-09 00:35:52 +01:00
Albert Astals Cid
2aa006fa87 Test pixel pushing 2016-10-30 23:55:32 +01:00
Albert Astals Cid
5db87d4d6f Fix autotest
Make the click/select location depend on the content size, not on the window size
2016-10-30 23:19:14 +01:00
Albert Vaca
3c93b2523e Added missing overrides found by clang-tidy 2016-10-29 17:07:10 +02:00
Albert Astals Cid
62eea3336b Merge remote-tracking branch 'origin/master' into frameworks 2016-10-29 11:13:24 +02:00
Gleb Popov
bfa28f1f64 Fix build with Visual Studio 2015.
REVIEW: 128805
2016-08-31 17:34:15 +03:00
Martin T. H. Sandsmark
cbe859eeec Port away from obsolete QTest functions 2016-08-13 22:37:30 +02:00
Martin T. H. Sandsmark
ba1aeef06f Remove dead and unused code after porting to Qt5 QUrl 2016-07-24 19:14:29 +02:00
Martin T. H. Sandsmark
2e2432308f Clean up Part autotest, proper porting etc. 2016-07-24 17:38:09 +02:00
Martin T. H. Sandsmark
b9b2c3bfae Remove usage of KGlobal from Part autotest 2016-07-24 17:10:45 +02:00
Martin T. H. Sandsmark
4189304934 Port away from KStandardPaths 2016-07-11 23:25:09 +02:00
Martin T. H. Sandsmark
3fcd698896 autotests: Fix build without implicit cast to/from ascii
See previous commits for details.
2016-07-11 22:01:10 +02:00
Martin T. H. Sandsmark
439ced872d Port away from signal/slot keyword
When building okular without kdelibs4support it apparently builds with
-DQT_NO_SIGNALS_SLOTS_KEYWORDS.
2016-07-11 19:34:08 +02:00
Aleix Pol
32b62e919a Remove most KDELibs4Support linking
Ports away from KFileDialog.
Stops linking to KDELibs4Support from objects that don't need it.

REVIEW: 127021
2016-05-31 00:13:36 +02:00
Alex Richardson
1b2de0d1d0 Fix mainshelltest (and as a side-effect docdata saving)
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
2016-01-30 17:31:57 +01:00
Alex Richardson
449d727707 Fix parttest by increasing the wait duration 2016-01-24 14:11:46 +00:00
Alex Richardson
de6443d106 Fix PartTest::testSelectText()
With Qt5 we need a qWait before the mouseRelease otherwise the selection
will not be made
2015-11-28 16:04:57 +00:00
Alex Richardson
19c2c170bb Make parttest pass by adding the file that it wants to open
It seems it was lost when merging master into frameworks.
2015-11-28 16:04:57 +00:00
Alex Richardson
5c566b3543 Fix crash in parttest by failing the test if the file couldn't be opened 2015-11-28 16:04:57 +00:00
Montel Laurent
466eb79615 Use QStringLiteral 2015-10-29 13:37:11 +01:00
Montel Laurent
8805760ccf Merge remote-tracking branch 'origin/master' into frameworks 2015-10-29 13:24:05 +01:00
Albert Astals Cid
8445660539 Merge remote-tracking branch 'origin/master' into frameworks 2015-10-18 22:29:00 +02:00
Alex Richardson
ab700b2453 Restore the URL parsing behaviour in from before the KF5 port
This fixes shelltest

REVIEW: 124738
2015-08-28 19:03:59 +02:00
Alex Richardson
461c963cb8 use QTRY_VERIFY/QTRY_COMPARE instead of qWait() loop 2015-08-19 15:14:12 +01:00
Alex Richardson
771fb0de56 Make sure we run the okular executable from the build directory 2015-08-15 19:28:06 +01:00
Alex Richardson
437b2d4a3a Make generatorstest work without installing first 2015-08-15 19:28:06 +01:00
Alex Richardson
8059e5b686 Add a test to see whether generators can be loaded
REVIEW: 123466
2015-05-22 16:33:09 +01:00
Alex Richardson
0ef5903c73 Use ecm_add_test correctly
The first argument is not the target name but one of the source files.
2015-05-22 16:33:09 +01:00
Ivan Čukić
c46b08c23f Make KActivities a required dependency
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
2015-05-05 00:19:28 +02:00
Alex Richardson
cfc82ee9b0 Be explicit about the target dependencies 2015-04-14 20:04:26 +01:00
Montel Laurent
d780d15ea9 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	autotests/mainshelltest.cpp
	part.cpp
	part.h
	shell/shell.cpp
2015-03-17 08:47:52 +01:00
Montel Laurent
c50c3d5332 kdelibs4support-- 2015-03-06 14:00:25 +01:00
Lukáš Tinkl
fd6a35486e port KUrl -> QUrl 2015-01-29 20:55:57 +01:00
Montel Laurent
5eea4fd073 Rename to autotests 2014-10-19 18:21:07 +02:00