Library::updateFromDir() emits booksChanged() signal once per call

The purpose of LibraryManipulator defined in library.cpp was to emit the
booksChanged() signal for every book added to the library. In
Library::updateFromDir() we can do that once per call of that function.
This commit is contained in:
Veloman Yunkan 2024-07-26 12:42:59 +04:00 committed by Kelson
parent 1e8a181d1a
commit f38b7480f6

View File

@ -225,7 +225,7 @@ void Library::updateFromDir(QString monitorDir)
}
const QStringSet addedZims = newDirEntries - oldDirEntries;
const QStringSet removedZims = oldDirEntries - newDirEntries;
kiwix::Manager manager(LibraryManipulator(this));
kiwix::Manager manager(getKiwixLibrary());
bool needsRefresh = !removedZims.empty();
for (auto bookPath : addedZims) {
if ( isBeingDownloadedByUs(bookPath) ) {