When the download of a book finishes while the cancel's dialog is opened
and then that the user confirms the deletion of the book, the app crashes
because aria2 can't find the active download (which is already complete).
Pause the download before opening the dialog and check the download's status
before cancel it avoid this crash.
Check if there is a library.xml file in the binary directory, in this case,
set the m_libraryPath with the current binary path, otherwise set with the
default data directory. This member variable is used every time we want to
change the library's content.
Re-use the connect with openCompletion method that works fine to handle mouse
click and enter key press to open article
Remove the openTitle method that is no longer usefull.
Check the available storage before the start of a download thanks to
QStorageInfo::bytesAvailable(), if the book size is bigger than this value
an alert message appears.
The buffers, where reply of a request is send, were deleted when they were about
to close but it makes the app crash, they have to be deleted when the request
object is deleted
add a div with the loading's animation. When the contentManager sends the
remote library's update's request, it emits a "true" displayLoadIcon signal
that remove the class "do-not-display" and it emits a "false" displayLoadIcon
signal when it has to display the local library.
Using Curl fct of the kiwix library is synchrone, so when the server accepts
the request but doesn't answer, the kiwix-desktop app is unresponsive.
To avoid that, this is a new architecture based on the Qt network request
management.
There is a new member in the contentmanager based on the new class
OpdsRequestManagerManager. It has two members : m_networkManager sends the
request and return a pointer stored in mp_reply which will receive the answer
of the request.
When the remote library has to be update, it calls
the doUpdate method. It checks if there already is a running request and
aborts it if yes. Then m_networkManager sends the
request and return a pointer stored in mp_reply which will receive the answer
of the request. The signal 'finished' of the mp_reply is connected to the slot
receiveContent. In this slot it checks if the signal 'finished' was emit
because of an abort, if not it reads and emit a signal bookChanged with the
content in parameter. This signal in connected in the ContentManager class
to the slot 'updateRemoteLibrary' which update the remote library member.