Commit graph

78 commits

Author SHA1 Message Date
Albert Astals Cid b9c40d709d Fix formatting after Laurent's commit
Please Laurent try to use MR when you do changes that may break our CI
like this one

CCMAIL: montel@kde.org
2020-10-23 22:48:44 +02:00
Laurent Montel 486e05b270 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 07:32:28 +02: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
Albert Astals Cid 0a2287be19 CI: Enable two readability clang-tidy checks
Use jq to filter compile_commands.json to not include the compilation of
autogenerated files, we don't want to check those

Also filter out the synctex folder, since that is imported code
2019-12-23 12:06:49 +01:00
Albert Astals Cid c549acaab0 Move the Q_PRIVATE_SLOTS to lambda connections
Some of the invokeMethods with a queued connection get changed with a
QTimer::SingleShot with 0 which has the same behaviour
2019-12-20 16:42:58 +01:00
Ahmad Samir ccf3a384c3 [core/*] replace foreach, deprecated, with range-for
The code compiles and okular seems to load and work as before, all unit
tests pass except (parttest and epubgeneratortest, but they fail on master
too).
2019-12-09 13:16:55 +00:00
Tobias Deiminger b5b273ad64 Enhance bounds check in TextDocumentGenerator
There's too much upstream / logic involved to statically prove
info.pages is always >= 0. Better check it at runtime.

CCBUG: 410844
2019-08-22 09:17:33 +02:00
Albert Astals Cid ec51b2f02f Remove QFontDatabase::supportsThreadedFontRendering checks
We require Qt 5.8 and there (and up) it returns true unconditionally and
it's now marked as deprecated
2019-07-04 00:09:04 +02:00
Albert Astals Cid fe0c8ad7c9 MarkDown: Enable option to disable smartypants formatting
BUGS: 404616

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D19405
2019-03-30 23:51:00 +01:00
Albert Astals Cid 014b97fd96 Include cmath for std::floor 2019-01-29 00:04:25 +01:00
Albert Astals Cid 27b76ee7c0 TextDocumentGenerator: Support links that span more than one line
Summary:
If a link spans more than one line we need one rect for each of the lines

BUGS: 403247

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18303
2019-01-28 22:09:30 +01:00
Albert Astals Cid 5cce9a11fe Small refactor in TextDocumentGeneratorPrivate
add const to a few variables

Make two functions return a qlist instead of using a member qlist to
return the results in them
2019-01-16 19:29:52 +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
Kevin Funk a53a2402ca clang-tidy: modernize-use-nullptr run
Semi-ACK'd by Albert :)
2017-09-06 00:19:48 +02:00
Albert Astals Cid f467807506 Remove #ifdefs for Qt we require in cmake anyway 2017-01-16 00:36:08 +01:00
Montel Laurent 466eb79615 Use QStringLiteral 2015-10-29 13:37:11 +01:00
Frederik Gladhorn dad6936896 Bring back the txt generator 2014-09-17 23:52:52 +02:00
Frederik Gladhorn 6c602bf0e7 Use categorized logging even more 2014-09-16 23:38:25 +02:00
Frederik Gladhorn e28dbc6c00 Port to QMime
compressedMimeFor now already does the inheritance check, so another
check was removed.
2014-09-11 16:32:43 +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
Frederik Gladhorn b79e706e56 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	generators/dvi/generator_dvi.cpp
	generators/ooo/generator_ooo.cpp
	part.cpp
	shell/main.cpp
	shell/shell.cpp
	shell/shell.h
	shell/shellutils.h
	tests/CMakeLists.txt
	ui/propertiesdialog.cpp
2014-08-14 13:35:43 +02:00
Vishesh Handa fb330dd45c Port the EPubGenerator 2014-08-13 11:42:09 +02:00
Albert Astals Cid e9e3d4a435 Make documentInfo be Hash based instead of XML based 2014-08-10 22:38:13 +02:00
Frederik Gladhorn 0c7a45c7a5 Disable lots of stuff and compile
The text generator is the only one compiled now.
This version links for me but then doesn't find its KPart on startup.

TTS has been completely disabled as well as some other things like the
about dialog.
2014-08-10 14:42:54 +02:00
Frederik Gladhorn 0ba233788c Use moc include style dictated by automoc
While it's generally not a great idea to include moc files at least this
compiles.
2014-08-09 00:21:03 +02:00
Frederik Gladhorn 75031eee7e Fix includes 2014-08-08 01:59:55 +02:00
Albert Astals Cid 86dd9e8801 Move the ooo wallet code to use the part.cpp one
Less widgets in generators/core \o/
2014-05-10 15:54:03 +02:00
Christoph Feck 60cc5dc98e TextDocumentGenerator: Use black as default text color
REVIEW: 111681
BUGS: 253583
BUGS: 322547
FIXED-IN: 4.12.90
2014-03-12 23:01:42 +01:00
Jaydeep Solanki e9ccc4867b epub video support 2013-10-24 00:20:04 +02:00
Fabio D'Urso a79351212d Removed TextDocumentGenerator::generalSettingsWidget()
Which is now useless because with the previous patch
TextDocumentGenerator no longer caches the widget.
2013-06-07 00:44:56 +02:00
Fabio D'Urso 3dd3a000db Don't crash if Configure Backends is opened again after it's been closed 2013-06-07 00:26:05 +02:00
Azat Khuzhin 1fdb0a0a06 Font selector for TextDocumentGenerator
REVIEW: 109021
2013-05-18 16:03:33 +02:00
Montel Laurent f9f65979f5 Normalize signals/slots 2011-07-31 21:22:04 +02:00
Pino Toscano c05523da2b fix #include paths in core headers to other core headers to be relative
... and with double quotes brackets, so they can properly include each other without relying on the compiler include path
2011-06-01 10:51:31 +02:00
Tobias Koenig d5a2d53d21 Do not crash in case of false calculations in a generator
BUG: 233944

svn path=/trunk/KDE/kdegraphics/okular/; revision=1113765
2010-04-11 17:54:54 +00:00
Tobias Koenig 911f8eaeca tab -> whitespace fixes
svn path=/trunk/KDE/kdegraphics/okular/; revision=971089
2009-05-21 16:46:05 +00:00
Pino Toscano 0761b20be2 turn the internal class Utils (with just static members) into a TextDocumentUtils namespace
svn path=/trunk/KDE/kdegraphics/okular/; revision=908736
2009-01-10 11:29:11 +00:00
Brad Hards 3cb0e7575f Improve handling of document synopsis with
strange entry ordering.

CCBUG:168678

svn path=/trunk/KDE/kdegraphics/okular/; revision=890398
2008-11-29 07:45:25 +00:00
Brad Hards bfa53df1ec Don't crash when setting up the document synopsis for
ODTs with strange heading ordering.

This may still cause the synopsis to look different
to the way the user expected. Will take another
look at that.

BUG: 168678

svn path=/trunk/KDE/kdegraphics/okular/; revision=890395
2008-11-29 05:34:33 +00:00
Pino Toscano 355eef2da6 correct place the bracket out of the #ifdef
svn path=/trunk/KDE/kdegraphics/okular/; revision=855781
2008-09-01 12:51:30 +00:00
Brad Hards cfb62ab4d5 Add support for export to OpenDocument text and HTML
for TextDocumentGenerator-based generators:
 - EPub format
 - Fictionbook format
 - OOO.

This depends on Qt 4.5. Thanks to Qt Software (or wherever Thomas Z.
works) for QTextDocumentWriter!

It wouldn't be too hard to make this work for plucker (.pdb)
format, but that format doesn't work for me. It would be very
hard to make it work for other formats.


svn path=/trunk/KDE/kdegraphics/okular/; revision=855771
2008-09-01 12:00:50 +00:00
Pino Toscano 84a23006d5 ask the q-ptr only when compling the threaded rendering
svn path=/trunk/KDE/kdegraphics/okular/; revision=847495
2008-08-15 13:24:02 +00:00
Pino Toscano 6cf2d5786e limit the scope of the text cursor, so it's deleted before the mutex unlock
svn path=/trunk/KDE/kdegraphics/okular/; revision=805246
2008-05-07 23:04:01 +00:00
Pino Toscano 697d51e1a2 Make the rendering for TextDocument-based generators threaded, only if Qt (via QFontDatabase) tells us we can.
... but, as it's proving to be buggy (text disappearing from menus) and crashing (out-of-range font engine list), it's disabled for now, define OKULAR_TEXTDOCUMENT_THREADED_RENDERING to try it.

svn path=/trunk/KDE/kdegraphics/okular/; revision=804719
2008-05-06 20:20:10 +00:00
Pino Toscano 18c8cf59e8 - when the loading of a textdocument-based document fails, cleanup all the stuff eventually gathered from the converter
- cleanup also the annotation position when closing a textdocument

svn path=/trunk/KDE/kdegraphics/okular/; revision=799076
2008-04-20 09:49:20 +00:00
Pino Toscano 890367943b clear TOC and document info when closing a textdocument-based document
svn path=/trunk/KDE/kdegraphics/okular/; revision=798886
2008-04-19 20:06:31 +00:00
Pino Toscano c44ce52719 add a private reimplementation of metaData() so the text document generator can show the title of a document
svn path=/trunk/KDE/kdegraphics/okular/; revision=785821
2008-03-15 02:15:16 +00:00
Pino Toscano 7266660c37 Add a protected TextDocumentGenerator* generator() to the TextDocumentConverter to make it able to use stuff of the Document (eg a parent for dialogs).
svn path=/trunk/KDE/kdegraphics/okular/; revision=775125
2008-02-14 23:19:24 +00:00