Skip to content

Commit

Permalink
Enter ContentManager::handleDisappearedZimFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan committed Jul 22, 2024
1 parent 9b9a2c8 commit 000e918
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/contentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ void ContentManager::updateLibraryFromDir(QString monitorDir)
// qDebug() << "DBG: ContentManager::updateLibraryFromDir(): "
// << "file disappeared: " << bookPath;
const auto book = kiwixLib->getBookByPath(bookPath.toStdString());
mp_library->removeBookFromLibraryById(QString::fromStdString(book.getId()));
handleDisappearedZimFile(QString::fromStdString(book.getId()));
} catch (...) {}
}
for (auto bookPath : addedZims) {
Expand All @@ -903,3 +903,8 @@ void ContentManager::updateLibraryFromDir(QString monitorDir)
setMonitorDirZims(monitorDir, newDirEntries);
}
}

void ContentManager::handleDisappearedZimFile(QString bookId)
{
mp_library->removeBookFromLibraryById(bookId);
}
1 change: 1 addition & 0 deletions src/contentmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public slots:
void setCategories();
void setLanguages();
void updateLibraryFromDir(QString dir);
void handleDisappearedZimFile(QString bookId);

// Get the book with the specified id from
// the remote or local library (in that order).
Expand Down

0 comments on commit 000e918

Please sign in to comment.