Commit Graph

2450 Commits

Author SHA1 Message Date
Luis Ángel San Martín
4739376f5b Use new methods 2020-09-07 18:13:55 +02:00
Luis Ángel San Martín
6738827798 Add methods to access ENLARGE_IMAGES setting 2020-09-07 18:13:43 +02:00
Luis Ángel San Martín
c490b70b68 Move declaration to the viewer group 2020-09-07 18:13:06 +02:00
Felix Kauselmann
acce89ef78
Update viewer.cpp 2020-09-07 08:54:23 +02:00
Felix Kauselmann
3342fef1cb
Update CHANGELOG.md 2020-09-03 18:10:43 +02:00
Luis Ángel San Martín
bb09be3d6a Bump version number 2020-09-03 18:05:05 +02:00
Luis Ángel San Martín
802e0d32ce Fix trying to scale images on null images 2020-09-03 18:00:29 +02:00
Luis Ángel San Martín
4234dedece
Merge pull request #158 from selmf/feature/better_doublepage
Reader: Add option to show covers as single pages in double page mode
2020-09-03 17:46:08 +02:00
Felix Kauselmann
5bb6ab276a Reader: Add option to show covers as single pages in double page mode 2020-09-03 15:32:45 +02:00
Luis Ángel San Martín
ce90796aed
Merge pull request #157 from selmf/feature/overscale
Reader: Add option to stop enlarging images in fit to width and height
2020-09-02 22:28:12 +02:00
Felix Kauselmann
232181eef7 Reader: Add option to stop enlarging images in fit to width and height 2020-09-02 09:27:53 +02:00
Luis Ángel San Martín
5f0889f332 Format 2020-08-31 16:19:42 +02:00
Luis Ángel San Martín
fb60208c88 Print diff to know the format problems 2020-08-31 16:15:43 +02:00
Luis Ángel San Martín
a2b4b88801 Format 2020-08-31 16:04:26 +02:00
Igor Kushnir
04140bef0b Remove an unnecessary indirection in ComicFlow
The timer pointer forced error-prone manual memory management without
any benefits.
2020-08-31 15:45:12 +02:00
Igor Kushnir
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
Igor Kushnir
0da59285cf Reader: fix QTimer-related memory leaks 2020-08-31 15:44:50 +02:00
Igor Kushnir
b0082101d3 Reader: don't forget comic info visibility
The timer used to time out and invoke Viewer::informationSwitch() twice
before getting destroyed. This caused the following bug:
    1. Press 'I' to Show Info in YACReader.
    2. Restart YACReader (exit and run again). Info is visible.
    3. Restart YACReader one more time. Info is hidden.

Apparently, when informationSwitch() was called a second time soon after
the first one, informationLabel didn't hide for some reason, but the
wrong value (false) was stored at the SHOW_INFO key in Configuration.
2020-08-31 15:44:50 +02:00
Luis Ángel San Martín
1ce873dd63
Merge pull request #156 from selmf/feature/server_port
Headless server: Add support for setting a port from commandline
2020-08-31 15:05:50 +02:00
Felix Kauselmann
4a654c38c0 Headless server: Add support for setting a port from commandline
Manual editing of a config file for setting a port is not ideal.
Solution: add a set-port command to save a port and also a
--port option to allow setting a temporary port during startup
2020-08-29 18:21:06 +02:00
Luis Ángel San Martín
fef734d132
Merge pull request #155 from YACReader/bidirectional_sync_support
Bidirectional sync support
2020-08-25 23:23:41 +02:00
Luis Ángel San Martín
b64ea19e8b Use an invalid QVariant to set to NULL a value in the DB
nullptr causes troubles in some platforms/compiles
2020-08-25 19:45:05 +02:00
Luis Ángel San Martín
f11a757141 Code format
I had to update clang-format
2020-08-25 19:13:43 +02:00
Luis Ángel San Martín
8a99e35cf6 Update CHANGELOG 2020-08-25 19:04:43 +02:00
Luis Ángel San Martín
5bc3ad5014 Send back more recent comic status to the client on sync 2020-08-25 19:03:00 +02:00
Luis Ángel San Martín
2b780e23a4 Make updateFromRemoteClient return more updated comics
So they can be sent back to the client.
2020-08-25 19:01:43 +02:00
Luis Ángel San Martín
fe15bc2ba8 Include "last_time_opened" in JSON serialization 2020-08-25 19:01:03 +02:00
Luis Ángel San Martín
c84fc20419 Reset last time opened when setting a comic as unread 2020-08-25 19:00:21 +02:00
Luis Ángel San Martín
30fd5491a4
Merge pull request #154 from selmf/database_leaks
Fix object leaks in database code
2020-08-25 18:57:54 +02:00
Felix Kauselmann
4b3042def4 Fix object leaks in database code
Qt's database and query model requires that both the queries and the database
objects are out of scope before a database connection can safely be removed.

Solution: Properly encapsulate databases and queries in "{ }" and use a string
to cache the connection name for out-of-scope removal.
2020-08-25 17:34:46 +02:00
Felix Kauselmann
48a0d64837 Add QtWebApp to third party readme 2020-08-20 18:22:57 +02:00
Felix Kauselmann
1b344d70e5 Update server code integration for QtWebApp 1.7.11
- Adapt server code for QtWebapp namespace 'stefanfrings'
- Implement custom modifications needed by v1 controller
  via template engine
- Unify iphone and ipad templates
2020-08-20 18:22:57 +02:00
Felix Kauselmann
f8a00605c5 Remove unused QtWebApp logging code
We're using QsLog, so there is no need for another logger.
2020-08-20 18:22:57 +02:00
Felix Kauselmann
b9c48cc4b6 Update QtWebapp to 1.7.11 2020-08-20 18:22:57 +02:00
Felix Kauselmann
3de099491f Move QtWebApp sources to third_party 2020-08-20 18:22:57 +02:00
Felix Kauselmann
fc8c1080da Add a message handler
This ensures that Qt debug messages actually end up in our logfiles,
even if we didn't use QsLog to create them.
2020-08-20 17:41:56 +02:00
Felix Kauselmann
56e6f8fdcc Allow setting YACReader loglevel from console 2020-08-20 17:41:56 +02:00
Felix Kauselmann
ac4d2f4804 Fix QsLog integration in reader too. 2020-08-20 17:41:56 +02:00
Felix Kauselmann
2f9db87f9b Document QsLog update 2020-08-20 17:41:56 +02:00
Felix Kauselmann
1af613663c Fix QsLog setup in Library and LibraryServer
The calls changed, so we need to adapt them.
2020-08-20 17:41:56 +02:00
Felix Kauselmann
1568a5f253 Update QsLog to 2.1 snapshot 46b643d5bcbc 2020-08-20 17:41:56 +02:00
Felix Kauselmann
c13ec618d0 Move QsLog to third_party directory 2020-08-20 17:41:56 +02:00
Felix Kauselmann
b9acd13120
Fix code format errors due to changes in default coding style. (#150) 2020-07-24 21:17:49 +02:00
Felix Kauselmann
41ccef1060
Fix possible memleaks occuring when passing nonexistent dirs to console library creator. (#132) 2020-07-02 20:28:53 +02:00
Daniel Dennerkrans
868843df37
fix spelling error in readme.md (#142) 2020-07-02 20:23:44 +02:00
Luis Ángel San Martín
092611f0cd Send read status for imported comics 2020-05-09 22:19:00 +02:00
Felix Kauselmann
75e71a434c
Add badges for our Azure CI jobs. (#131)
* Add badges for our Azure CI jobs.
2020-04-14 10:22:51 +02:00
Luis Ángel San Martín
e6bc8f38a0
Merge pull request #106 from selmf/export-ignore-update
Update export-ignore
2020-04-11 22:02:00 +02:00
Felix Kauselmann
45899b6835 Exclude openssl an 7zip from git export so they don't pollute our source tarballs 2020-04-11 21:26:19 +02:00
Luis Ángel San Martín
60441c3c4a
Merge pull request #130 from YACReader/fix/skip_macos_sign_on_prs
Skip macos sign on PRs
2020-04-11 20:29:56 +02:00