Commit Graph

66 Commits

Author SHA1 Message Date
0ab94181cc Use exiting variable instead of request the image several times 2019-06-01 16:12:08 +02:00
0503a83a86 Use device pixel ratio when using intermediate images in lens 2019-06-01 16:12:08 +02:00
4126fc71c3 Remove unused variables 2019-06-01 16:04:48 +02:00
f29724e404 Annotate overridden methods 2019-06-01 16:04:48 +02:00
9140d66693 Use nullptr 2019-06-01 16:04:48 +02:00
e2276cbc1c More auto 2019-06-01 16:04:48 +02:00
bb334cfd50 Use auto to avoid duplicating the type name 2019-06-01 16:04:48 +02:00
923ad40057 Use nullptr instead of 0 2019-06-01 16:04:48 +02:00
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +02:00
d1b1965fc0 Merge pull request #59 from vedgy/eliminate-SlideInitializer
Reader: eliminate SlideInitializer class
2019-05-30 18:29:02 +02:00
ca34e99ec4 Merge pull request #57 from vedgy/misc-code-fixes
Miscellaneous code fixes
2019-05-30 18:24:53 +02:00
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
12aabf7960 Reader: fix thread safety bugs in PageLoader 2019-05-24 14:53:59 +03:00
caca3191f9 Flow: Remove glu dependency 2019-05-06 07:38:33 +02:00
14f1609ffa Merge pull request #43 from mytskine/fix-gcc8-warnings-develop
Fix gcc8 warnings
2019-04-19 16:56:56 +02:00
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
5ad0e293ac typecast comparison from unsigned to int 2019-04-01 11:23:33 +02:00
f9d6667461 typecast comparison in Render::nextPage 2019-04-01 09:27:09 +02:00
9dbfabc05f fix ambigous 'else' in Render::load 2019-04-01 09:25:12 +02:00
560bcf7f32 reorder initialization of Render 2019-04-01 09:22:46 +02:00
a8677553b7 reorder initialization of PageRender 2019-04-01 09:18:49 +02:00
06a36bfa40 reorder initialization of Viewer::Viewer 2019-04-01 09:16:09 +02:00
9321d864db Fixed sending read progress. 2018-10-06 11:12:44 +02:00
ab96056b0e Normalize line endings
Normalize the line endings for a bunch of files previously not covered 
by .gitattributes.
2018-08-07 11:09:02 +02:00
d5a11fb16b Add .gitattributes rules for text and binary handling 2018-07-30 15:04:04 +02:00
1fbf1195b9 Fix YACReader build for Qt <= 5.7 2018-07-01 14:39:46 +02:00
6538d418c7 Update translations. 2018-06-16 08:28:50 +02:00
0b552bc726 Translate
French translation
2018-06-14 22:35:34 +02:00
1a91206a2d Merge branch 'develop' into 9.5.0_bugfixes 2018-05-31 18:12:52 +02:00
9cc4f65fc8 Use older api currentSecsSinceEpoch was introduced in Qt 5.8 2018-05-28 21:18:11 +02:00
0cc6b3bcf7 SendComic: Connect finished signal to deleteLater slot BEFORE the finished
signal is emitted so it is actually processed and we don't get dangling pointers.

Use modern signal slot syntax so that the compiler and source check tools can
verify we actually fixed the problem.
2018-05-26 12:43:03 +02:00
5c876e6785 Make YACReader send info for the next comic.
Now we can set the next comic as reading.
2018-05-20 17:43:28 +02:00
c97bc6ef88 Fix determining if we are in double page or not. 2018-05-20 17:39:08 +02:00
c9f703b6f7 Revert "Fixed wrong index asigned to current page from the viewer"
This reverts commit 26fdb5a303.
2018-05-20 15:19:48 +02:00
82cfdfdf30 YACReader should be dummy about has been opened.
It should only send back information, hasBeenOpened will be set in YACReaderLibrary depending on various factors.
2018-05-20 14:43:19 +02:00
26fdb5a303 Fixed wrong index asigned to current page from the viewer 2018-05-20 14:40:07 +02:00
932910d0a9 Fix memory leak, comics need to be in the right thread before deleting them. 2018-04-24 21:01:38 +02:00
040664d3ba Backout changeset c42e71e42d7968ddb6c63fd39011669503b9122c 2018-04-24 20:53:48 +02:00
b41884d5db Merge 2018-04-14 10:24:19 +02:00
6313df5407 Make BINDIR, DATADIR and LIBDIR fully configurable 2018-03-11 09:40:30 +01:00
e1af8fa35e Merge develop 2018-03-10 11:49:29 +01:00
aca67f2b2a merged - develop 2018-03-03 23:36:29 +01:00
2f6c968302 Merged in Anon789/yacreader-4/Anon789/yacreader_ruts-correcting-errors-in-wor-1519495902252 (pull request #66)
yacreader_ru.ts

Approved-by: Luis ?ngel San Mart?n <luisangelsm@gmail.com>
2018-03-03 14:53:02 +00:00
7860a9b51f yacreader_ru.ts edited online with Bitbucket 2018-02-26 12:38:46 +00:00
cbd5c0acc5 Translation into Russian is completed by 100% In the future there will be only correction of errors, inaccuracies of translation and other improvements in appearance. 2018-02-25 15:59:46 +00:00
dd381df7b7 yacreader_ru.ts
Correcting errors in words and their meanings. Update the Russian language. Now look better.
2018-02-24 18:11:53 +00:00
cc72d30f5b Remove thread pingpong 2018-02-20 11:16:47 +01:00
251dede93d Remove obsolete QGLWidget based cover flow 2018-02-19 14:36:58 +01:00
09c8125f87 Merge default branch 2018-02-18 17:17:14 +01:00
fc454a81a3 Fix builds with CONFIG+=no_opengl 2018-02-18 15:02:51 +01:00