Commit Graph

2223 Commits

Author SHA1 Message Date
Luis Ángel San Martín
5db5fb7e0c Fix crash when closing YACReader with an empty go to flow gl 2019-06-02 09:28:54 +02:00
Luis Ángel San Martín
d9f3e7707e Use a README based on markdown 2019-06-01 18:46:44 +02:00
Luis Ángel San Martín
ad33a73f2f
Merge pull request #63 from YACReader/feature/fix_ogl_texture_destruction
Fix YACReaderPageFlowGL texture destruction
2019-06-01 16:14:17 +02:00
Luis Ángel San Martín
c06e8c0fc6 Fix YACReaderPageFlowGL texture destruction 2019-06-01 16:13:29 +02:00
Luis Ángel San Martín
d459056615
Merge pull request #62 from YACReader/feature/magnifying_glass_fixes
Feature/magnifying glass fixes
2019-06-01 16:12:53 +02:00
Luis Ángel San Martín
0ab94181cc Use exiting variable instead of request the image several times 2019-06-01 16:12:08 +02:00
Luis Ángel San Martín
0503a83a86 Use device pixel ratio when using intermediate images in lens 2019-06-01 16:12:08 +02:00
Luis Ángel San Martín
bc5a177f4f
Merge pull request #61 from YACReader/feature/fix_warnings
Feature/fix warnings
2019-06-01 16:05:47 +02:00
Luis Ángel San Martín
4126fc71c3 Remove unused variables 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
f29724e404 Annotate overridden methods 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
9140d66693 Use nullptr 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
e2276cbc1c More auto 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
268bebbddd Use nullptr instead of 0 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
bb334cfd50 Use auto to avoid duplicating the type name 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
923ad40057 Use nullptr instead of 0 2019-06-01 16:04:48 +02:00
Luis Ángel San Martín
2fe3fcf041
Merge pull request #60 from YACReader/feature/setup_clang_format
Add .clang-format and format all code
2019-06-01 15:59:53 +02:00
Luis Ángel San Martín
2bd8e2c5ad Remove comment pragmas
We don't have special types of comments so far
2019-05-31 19:43:54 +02:00
Luis Ángel San Martín
824b4878a4 Q_FOREACH is deprecated, no need to format it 2019-05-31 19:41:51 +02:00
Luis Ángel San Martín
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +02:00
Luis Ángel San Martín
e0eb94e3ae Dependencies shouldn't be formated by clang-format 2019-05-30 19:24:34 +02:00
Luis Ángel San Martín
8b54744723 Add .clang-format files
Third party code should be excluded from automatic formating: QsLog and QtWebApp
2019-05-30 18:58:54 +02:00
Luis Ángel San Martín
d1b1965fc0
Merge pull request #59 from vedgy/eliminate-SlideInitializer
Reader: eliminate SlideInitializer class
2019-05-30 18:29:02 +02:00
Luis Ángel San Martín
ca34e99ec4
Merge pull request #57 from vedgy/misc-code-fixes
Miscellaneous code fixes
2019-05-30 18:24:53 +02:00
Luis Ángel San Martín
6c628318fe
Merge pull request #54 from vedgy/fix-crash-at-exit
Library: fix a crash at exit when server is disabled
2019-05-30 18:22:06 +02:00
Luis Ángel San Martín
7b712e144a
Merge pull request #53 from selmf/light_gl_flow_refactoring
Light gl flow refactoring
2019-05-30 18:21:05 +02:00
Luis Ángel San Martín
ae1badc351
Merge pull request #13 from jeremydouglass/patch-1
Add Up Down navigation to FlowView
2019-05-30 18:19:13 +02:00
Jeremy Douglass
6f2a4bf243 Add Up Down navigation to FlowView
Adds vertical navigation (up down) to FlowView. This corresponds visually to the File Name list display -- especially when the flow pane is hidden, pressing up-down is the intuitive way to navigate up-down in the list.
2019-05-30 18:15:33 +02:00
Igor Kushnir
bb964c8566 Reader: eliminate SlideInitializer class
GoToFlow shared its YACReaderFlow flow object with SlideInitializer
objects it created. GoToFlow modified the flow object in the main thread
and SlideInitializer modified the flow object in its own thread without
any thread synchronization. The only reason this usually worked was the
timing: SlideInitializer finished its work before the next time GoToFlow
heavily accessed the flow object. This was a data race and thus
undefined behavior.

Additionally, this commit eliminates a memory leak:
a new SlideInitializer object was constructed each time a comic was
opened in YACReader. These objects were never destroyed.

SlideInitializer called PictureFlow::triggerRender() from its own
thread. This function restarted triggerTimer, which QTimer's API forbids
doing from another thread. This commit eliminates the following errors
from YACReader's standard output:
    QObject::killTimer: Timers cannot be stopped from another thread
    QObject::startTimer: Timers cannot be started from another thread

Without this fix YACReader on GNU/Linux often uses an entire CPU core
from launch till exit if hardware acceleration is disabled (#56).

The data race could alternatively be fixed by adding thread
synchronization code into most GoToFlow member functions. But the code
in SlideInitializer::run() is executed only once per opened comic; it is
not slow enough to justify creating a dedicated thread and suffer the
overhead of thread synchronization while the comic is being read.
I have tested several 550 pages long 1 GB comic books.
SlideInitializer::run() took up to 25 milliseconds in the worst case,
but usually 2-4 times less. For smaller 30-page comics it usually takes
less than a millisecond.

Even though mutexGoToFlow was locked in SlideInitializer::run(), there
is no need to lock it in the code moved to GoToFlow::setNumSlides():
this function is called in the main thread like all the other GoToFlow's
member functions that access the flow object. PageLoader does not have
access to the flow object.
2019-05-29 10:56:43 +03:00
Igor Kushnir
12aabf7960 Reader: fix thread safety bugs in PageLoader 2019-05-24 14:53:59 +03:00
Igor Kushnir
c1810b9e54 Library: do not needlessly retrieve all comics from the DB
The siblings variable is unused. So the ComicModel::getAllComics() call
is redundant unless there is some unobvious side effect (I hope not).
2019-05-24 14:53:52 +03:00
Igor Kushnir
92cf54980c Library: eliminate QPainter warnings
There were many run-time warnings in YACReaderLibrary built in Debug
mode with hardware acceleration disabled and with ClassicComicsView
as the active comics view:
    QWidget::paintEngine: Should no longer be called
    QPainter::begin: Paint device returned engine == 0, type: 1

The ComicFlowWidgetSW::paintEvent() implementation now corresponds to
ComicFlowWidgetGL::paintEvent(), which has been fixed earlier.

QWidget::repaint() calls paintEvent() immediately.
PictureFlow::paintEvent() calls d->renderer->paint(). So the
d->renderer->paint() call in PictureFlow::updateMarks() was redundant.
2019-05-22 17:37:04 +03:00
Igor Kushnir
8522b11e37 Library: fix a crash at exit when server is disabled
Startup::stop() called from LibraryWindow::closeEvent() crashes if
listener is not initialized.
2019-05-19 13:50:53 +03:00
Felix Kauselmann
caca3191f9 Flow: Remove glu dependency 2019-05-06 07:38:33 +02:00
Felix Kauselmann
d9d93c6481 gl flow: clean up includes 2019-05-05 11:17:45 +02:00
Felix Kauselmann
7bd04ca7d5 remove legacy flow implementation
We no longer support builds using the legacy flow.
2019-05-05 09:39:07 +02:00
Felix Kauselmann
87a6645875 Document version, build flags and patches for bundled pdfium.dll 2019-05-01 16:19:13 +00:00
Felix Kauselmann
c1c413a72d Windows: Update bundled pdfium to r3729 2019-05-01 16:19:13 +00:00
Felix Kauselmann
7ae8afffb1 OS X: Update bundled pdfium to r3729 2019-05-01 16:19:13 +00:00
Luis Ángel San Martín
eeb303a5c1 Avoid parsing non supported dates from comic vine 2019-04-28 09:30:15 +02:00
Luis Ángel San Martín
44db4397e8 Avoid parsing null values from comic vine 2019-04-28 09:28:50 +02:00
Luis Ángel San Martín
54a0610a06 Fix out of bounds crash 2019-04-28 09:28:15 +02:00
Felix Kauselmann
bc6b51ecf5 Add .editorconfig to prevent whitespace conflicts
Some IDE support this out of the box, others will need a plugin.
For more details see https://EditorConfig.org
2019-04-19 15:02:34 +00:00
Luis Ángel San Martín
14f1609ffa
Merge pull request #43 from mytskine/fix-gcc8-warnings-develop
Fix gcc8 warnings
2019-04-19 16:56:56 +02:00
Felix Kauselmann
ad46d9089c Fix botched utf8 encoding. 2019-04-19 14:55:36 +00:00
François Gannaz
88f668d663 bugfix: 'switch case' for OpenVG had no 'break' 2019-04-03 20:44:57 +00:00
François Gannaz
35bb3b553f bug: 'else' without braces but several lines indented (#41)
* bug: 'else' without braces but several lines indented

* always set previousIndex in Render::updateBuffer()

As discussed in #41, the previous index was meant to be
updated in every case, but the faulty indentation
suggested another behavior.
2019-04-03 20:43:27 +00:00
François Gannaz
8c8521a8dc Library: reorder initialization of ResponseParser 2019-04-01 11:25:16 +02:00
François Gannaz
ebcb52bf16 Library: bugfix a 'switch case' that had no 'break' 2019-04-01 11:25:16 +02:00
François Gannaz
0453bf126a Library: unused method parameter, so comment out the name 2019-04-01 11:25:16 +02:00
François Gannaz
9aff260f06 Library: unused method parameter, so comment out the name 2019-04-01 11:25:16 +02:00