mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 04:32:15 -04:00
Minor cleanup
This commit is contained in:
parent
43fde1640c
commit
dee1365327
@ -912,18 +912,16 @@ size_t ContentManager::handleNewZimFiles(const QString& dirPath, const QStringSe
|
|||||||
return countOfSuccessfullyAddedZims;
|
return countOfSuccessfullyAddedZims;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ContentManager::handleZimFileInMonitoredDir(QString dirPath, QString file)
|
int ContentManager::handleZimFileInMonitoredDir(QString dir, QString fileName)
|
||||||
{
|
{
|
||||||
const auto kiwixLib = mp_library->getKiwixLibrary();
|
const auto bookPath = QDir::toNativeSeparators(dir + "/" + fileName);
|
||||||
kiwix::Manager manager(kiwixLib);
|
kiwix::Manager manager(mp_library->getKiwixLibrary());
|
||||||
auto& zimsInDir = m_knownZimsInDir[dirPath];
|
|
||||||
const auto bookPath = QDir::toNativeSeparators(dirPath + "/" + file);
|
|
||||||
DBGOUT("directory monitoring: file appeared: " << bookPath);
|
DBGOUT("directory monitoring: file appeared: " << bookPath);
|
||||||
if ( mp_library->isBeingDownloadedByUs(bookPath) ) {
|
if ( mp_library->isBeingDownloadedByUs(bookPath) ) {
|
||||||
DBGOUT(" it is being downloaded by us, ignoring...");
|
DBGOUT(" it is being downloaded by us, ignoring...");
|
||||||
} else if ( manager.addBookFromPath(bookPath.toStdString()) ) {
|
} else if ( manager.addBookFromPath(bookPath.toStdString()) ) {
|
||||||
DBGOUT(" and was added to the library");
|
DBGOUT(" and was added to the library");
|
||||||
zimsInDir.insert(file);
|
m_knownZimsInDir[dir].insert(fileName);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
DBGOUT(" but could not be added to the library");
|
DBGOUT(" but could not be added to the library");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user