1449 Commits

Author SHA1 Message Date
ShaopengLin
e84f60b2e7 Introduce Next/Previous Tab Buttions
Replaces TabBar scroller buttons
2024-09-16 07:53:32 -04:00
ShaopengLin
5667d0fd86 Group RTL Aware Action Def
Refactor to reduce repetition
2024-09-16 07:53:32 -04:00
ShaopengLin
925407f683 Hide Built-in Scroll Buttons
Buttons are un-scaled. Prepare for adding our own buttonsa
2024-09-16 07:53:32 -04:00
ShaopengLin
d675dd66f3 Fix ::tab:last Style Inheritance Faultiness
Style is being set to every QToolButton in tabbar
2024-09-16 07:53:32 -04:00
Kelson
ae4ba04093
Merge pull request #1212 from kiwix/Issue#1199-wrong-version
Corrected version for checkStateChanged
2024-09-15 12:28:11 +02:00
ShaopengLin
ae0e75de8c Corrected version for checkStateChanged
It is added since Qt 6.7.0
2024-09-14 18:45:51 -04:00
Kelson
19bcdb4943
Merge pull request #1205 from kiwix/feature/fix-deprecations
Resolve deprecations in Qt 6.8
2024-09-13 15:19:39 +02:00
sgourdas
159a996039 Remove text alignment on boomarks 2024-09-13 13:34:02 +03:00
sgourdas
ab5d4c890d Fix deprecation of qAsConst 2024-09-13 13:34:02 +03:00
sgourdas
9b014ccf66 Fix deprecation of CheckBox::stateChanged 2024-09-13 13:34:02 +03:00
Kelson
5b53f5e4b0
Merge pull request #1204 from kiwix/fix-upload-ppa
Fix error in tasks order for packaging CI
2024-09-10 11:11:39 +00:00
Emmanuel Engelhart
0646c135f1
Fix error in tasks order for packaging CI 2024-09-10 12:58:02 +02:00
Kelson
5e5bcdc9f5
Merge pull request #1179 from kiwix/feature/portable-kiwix
Implement portable mode
2024-09-10 09:58:52 +00:00
sgourdas
78a50cfe76 Use data directory in portable mode 2024-09-10 09:44:15 +00:00
sgourdas
380c3ae672 Fixed indentation and comments 2024-09-10 09:44:15 +00:00
Kelson
f383bea78c
Merge pull request #1187 from kiwix/Issue#594-search-bar-text-align
Fix Search Bar Cursor Alignment in RTL
2024-09-10 09:28:37 +00:00
ShaopengLin
3906888801 Fix SearchBar Placeholder Alignment in RTL
Align placeholder at leading position in line edit
2024-09-10 09:27:40 +00:00
ShaopengLin
05fcff0834 Fix SearchBar Cursor Alignment in RTL
The cursor was misaligned to the left in RTL.
2024-09-10 09:27:40 +00:00
Kelson
e47d224469
Merge pull request #1177 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2024-09-09 20:20:12 +00:00
translatewiki.net
3400c90186 Localisation updates from https://translatewiki.net. 2024-09-09 20:05:51 +00:00
Kelson
8e6d4eef96
Merge pull request #1202 from kiwix/update-package-ci-cd
Update CI/CD for deb packages
2024-09-09 19:59:19 +00:00
Emmanuel Engelhart
586a2108ab
Update CI/CD for deb packages 2024-09-09 21:50:54 +02:00
Kelson
a69db03aff
Merge pull request #1164 from kiwix/smarter_directory_monitoring
Smarter directory monitoring
2024-09-07 07:37:57 +00:00
Veloman Yunkan
c3a4164541 Debouncing of file updates in monitored dir
Now updates to ZIM files that failed to be added to the library upon
their appearance in a monitored dir are not handled immediately. Instead
they are debounced (deferred/delayed by 1 second) and processed only
after the file has been observed to be stable for some time (1 second as
of this commit).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
fdac248492 Directory monitoring ignores unchanged bad ZIMs
When a change to a monitored directory is detected, any bad ZIM files
in it (that could not be added to the library during the previous
update) are ignored unless their modification timestamp has changed.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
3dd58b3ae4 Fixed indentation 2024-09-07 07:37:21 +00:00
Veloman Yunkan
b7d9b5d855 Enter ContentManager::getMonitoredZimFileInfo()
At this point, the new function is just a stub.

Indentation is not fixed intentionally (in order to minimize the diff).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
9548c9b778 Directory monitoring tracks invalid ZIM files too
A ZIM file that failed to be added to the library isn't just
discarded by directory monitoring but is added to the set of known
ZIM files with a proper status. This enables to process updates to
such files more efficiently (coming next).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
bc05c75448 Added state to the tracked monitored files
Semantically, nothing changes at this point but the possibility for
an enhancement is now open.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
076c19b645 Introduced ContentManager::getLibraryZims()
It is going to slightly evolve as the type of m_knownZimsInDir is
enhanced to keep track of file modification times.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
72bd099cd1 fixup! Enter MonitoredZimFileInfo::ZimFileStatus 2024-09-07 07:37:21 +00:00
Veloman Yunkan
a43c53bf3d Enter MonitoredZimFileInfo::ZimFileStatus
At this point the new enum serves mainly for separating logging
from the logic. But it enables to enhance the logic with more
elaborate handling.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
dee1365327 Minor cleanup 2024-09-07 07:37:21 +00:00
Veloman Yunkan
43fde1640c Fixed indentation 2024-09-07 07:37:21 +00:00
Veloman Yunkan
2df3e2db0b ContentManager::handleZimFileInMonitoredDir()
Indentation is intentionally not fixed (to keep the diff minimal).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
26b4430199 Made ContentManager::asyncUpdateLibraryFromDir() private 2024-09-07 07:37:21 +00:00
Veloman Yunkan
258ed4b913 Clearing of ContentManager::m_knownZimsInDir 2024-09-07 07:37:21 +00:00
Veloman Yunkan
2cd272cd4f Got rid of ContentManager::setMonitorDirZims() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
595d77b832 Moved ContentManager::setMonitoredDirectories() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
b33fc63c93 Fully transferred directory monitoring to ContentManager
ContentManager::setMonitoredDirectories() stays in kiwixapp.cpp to make
the diff easier to understand.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
615c21db50 KiwixApp::setMonitoredDirectories()
Extracted a new function that will next be transferred to ContentManager
along with KiwixApp::m_watcher.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
5f4fcd550c Changed how the list of known ZIM files is updated
Directory monitoring updates the list of known ZIM
files as entries are being added to or removed from the library.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
354a4d1f8a Directory monitoring works via file names instead of paths
- ContentManager::m_knownZimFiles[dirPath] now stores filenames (rather
  than full paths) of known ZIM files in directory at dirPath.

- Library::getLibraryZimsFromDir() returns a set of file names (rather
  than paths)

Note that the change of the semantics of ContentManager::m_knownZimFiles
has been carried out via the change in the value of the second argument
of ContentManager::setMonitorDirZims():

1. In KiwixApp::setupDirectoryMonitoring() the latter is fed with the
   output of (the now changed) Library::getLibraryZimsFromDir()

2. In ContentManager::updateLibraryFromDir() all variables representing
   a set of files now contain filenames only (note that
   ContentManager::handleNewZimFiles() returns just a subset of its second
   parameter) and therefore produce a set of filenames.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
743400fa1a Problematic ZIM files keep being monitored
Before this change, once a ZIM file was detected in a monitored
directory it could slip into the known ZIM file list even if it was
a partially downloaded ZIM file that failed to be added to the library.
This happens when another valid/healthy ZIM file is added to the
monitored directory or a known ZIM file is removed from it (the bad
ZIM file is included in the update triggered by the other ZIM file).

Now ZIM files that failed to be added to the library are NOT inserted
in the list of known ZIM files and thus will be reevaluated for every
change in the monitored directory. Thus a file being downloaded by an
external tool will eventually be successfully added to the library
(since updates to the file should trigger an update to the directory due
to the changed modification time of the file).

This however may result in excessive CPU usage in the following
scenario. Suppose that there are a number of partially downloaded files.
Only one of them is being downloaded, while the others are paused. Every
time the next chunk of data is written to that active file, directory
monitoring will try to add *all of* those partial ZIM files.

There are two optimizations against such waste of CPU cycles:

1. Only try to add those files that had their modification
   time changed since the previous attempt.

2. Debounce the updates (react to updates, for example, at most once per
   second).

Those optimizations will come next.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
fc7570a49c Renamed a few vars in ContentManager::updateLibraryFromDir() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
d5d5987fc1 ContentManager::handleNewZimFiles() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
af18f5826c fixup! ContentManager::handleDisappearedZimFiles() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
c912fe9d34 ContentManager::handleDisappearedZimFiles() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
40f00901e1 More debugging info from directory monitoring 2024-09-07 07:37:21 +00:00
Veloman Yunkan
1ea6ffd20a fixup! Introduced DBGOUT() 2024-09-07 07:37:21 +00:00