Commit Graph

82 Commits

Author SHA1 Message Date
Felix Kauselmann
c13ec618d0 Move QsLog to third_party directory 2020-08-20 17:41:56 +02:00
Luis Ángel San Martín
eea96f6fa2 Improve file association in YACReader Info.plist 2019-10-20 09:19:49 +02:00
Luis Ángel San Martín
1f8be886ec Add new action to create a new instance of the viewer in macos 2019-09-28 16:55:28 +02:00
Luis Ángel San Martín
e1b0e7c96f Fix full screen mode in windows with qt 5.12.4+ 2019-09-28 10:11:44 +02:00
Luis Ángel San Martín
0b83764734
Revert "Thread ping pong" 2019-09-24 12:00:21 +02:00
Felix Kauselmann
cc71f419cc Revert "Backout changeset c42e71e42d7968ddb6c63fd39011669503b9122c"
This reverts commit 040664d3ba.
2019-09-24 08:12:38 +02:00
Igor Kushnir
6efc31682c Reader: eliminate duplicate calls to GoToFlow::preload()
GoToFlow::setNumSlides() is called each time a comic is opened. So when
e.g. three comics were opened one after another without restarting
YACReader, each of the PictureFlow::centerIndexChanged* signals was
connected to GoToFlow::preload three times, which multiplied the number
of calls to preload() accordingly.

During my testing PictureFlow::centerIndexChanged* signals were never
emitted before the first call to GoToFlow::setNumSlides(), so connecting
in GoToFlow::GoToFlow() should not cause extra calls to preload().
2019-09-18 18:12:03 +02:00
Igor Kushnir
28b8fca729 Reader: make PageLoader::working atomic to fix a data race
This data member is modified in PageLoader's own thread and accessed
without locking from an external thread in the public busy() function.

Reorder setting working and img in PageLoader::run() to avoid a data
race in PageLoader::result() called from GoToFlow::updateImageData().
2019-09-18 18:12:03 +02:00
Igor Kushnir
82719573b5 Reader: store geometry instead of pos&size in Configuration
Qt documentation recommends calling saveGeometry() in closeEvent().

This commit fixes the following bug on my GNU/Linux with Xfce system:
    1. Move the top of the YACReader window to the top of the screen.
    2. Restart YACReader (exit and run again).
    2. Enter full screen mode.
    4. Restart YACReader.
    5. Exit full screen mode.
At this point YACReader's title bar is hidden beyond the top of the
screen, i.e. the window has moved up.
2019-09-18 18:10:40 +02:00
Igor Kushnir
eb9075c917 Reader: remove unused code from Configuration 2019-09-18 18:10:40 +02:00
Igor Kushnir
39ab598363 Reader: clean unused code up
closeEvent is accepted by default, so this commit does not change the
application behavior. But Qt documentation recommends not relying on the
default value as subclasses may choose to clear it in their constructor.
2019-09-18 18:10:40 +02:00
Igor Kushnir
8820c8769b Reader: add support for horizontal mouse wheel
Without this commit the horizontal wheel on a two-wheel mouse acts the
same as the vertical wheel in YACReader.

horizontalScroller is used analogously to verticalScroller in
Viewer::scrollTo(). So I made the horizontal wheel work analogously to
the vertical wheel except for moving to the next or previous page.
2019-09-18 15:32:35 +02:00
Luis Ángel San Martín
15277d00b7 README.txt has been renamed to README.md
this fixes installing YACReader using qmake -install
2019-09-16 23:46:26 +02:00
Luis Ángel San Martín
24fce96220 Disable darkmode for now 2019-08-31 09:35:32 +02:00
Luis Ángel San Martín
607b7b4d6f Remove QMAKE_MAC_SDK from all projects 2019-08-24 11:11:50 +02:00
Luis Ángel San Martín
0892d2a022 Fix saving progress in double page mode
If the current page is being displayed we don't change anything, if is it not, we pick the current index page.
2019-08-21 18:46:10 +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
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
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
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +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
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
Felix Kauselmann
caca3191f9 Flow: Remove glu dependency 2019-05-06 07:38:33 +02: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
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
5ad0e293ac typecast comparison from unsigned to int 2019-04-01 11:23:33 +02:00
François Gannaz
f9d6667461 typecast comparison in Render::nextPage 2019-04-01 09:27:09 +02:00
François Gannaz
9dbfabc05f fix ambigous 'else' in Render::load 2019-04-01 09:25:12 +02:00
François Gannaz
560bcf7f32 reorder initialization of Render 2019-04-01 09:22:46 +02:00
François Gannaz
a8677553b7 reorder initialization of PageRender 2019-04-01 09:18:49 +02:00
François Gannaz
06a36bfa40 reorder initialization of Viewer::Viewer 2019-04-01 09:16:09 +02:00
Luis Ángel San Martín
9321d864db Fixed sending read progress. 2018-10-06 11:12:44 +02:00
Felix Kauselmann
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
Felix Kauselmann
d5a11fb16b Add .gitattributes rules for text and binary handling 2018-07-30 15:04:04 +02:00
Felix Kauselmann
1fbf1195b9 Fix YACReader build for Qt <= 5.7 2018-07-01 14:39:46 +02:00
Luis Ángel San Martín
6538d418c7 Update translations. 2018-06-16 08:28:50 +02:00
toto
0b552bc726 Translate
French translation
2018-06-14 22:35:34 +02:00
Luis Ángel San Martín
1a91206a2d
Merge branch 'develop' into 9.5.0_bugfixes 2018-05-31 18:12:52 +02:00
Luis Ángel San Martín
9cc4f65fc8 Use older api currentSecsSinceEpoch was introduced in Qt 5.8 2018-05-28 21:18:11 +02:00
Felix Kauselmann
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
Luis Ángel San Martín
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
Luis Ángel San Martín
c97bc6ef88 Fix determining if we are in double page or not. 2018-05-20 17:39:08 +02:00
Luis Ángel San Martín
c9f703b6f7 Revert "Fixed wrong index asigned to current page from the viewer"
This reverts commit 26fdb5a303.
2018-05-20 15:19:48 +02:00