Commit Graph

122 Commits

Author SHA1 Message Date
948ed595e7 Bump version number to 9.7.1 2020-09-12 12:02:55 +02:00
c490b70b68 Move declaration to the viewer group 2020-09-07 18:13:06 +02:00
bb09be3d6a Bump version number 2020-09-03 18:05:05 +02:00
802e0d32ce Fix trying to scale images on null images 2020-09-03 18:00:29 +02:00
5bb6ab276a Reader: Add option to show covers as single pages in double page mode 2020-09-03 15:32:45 +02:00
232181eef7 Reader: Add option to stop enlarging images in fit to width and height 2020-09-02 09:27:53 +02:00
5f0889f332 Format 2020-08-31 16:19:42 +02:00
a2b4b88801 Format 2020-08-31 16:04:26 +02:00
cb7c967252 Add WorkerThread class and use it in ComicFlow
In a later commit WorkerThread should also replace classes similar to
ImageLoader: PageLoader, ImageLoaderGL and ImageLoaderByteArrayGL.

Bugs fixed:
  1. Eliminated a data race between ImageLoader::run() and
ComicFlow::updateImageData()->ImageLoader::result(). Specifically when
ImageLoader::busy() returns false, then ImageLoader::run() sets
ImageLoader::working to true, loads the image and starts assigning it to
ImageLoader::img, while ImageLoader::result() is accessed without
locking from updateImageData().
Making ImageLoader::working atomic is clearly insufficient to eliminate
this data race. The fix is to set 'working' to true immediately and
synchronously as soon as a new task is assigned to the worker.
  2. Replaced thread termination with graceful thread exit. ComicFlow
destructor called QThread::terminate(), using which is discouraged by Qt
documentation. The application exited without errors in Release mode.
In Debug mode, however, it received the SIG32 signal on exit and printed
the following warning - "QWaitCondition: mutex destroy failure:
Device or resource busy".
The loop in WorkerThread::run() is no longer endless. The worker thread
properly ends and is joined in WorkerThread destructor.

Design decisions:
 1. WorkerThread could emit a signal when it completes a task.
Thus updateTimer could be removed from ComicFlow and GoToFlow. However,
there is no obvious way to use this new signal in the two GL classes.
Also I don't know whether updateTimer is just an inefficient polling
substitute for notification or an intentional animation mechanism.
 2. The index variable is no longer stored in the worker class, but in
ComicFlow directly. Thing is, this data member was never actually
accessed by the worker, but ComicFlow went so far as to lock worker's
mutex to "protect" access to the index.
 3. The common ImageLoader implementation turned out to be very general.
So I converted it into the WorkerThread class template that is not
restricted to producing QImage results and can be reused elsewhere.
 4. I used standard classes (such as std::thread) instead of their Qt
equivalents (e.g. QThread) because they are more thoroughly documented.
The standard classes should also be more efficient as they were more
carefully designed and provide much fewer unnecessary features.
 5. Release-Acquire ordering is safe for the WorkerThread::working
use case and is more efficient than the std::atomic-default
Sequentially-consistent ordering.
 6. condition.notify_one() is called while the mutex is unlocked
to improve performance. This is safe in both cases:
  a) if the worker thread exits due to a spurious wakeup just before
the condition.notify_one() call in WorkerThread destructor, so much the
better;
  b) if a spurious wakeup lets the worker thread finish the task and
start waiting on the condition again just before the
condition.notify_one() call in WorkerThread::performTask(), the second
waking will be ignored by the worker thread as 'working' and 'abort'
will be false then.
2020-08-31 15:45:12 +02:00
b9acd13120 Fix code format errors due to changes in default coding style. (#150) 2020-07-24 21:17:49 +02:00
092611f0cd Send read status for imported comics 2020-05-09 22:19:00 +02:00
15c126fda5 Enable unarr 7z support. Closes #113 (#115)
* Enable unarr 7z support. Closes #113
2020-02-12 08:38:03 +01:00
f65395c11d Bump version number 2019-09-28 10:15:17 +02:00
d49c8895ff Bump version number 2019-09-27 18:33:08 +02:00
0b83764734 Revert "Thread ping pong" 2019-09-24 12:00:21 +02:00
7ed19ddd78 Fix scope
GitKraken has some serious issues when resolving conflicts
2019-09-24 09:17:39 +02:00
cc71f419cc Revert "Backout changeset c42e71e42d7968ddb6c63fd39011669503b9122c"
This reverts commit 040664d3ba.
2019-09-24 08:12:38 +02:00
8603b8ca14 Get the latest version number from the code in master 2019-09-22 12:27:51 +02:00
3923da2344 Add new define to remember if we have notified the user about close to tray 2019-09-21 10:42:38 +02:00
80cd4f64f8 Rename setting
We are going to use close to system tray instead of minimize, easier to handle it at a crossplatform level
2019-09-21 10:42:15 +02:00
e587f59ddb Add support for minimize and start to tray. 2019-09-19 20:22:14 +02:00
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
2649f58f15 Include lastTimeOpened in plain text comic info 2019-09-10 17:16:53 +02:00
fb2684292b Fix code formatting. 2019-08-24 14:37:25 +02:00
bcba08d344 OpenGL CoverFlow: Restore antialiasing
We previously had to disable antialiasing because z-buffer
picking did not work with multisampling enabled. Now we
have raytracing, so we can restore it.
2019-08-24 14:37:25 +02:00
622978b2bd OpenGL coverflow: Replace z-buffer picking with raytracing. 2019-08-24 14:37:25 +02:00
54fcb059b1 Bump version number 2019-08-24 11:11:51 +02:00
4f4c562a33 Add setting to disable the continue reading banner in the grid view 2019-08-11 11:47:14 +02:00
98a6ef5698 Initialize pointer and use less restrictive condition in destructor 2019-06-02 09:37:40 +02:00
5db5fb7e0c Fix crash when closing YACReader with an empty go to flow gl 2019-06-02 09:28:54 +02:00
c06e8c0fc6 Fix YACReaderPageFlowGL texture destruction 2019-06-01 16:13:29 +02:00
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +02:00
ca34e99ec4 Merge pull request #57 from vedgy/misc-code-fixes
Miscellaneous code fixes
2019-05-30 18:24:53 +02:00
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
caca3191f9 Flow: Remove glu dependency 2019-05-06 07:38:33 +02:00
d9d93c6481 gl flow: clean up includes 2019-05-05 11:17:45 +02:00
7bd04ca7d5 remove legacy flow implementation
We no longer support builds using the legacy flow.
2019-05-05 09:39:07 +02:00
14f1609ffa Merge pull request #43 from mytskine/fix-gcc8-warnings-develop
Fix gcc8 warnings
2019-04-19 16:56:56 +02:00
88f668d663 bugfix: 'switch case' for OpenVG had no 'break' 2019-04-03 20:44:57 +00:00
b2f44a939e fix misleading indentation of YACReaderFlowGL::remove 2019-04-01 11:25:16 +02:00
f87e113f89 fix misleading indentation of YACReaderFlowGL::setCurrentIndex 2019-04-01 11:25:16 +02:00
472e9f9832 reorder initialization of YACReaderFlowGL 2019-04-01 11:25:16 +02:00
9ace47ccc0 explicit parenthesis in complex comparison 2019-04-01 11:23:33 +02:00
8879e7abc5 Initialize parent class 2019-04-01 11:23:33 +02:00
4f7f760960 fix misleading indentation of ComicDB::toTXT 2019-04-01 11:23:33 +02:00
7b9502bd97 fix misleading indentation of PictureFlow::showSlide 2019-04-01 11:23:33 +02:00
fae244b4e3 typecast comparison in PictureFlow::showSlide 2019-04-01 11:23:33 +02:00
e084bdd447 cases missing in 'switch' in PictureFlow 2019-04-01 11:23:33 +02:00
0c02564fc5 cases missing in 'switch' in PictureFlow 2019-04-01 11:23:33 +02:00
f012a6d30e reorder initialization of PictureFlowState 2019-04-01 11:23:33 +02:00