mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 04:32:15 -04:00
Introduced ContentManager::getLibraryZims()
It is going to slightly evolve as the type of m_knownZimsInDir is enhanced to keep track of file modification times.
This commit is contained in:
parent
72bd099cd1
commit
076c19b645
@ -951,11 +951,16 @@ int ContentManager::handleZimFileInMonitoredDir(QString dir, QString fileName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContentManager::QStringSet ContentManager::getLibraryZims(QString dirPath) const
|
||||||
|
{
|
||||||
|
return m_knownZimsInDir[dirPath];
|
||||||
|
}
|
||||||
|
|
||||||
void ContentManager::updateLibraryFromDir(QString dirPath)
|
void ContentManager::updateLibraryFromDir(QString dirPath)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&m_updateFromDirMutex);
|
QMutexLocker locker(&m_updateFromDirMutex);
|
||||||
const QDir dir(dirPath);
|
const QDir dir(dirPath);
|
||||||
const QStringSet zimsPresentInLib = m_knownZimsInDir[dirPath];
|
const QStringSet zimsPresentInLib = getLibraryZims(dirPath);
|
||||||
|
|
||||||
QStringSet zimsInDir;
|
QStringSet zimsInDir;
|
||||||
for (const auto &file : dir.entryList({"*.zim"})) {
|
for (const auto &file : dir.entryList({"*.zim"})) {
|
||||||
|
@ -132,6 +132,7 @@ private: // functions
|
|||||||
void updateModel();
|
void updateModel();
|
||||||
void setCategories();
|
void setCategories();
|
||||||
void setLanguages();
|
void setLanguages();
|
||||||
|
QStringSet getLibraryZims(QString dirPath) const;
|
||||||
void asyncUpdateLibraryFromDir(QString dir);
|
void asyncUpdateLibraryFromDir(QString dir);
|
||||||
void updateLibraryFromDir(QString dir);
|
void updateLibraryFromDir(QString dir);
|
||||||
void handleDisappearedZimFiles(const QString& dirPath, const QStringSet& fileNames);
|
void handleDisappearedZimFiles(const QString& dirPath, const QStringSet& fileNames);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user