Commit Graph

1051 Commits

Author SHA1 Message Date
0f6b203d34 Embrace HTML coming from Comic Vine 2021-03-06 09:05:35 +01:00
51a9c72d05 Replace QtScript with QJson*
QtScript is deprecated and this was needed to start supporting Qt6
2021-02-27 12:02:57 +01:00
6f182b2bb3 Extract CONFIG += c++11 into common config.pri 2021-02-18 19:49:43 +01:00
0f372a001e Library: update toolbar title on history navigation
When Back or Forward action was triggered, the toolbar title was not
updated to match the reselected entry.

I am calling LibraryWindow::setToolbarTitle() from
selectedIndexFromHistory() rather than loadIndexFromHistory(), because
the latter is also called from
YACReaderNavigationController::loadPreviousStatus(), which in turn is
called only from LibraryWindow::setSearchFilter() when the search line
text becomes empty. The toolbar title is already correct and does not
have to be updated in this case.

My code analysis and experiments have revealed that YACReader code never
creates YACReaderLibrarySourceContainer objects of type None. This type
could be removed altogether along with YACReaderLibrarySourceContainer's
default constructor, but for Q_DECLARE_METATYPE macro's requirement. So
YACReaderNavigationController::loadIndexFromHistory() now simply prints
an error message instead of introducing a failure condition by returning
false when the type is None.
2021-02-14 19:07:37 +02:00
b55c442590 Add missing import
It fixes compilation with some compilers
2021-02-08 08:38:15 +01:00
aa9dd95d5d LibraryWindow: remove a duplicate signal-slot connection
QSqlDatabase::commit() in ComicModel::finishTransaction() returned false
(failed) when this slot was invoked the second time in a row.
2021-02-07 20:16:20 +02:00
5257dc88d6 Library: destroy the temporary thread when deleting finishes
finished() signal of both FoldersRemover and ComicsRemover was not
connected to their QThread's quit() slot. So the thread kept running
after the deletion completed. The QThread's parent is LibraryWindow.
Thus LibraryWindow's ~QObject() invokes the QThread's destructor.

As a result, when the user exited YACReader Library after deleting at
least one folder or comic, it printed the following FATAL message and
crashed at exit: "QThread: Destroyed while thread is still running".

Extract signal-slot connections between a remover and a QThread into
moveAndConnectRemoverToThread() to reduce code duplication.

Remove always true (thread != NULL) checks.
2021-02-07 19:46:15 +02:00
5656c3f540 Make ComicQueryResultProcessor::modelData() static
The function doesn't use data members or other member functions. It
could even be put into an unnamed namespace in the cpp file, but that
would require more changes and complicate turning it back into a member
function if need be in the future.
2021-02-06 20:08:47 +02:00
12c2ff027a ComicQueryResultProcessor: fix a typo in the class name 2021-02-06 20:08:44 +02:00
3a9bec55f8 Library: don't print errors when search edit's text changes
This was a temporary debug output. Not useful anymore.
2021-02-05 09:34:13 +01:00
6d5f3d7de3 Use the query search queue in FolderQueryResultProcessor 2021-02-04 19:15:58 +01:00
64d0e22fb5 Library: don't leak folderQueryResultProcessor at exit
FolderQueryResultProcessor has a ConcurrentQueue data member. The leak
meant that the thread was not joined before exit.
2021-02-04 17:58:33 +02:00
f88af80379 Library: fix InfoComicsView crashes
InfoComicsView constructor is the only function that connects to
FlowView's currentCoverChanged signal. Neither of the slots connected to
this signal handles the argument value index==-1. So when FlowView emits
this signal with index==-1, YACReaderLibrary crashes. Returning early
from either ComicsView::updateInfoForIndex() or
InfoComicsView::setCurrentIndex() when index==-1 is not sufficient - the
crash happens in the other slot then. Let us skip emitting the signal in
FlowView if index==-1 rather than return early from both slots.

Steps to reproduce 1:
1. Launch YACReaderLibrary version that matches the version of the
default library database. Alternatively, select a compatible library
after starting the application.
2. If InfoComicsView is not active, switch to it.
3. (optional) Switch to another comics view out of InfoComicsView.
4. Quit YACReaderLibrary. The application crashes during exit - after
the "YACReaderLibrary closed with exit code : 0" message is printed.

Steps to reproduce 2:
1. Launch a YACReaderLibrary version newer than the version of the
default library database.
2. Click the "No" button in the "Update needed" dialog that pops up.
3. Change between comics views until InfoComicsView becomes active. If
this view was active at the beginning, switch through all the views to
get back to it. At this point YACReaderLibrary crashes.
2021-02-01 11:27:18 +02:00
f4b2b3d8e3 Update comments 2021-01-28 19:56:35 +01:00
d96d01d963 Fix launch sequence to avoid http port collisions 2021-01-25 15:48:15 +01:00
74840f9914 Enable SVG explicitly 2021-01-22 10:48:13 +01:00
58fdf0af23 Add what's new dialog 2021-01-21 21:39:22 +01:00
3f6c44ce7a Fix SQL update query for setting manga in all the comics in a folder 2021-01-17 14:05:14 +01:00
20c772797b Fix typo 2021-01-16 18:59:53 +01:00
6461a4014e Add actions for setting folders as manga/normal 2021-01-16 18:31:48 +01:00
d402999991 Set all new imported comics and folders as manga if the parent folder is manga 2021-01-16 18:31:13 +01:00
60de69635b Get/set new manga field from/to the db 2021-01-16 18:30:25 +01:00
f7fa4adbd0 Add manga field to folders too
This way we can tell the app that a folder contains mangas so the user doesn't have to constantly set comics as manga when new issues are added. And it should be easier to set all the content in a folder as manga from the folder tree.
2021-01-16 18:29:22 +01:00
9643274b39 Enable manga in the search engine 2021-01-16 14:26:37 +01:00
bc82078ec9 Add new manga field to the edit comic dialog 2021-01-16 14:26:07 +01:00
97c7723b17 Add support for setting issues as manga/normal in the comics view 2021-01-16 14:25:47 +01:00
52953633e5 Send manga field through the server 2021-01-16 14:24:14 +01:00
3ab05c6777 Add a new boolean field for tagging comics as manga 2021-01-16 14:23:59 +01:00
76a307d0d8 Remove comments 2021-01-14 19:11:25 +01:00
6bb64c5467 Import non-gui global header 2021-01-14 18:42:51 +01:00
24c0a783de Remove reference to lexertl's license 2021-01-14 18:42:21 +01:00
82eb5c0a8b Add fallback for qt < 5.15 2021-01-14 15:51:20 +01:00
f03ad848cb Add support for true and false literals to be used with bool fields
The lexer itself should be responsible for parsing those values but it will require a bigger refactoring.
2021-01-14 15:32:20 +01:00
f803b54f2e Add support for boolean folder fields 2021-01-14 12:25:24 +01:00
dde60b78ea YACReaderLibrary compiles using c++11 just fine
It is probably worth to bump this to c++14 and ideally use c++17, but it will be done in a separate branch.
2021-01-14 11:38:45 +01:00
5343d24f26 Run folder search filtering in the background
It uses the same approach used by the comics search filter
2021-01-14 11:37:17 +01:00
ccc382df7d Use ComicQueryResultProcesor 2021-01-14 09:17:18 +01:00
dbdc7bd965 Add a class for processing search queries and create the comics model data 2021-01-14 09:10:58 +01:00
fa5ce25425 Add concurrent queue based on lambdas 2021-01-14 09:03:17 +01:00
7b36100458 Use QString::fromStdString
Just to keep things consistent in the whole round trip conversion
2021-01-14 08:51:08 +01:00
260f538de3 Use an explicit constructor for TreeNode
List initialization ended using movable constructors which surprisingly caused data troubles in release mode, at least in VC2019 compiler. The tree being messed up caused crashes while SQL was generated.

I have no explanation for it.
2021-01-14 08:49:48 +01:00
f09c5955d8 Remove space and atWord tokens
`atWord` wasn't used at all and spaces should be eaten by the lexer

And added `unspecified` token
2021-01-14 08:39:16 +01:00
ddb140d430 Remove misplaced code 2021-01-12 18:57:25 +01:00
a777aa3fe8 Replace lexertl with a custom lexeter implementation
QueryLexeter does not parse "atWord" because I couldn't find what it is used for.
2021-01-12 18:56:59 +01:00
5037f3ac92 Fix data base removal in FolderModel 2021-01-12 18:41:57 +01:00
6438c9210f Move query execution and model setup to the right scope 2021-01-12 18:41:09 +01:00
255e51da86 Fix binding values to search query
This was broken while doing a rebase
2021-01-08 16:59:17 +01:00
8efb9912ee Use concatenation, rather than ostringstream 2021-01-08 15:56:16 +01:00
4990093e3d Remove c++17 dependency 2021-01-08 15:56:16 +01:00
2d3888b4b4 Fix scopes 2021-01-08 15:56:13 +01:00