Commit graph

101 commits

Author SHA1 Message Date
Albert Astals Cid 252236d413 Port a few more QLinkedList to QList
We don't need the special properties of QLinkedList in any of those and
QLinkedList is deprecated, so move away from it
2022-03-31 17:08:01 +02:00
Albert Astals Cid 6767b8739e Port a few QLinkedList to QList
QLinkedList is deprecated in later Qt5 and gone in Qt6

The 1:1 port is std::list but in this cases all we ever do
is create the lists, push back to them, and pass then around
to be read, for that a QList is more than enough
2022-03-19 11:22:55 +00:00
Volker Krause 50d0703ae0 Enable readability-braces-around-statements 2022-03-09 23:29:56 +01:00
Albert Astals Cid a2576dc746 Act on core/ TODOs that are not binary compatible
I'm going to need to break binary compatibility to add a new feature
so may as well cleanup all the TODOs regarding that

Changes:
 * Moving a few destructors to the header
 * Removing a few unnecessary & in params
 * Adding a few necessary & in params
 * Making print return an enum instead of a bool and then having another
   function that returns the enum
 * Make Generator::requestFontData be a virtual
 * Remove unused enum
 * Remove a few filePrinter unneeded functions
 * Remove unused TextDocumentGenerator::addMetaData signal
2021-12-29 09:35:25 +00:00
Alexander Lohnau 2f193a63de Convert license headers to SPDX 2021-06-10 08:11:56 +00:00
Alexander Lohnau 3c1fa441d9 Remove dead code
A lot of this code has been commented out for over
a decade and adds no value to the project.
It is only annoying when you look over it ;).

Same for the KNS2 support which was commented out.

Also some of the debug statements didn't even build
anymore, because the properties got removed/refactored.
2020-11-14 10:52:00 +01:00
Albert Astals Cid 19d98d6a74 Run clang-format
find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;

If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
2020-07-11 09:17:33 +02:00
Alexander Kandaurov b04a2daa6b Fix DjVu links pointing to pages with different dimensions
Summary:
Currently the coordinates of a link rectangle in a DjVu document are computed with respect to the size of the page the link is pointing to. Because of that, links only appear in correct places if the dimensions of a target page are the same as of the page containing the link.

The attached file demonstrating the issue contains two pages, one in portrait orientation and one in landscape, the first pointing to the second. The active zone for the link is different from where it is in other viewers.
{F6443987}

Reviewers: #okular

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D17194
2018-11-28 23:11:00 +01:00
Yuri Chornoivan c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03: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 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
Kevin Funk a53a2402ca clang-tidy: modernize-use-nullptr run
Semi-ACK'd by Albert :)
2017-09-06 00:19:48 +02:00
Patrick Spendrin 37d5623102 Remove kdelibs4support from the generator plugins
This removes kdelibs4support for all generators except the mobipocket one.
The test executable for kimgio needs some windows fixes too, so I'll try
to make a separate review for that.

REVIEW: 126375
2016-01-30 16:51:46 +01:00
Alex Richardson 2f9246ae42 Port to new JSON plugin loading system
This means Okular can now work without ksycoca and KDELibs4Support.

REVIEW: 126193
2016-01-04 15:59:07 +01:00
Montel Laurent 466eb79615 Use QStringLiteral 2015-10-29 13:37:11 +01:00
Montel Laurent 3b4ee788b8 Fix includes 2014-10-08 13:37:04 +02:00
Raymond Wooninck 7e3e82693e Make the generators build 2014-10-05 13:29:29 +02:00
Montel Laurent fc13e5c148 Reactivate djvu generator 2014-10-04 14:22:14 +02:00
Raymond Wooninck f4badbc117 Port the aboutData to the new methods. Next would be to bring back
to About Backend dialog
2014-09-18 22:17:10 +02:00
Frederik Gladhorn 3581fb6245 Port to QTemporaryFile 2014-09-18 00:30:39 +02:00
Frederik Gladhorn 6c602bf0e7 Use categorized logging even more 2014-09-16 23:38:25 +02:00
Frederik Gladhorn 83d3f1f6b7 Revert "Some more kDebug->qDebug"
Seems like kDebug doesn't spam the user, so this needs to use qCDebug.

This reverts commit 34fbdf8c85.
2014-09-11 02:03:46 +02:00
Frederik Gladhorn 34fbdf8c85 Some more kDebug->qDebug 2014-09-09 18:17:36 +02:00
Albert Astals Cid e9e3d4a435 Make documentInfo be Hash based instead of XML based 2014-08-10 22:38:13 +02:00
Jon Mease 2ae9e58bb4 Merge window.text, contents and inplaceText annotation properties
BUG: 319442
REVIEW: 110391
2013-05-14 09:43:27 +02:00
Albert Astals Cid 81c5c540df Update versions for KDE 4.8
(cherry picked from commit 51a77e6a51)
2012-01-18 18:04:31 +01:00
Pino Toscano 56e1002af6 djvu: try to extract "line" text blocks if there are no "word" ones
documents could have no word precision, so we could make a try in using line blocks
(leave the "char" extraction still there and commented)
2011-11-25 16:45:59 +01:00
Kevin Kofler e001fbab55 Fix landscape documents getting printed in portrait format if "Landscape" is selected in the print dialog (the default).
Partly based on a patch by Falk from KDE bug #181290.

BUG: 181290
REVIEW: 101513
2011-07-28 01:41:48 +02:00
Pino Toscano 505139af31 generators: fix core #includes removing the okular prefix 2011-06-01 10:51:36 +02:00
Pino Toscano e6b98db3d0 bump some generators version number to the values of the 4.5 branch, plus increase if there was work/fixes done
svn path=/trunk/KDE/kdegraphics/okular/; revision=1212170
2011-01-05 23:47:33 +00:00
Pino Toscano 26d462e143 do not crash when handling links pointing to pages not in the document
CCBUG: 254610

svn path=/trunk/KDE/kdegraphics/okular/; revision=1189015
2010-10-23 18:00:36 +00:00
John Layt b30305b668 Enable Current Page option in Okular print dialog if running Qt >= 4.7
Changed exported api so cc: to bindings.
CCMAIL: kde-bindings@kde.org

CCBUG: 194586


svn path=/trunk/KDE/kdegraphics/okular/; revision=1134379
2010-06-04 08:25:25 +00:00
John Layt cc45ce4a1e Fix Print to File output by using Ghostscript ps2pdf to convert ps print file
into pdf format and save that.  Only enabled in PDF, DVI, and DJVU generators
if ps2pdf is found in the path.  Ghostscript is almost always guaranteed to
be installed given many parts of the printing stack depends on it.

Note that resulting PDF or PS file will have the page size as set in the print
dialog and not the page size of the original document, i.e. if an A5 booklet
is printed but the dialog page size is set to A4 then the resulting file will
be A4 and not A5.

svn path=/trunk/KDE/kdegraphics/okular/; revision=897000
2008-12-14 23:18:52 +00:00
Pino Toscano 25a414904a djvu toc:
- add mapping for page id/name/title -> page
- properly get the destination for "named" destinations in toc items
this way we should recognize all the types of destinations in a djvu toc

svn path=/trunk/KDE/kdegraphics/okular/; revision=890963
2008-11-30 18:14:30 +00:00
Pino Toscano 674380340e supports url's as destination of toc items
(although i have no djvu documents with such stuff, so i could not test it properly)

svn path=/trunk/KDE/kdegraphics/okular/; revision=890903
2008-11-30 16:26:54 +00:00
Pino Toscano b43fe1ce35 djvu toc:
- do not skip any entry
- better detection of the destination in case it is a page number, a page name or a url
- simplier handling of page numbers as destination

svn path=/trunk/KDE/kdegraphics/okular/; revision=890869
2008-11-30 15:10:36 +00:00
Pino Toscano ef8a4b9a83 be sure to close the file before sending it for printing
svn path=/trunk/KDE/kdegraphics/okular/; revision=875559
2008-10-24 20:13:53 +00:00
Pino Toscano eceb09c379 add more contexts in i18n calls
svn path=/trunk/KDE/kdegraphics/okular/; revision=855876
2008-09-01 16:37:39 +00:00
Pino Toscano d51be3729b add a way to disable the internal page cache, and disable it by default in the generator
svn path=/trunk/KDE/kdegraphics/okular/; revision=843095
2008-08-06 12:42:44 +00:00
Pino Toscano a9227aff93 SVN_SILENT bump version, update copyright notice and slightly improve the description
svn path=/trunk/KDE/kdegraphics/okular/; revision=843089
2008-08-06 12:31:16 +00:00
Pino Toscano 903956dec9 SVN_SILENT unused parameter
svn path=/trunk/KDE/kdegraphics/okular/; revision=784611
2008-03-11 21:19:25 +00:00
Pino Toscano 080acb4344 one constness more, one ugly cast less
svn path=/trunk/KDE/kdegraphics/okular/; revision=747392
2007-12-11 21:41:19 +00:00
Pino Toscano 870980da75 correctly set the External flag for annotations loaded from documents
svn path=/trunk/KDE/kdegraphics/okular/; revision=746264
2007-12-08 13:45:06 +00:00
Pino Toscano 6aa123656a Port the plugin system to the standard KDE factory and loader, getting rid of the custom system okular had so far.
This requires a generator to have a
  MyGenerator(QObject *parent, const QVariantList &args)
constructor in order to be successfully loaded.
The OKULAR_EXPORT_PLUGIN macro was adapted, and the generators to provide it the about data; the protected Generator::setAboutData() is no more needed.

Remove the 'lib' prefix from plugins, unneeded now.

CCMAIL: okular-devel@kde.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=744169
2007-12-02 20:57:24 +00:00
John Layt 1b1ed9451b Enable Okular printing features:
* Add FilePrinter class to enable printing via postscript files
* DJVU, PDF, and PS backends print FilePrinter
* All backends enable printing of bookmarked pages
* Print and Print Preview actions enabled/disabled depending on backends
  printing ability

Note that FilePrinter only works on *NIX platforms with Cups, lpr, or lp.



svn path=/trunk/KDE/kdegraphics/okular/; revision=741990
2007-11-26 21:43:54 +00:00
John Layt 070285e039 Port from KPrinter to QPrinter, remove dependency on KDE4_KDEPRINT_LIBS.
*** Note this is not a complete port, most of the generators use the 
printFiles method which Qt 4.3 does not support, these have simply
been commented out until we find a solution.  At least it removes
the dependency so we can remove from kdelibs.

svn path=/trunk/KDE/kdegraphics/okular/; revision=725660
2007-10-15 23:01:27 +00:00
Pino Toscano 15155d8824 Rename the virtual closeDocument() to doCloseDocument(), and make it protected.
Added a non-virtual closeDocument() in the base Generator class: this way, particular closing routines can be implemented in the "low level" of a generator.
Apart the renaming, the logic of doCloseDocument() remains the same.

CCMAIL: okular-devel@kde.org

svn path=/trunk/KDE/kdegraphics/okular/; revision=723046
2007-10-08 16:46:51 +00:00
Pino Toscano 9ec65271fa SVN_SILENT old stuff
svn path=/trunk/KDE/kdegraphics/okular/; revision=716091
2007-09-23 23:39:34 +00:00
Pino Toscano 4edda7b967 provide the title of the document, if it has any
svn path=/trunk/KDE/kdegraphics/okular/; revision=716089
2007-09-23 23:27:50 +00:00
Pino Toscano 50b73a93b1 Remove the (not working) homemade async loading, and make use of the Generator API for async loading.
svn path=/trunk/KDE/kdegraphics/okular/; revision=716074
2007-09-23 22:13:16 +00:00