1331 Commits

Author SHA1 Message Date
Veloman Yunkan
d089dced05 Eliminated indirect call to ContentManager::updateDownloadInfos()
Now ContentManager::updateDownloadInfos() is called directly by
ContentManager (rather than indirectly via ContentManagerModel).
2024-03-01 20:39:43 +04:00
Veloman Yunkan
b112c1b34c Bugfix: completed downloads are removed
The commit "Moved download deregistration to ContentManager" introduced
a bug - completed downloads were not properly deregistered.

Note that a simpler fix by adding a single `m_downloads.remove(bookId);`
line in `ContentManager::downloadCompleted()` didn't work (which means
that that function is not always called upon download completion). I am
not going to investigate that issue now, hoping that it will be
automatically resolved once the redesign of download management is
finished.
2024-03-01 20:39:43 +04:00
Veloman Yunkan
b288f287f2 Made DownloadState::update() a setter
DownloadState::update() no longer calls ContentManager::updateDownloadInfos()
2024-03-01 20:39:43 +04:00
Veloman Yunkan
a6359af1ab Merged ::DownloadInfo into DownloadState 2024-03-01 20:39:43 +04:00
Veloman Yunkan
8e3a783700 Got rid of the timer in DownloadState
Now there is a single timer in ContentManager shared by all pending downloads.
Temporarily, all active downloads are updated on every firing of the
timer and this happens in the main thread. This will be changed later.

The main objective of this change is to get rid of the timer in
DownloadState so that it can be converted to a dumb struct set by
ContentManager.
2024-03-01 20:39:43 +04:00
Veloman Yunkan
4ab2a89c03 Deleted an unused function 2024-03-01 20:39:43 +04:00
Veloman Yunkan
582dce0ced ContentManager::updateDownload() 2024-03-01 20:39:43 +04:00
Veloman Yunkan
d3c4361d60 Moved download deregistration to ContentManager 2024-03-01 20:39:43 +04:00
Veloman Yunkan
4842742e77 ContentManagerModel::removeDownload() 2024-03-01 20:39:43 +04:00
Veloman Yunkan
087881d510 Fixed download progress update for the first row 2024-03-01 20:39:43 +04:00
Veloman Yunkan
b53042edd5 Got rid of ContentManagerModel::startDownload()
Inlined ContentManagerModel::startDownload() into
ContentManager::downloadBook().
2024-03-01 20:39:43 +04:00
Veloman Yunkan
6ba6ad0ee8 ContentManager::startDownload() 2024-03-01 20:39:43 +04:00
Veloman Yunkan
4b773f4c1d Deleted a dubious piece of code
In theory, a book recorded in a local library may have only its url defined
(and no path to a ZIM file). Such a book qualifies as downloadable too.

That's why the call to `ContentManager::getRemoteOrLocalBook()` (which
may return a "local" book) perfectly makes sense in
`ContentManager::downloadBook()`.

However, it doesn't then make sense to raise an error if the returned
book turns out to be a "local" one. It would be more logical to request
only for a remote book and report an error if that operation fails.
2024-03-01 20:39:43 +04:00
Kelson
ef1489193e
Merge pull request #1044 from kiwix/maximum-dependency-version
Specify max dependence versions
2024-02-27 20:13:31 +01:00
Emmanuel Engelhart
1cc9dd1b88 Update dependences in deb 'control' 2024-02-27 20:13:22 +01:00
Emmanuel Engelhart
ae32843574 New libzim/libkiwix version reqs. in kiwix-desktop.pro 2024-02-27 20:13:22 +01:00
Matthieu Gautier
7d06bdc91b
Merge pull request #1041 from kiwix/refactoring 2024-02-26 14:02:37 +01:00
Veloman Yunkan
852fa7cdb7 Extracted checkEnoughStorageAvailable()
... mainly for readability.
2024-02-22 13:31:19 +04:00
Veloman Yunkan
7ec85ac2fb Introduced ContentManagerError 2024-02-22 13:31:19 +04:00
Veloman Yunkan
142e6fed58 Dropped unused return value 2024-02-22 13:31:19 +04:00
Veloman Yunkan
a31aec56f8 Extracted ContentManager::getRemoteOrLocalBook()
... mainly for readability.
2024-02-22 13:31:19 +04:00
Veloman Yunkan
c70ab0ed0d Unsplit download pause/resume operations
Download pause/resume operations are no longer split across
ContentManager and ContentManagerModel.
2024-02-22 13:31:19 +04:00
Veloman Yunkan
bd54da2cb2 Deleted obsolete/unused stuff from ContentManager 2024-02-22 13:31:19 +04:00
Veloman Yunkan
7db27fd576 Better grouped declaration of ContentManager 2024-02-22 13:31:19 +04:00
Veloman Yunkan
a1c60d8dbe Moved ownership of download state to ContentManager
ContentManagerModel depends on the current view settings (filters) much
more than ContentManager does. Since the download state (the set of
active and/or paused downloads and their progress info) is independent
of the view settings it is more natural for ContentManager to own it.
2024-02-22 13:31:19 +04:00
Veloman Yunkan
b0b592dfd8 Extracted ContentManager::downloadStarted() 2024-02-22 13:31:19 +04:00
Veloman Yunkan
2fbfe40c11 Extracted ContentManager::getDownloadInfo() 2024-02-22 13:31:19 +04:00
Veloman Yunkan
dd69a9d2bd ContentManager::DownloadInfo typedef 2024-02-22 13:31:19 +04:00
Veloman Yunkan
4f4c811711 Extracted ContentManager::downloadCancelled() 2024-02-22 13:31:19 +04:00
Veloman Yunkan
fecf83a061 Extracted ContentManager::downloadCompleted() 2024-02-22 13:31:19 +04:00
Veloman Yunkan
da1f06f9c8 Extracted getDownloadInfo() 2024-02-22 13:31:19 +04:00
Veloman Yunkan
a89e9b4799 Extracted downloadStatus2String() 2024-02-22 13:31:19 +04:00
Veloman Yunkan
17ac566b07
Merge pull request #1034 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2024-02-20 14:44:04 +04:00
translatewiki.net
11e6e6b3f5 Localisation updates from https://translatewiki.net. 2024-02-19 13:07:47 +01:00
Matthieu Gautier
cc159a2928
Merge pull request #1036 from kiwix/more_reliable_thumbnail_loading
More reliable loading of remote thumbnails
2024-02-14 12:00:08 +01:00
Veloman Yunkan
82e6cc48cd Using the book id as the thumbnail id
Since the content manager model may be updated (e.g. by applying a
filter) while the thumbnails/favicons are still being loaded it is
better to use a model invariant id for the thumbnails.
2024-02-07 19:08:43 +04:00
Veloman Yunkan
cf8b010ddc Simpler ThumbnailDownloader ctor 2024-02-07 19:08:43 +04:00
Veloman Yunkan
4cbc6ee422 Some renames in ThumbnailDownloader
Names should reflect the semantics rather than the anatomy.
2024-02-07 19:08:43 +04:00
Veloman Yunkan
b252033cc0 Deleted unused parameter 2024-02-07 19:08:43 +04:00
Veloman Yunkan
847c65baf1 typedefs in ThumbnailDownloader 2024-02-07 19:08:43 +04:00
Veloman Yunkan
535675afdb Fixed fetching of favicons from debug server
When using a debug server (enabled by the environment variables
KIWIX_CATALOG_HOST and KIWIX_CATALOG_PORT) the URLs of the favicons
must be composed correspondingly.
2024-02-07 19:08:43 +04:00
Matthieu Gautier
4914bb86eb
Merge pull request #1035 from kiwix/confirmbox_utils
Made it easier to display info and/or confirmation boxes
2024-02-07 14:41:54 +01:00
Veloman Yunkan
0f088697c6 Introduced showConfirmBox() 2024-02-06 15:14:58 +04:00
Veloman Yunkan
c07838806b Extracted ContentManager::reallyEraseBook() 2024-02-06 15:14:58 +04:00
Veloman Yunkan
c77004d925 Extracted openFileLocation() 2024-02-06 15:14:58 +04:00
Veloman Yunkan
188d5eabe9 Introduced showInfoBox() 2024-02-06 15:14:58 +04:00
Veloman Yunkan
ebf444690b
Merge pull request #1026 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2024-01-30 14:29:03 +04:00
translatewiki.net
a3a9e9b610 Localisation updates from https://translatewiki.net. 2024-01-29 13:09:37 +01:00
Matthieu Gautier
5b1a16caa0
Merge pull request #1027 from kiwix/ghaction
Use kiwix-build's github action to download dependencies.
2023-12-20 12:02:45 +01:00
Matthieu Gautier
205754b549 Use kiwix-build's github action to download dependencies. 2023-12-20 11:57:35 +01:00