MCPcopy Create free account
hub / github.com/YACReader/yacreader / create

Method create

YACReaderLibrary/library_creator.cpp:322–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320}
321
322void LibraryCreator::create(QDir dir)
323{
324 dir.setNameFilters(_nameFilter);
325 dir.setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
326 QFileInfoList list = dir.entryInfoList();
327 for (int i = 0; i < list.size(); ++i) {
328 if (stopRunning)
329 return;
330 QFileInfo fileInfo = list.at(i);
331 QString fileName = fileInfo.fileName();
332#ifdef Q_OS_MACOS
333 QStringList src = _source.split("/");
334 QString filePath = fileInfo.absoluteFilePath();
335 QStringList fp = filePath.split("/");
336 for (int i = 0; i < src.count(); i++) {
337 fp.removeFirst();
338 }
339 QString relativePath = "/" + fp.join("/");
340#else
341 QString relativePath = QDir::cleanPath(fileInfo.absoluteFilePath()).remove(_source);
342#endif
343 if (fileInfo.isDir()) {
344 QLOG_TRACE() << "Parsing folder" << fileInfo.canonicalPath();
345 // se añade al path actual el folder, aún no se sabe si habrá que añadirlo a la base de datos
346 _currentPathFolders.append(Folder(fileInfo.fileName(), relativePath));
347 create(QDir(fileInfo.absoluteFilePath()));
348 // una vez importada la información del folder, se retira del path actual ya que no volverá a ser visitado
349 _currentPathFolders.pop_back();
350 } else {
351 QLOG_TRACE() << "Parsing file" << fileInfo.filePath();
352 insertComic(relativePath, fileInfo);
353 }
354 }
355}
356
357bool LibraryCreator::checkCover(const QString &hash)
358{

Callers

nothing calls this directly

Calls 6

setFilterMethod · 0.80
splitMethod · 0.80
joinMethod · 0.80
FolderClass · 0.70
removeMethod · 0.45
isDirMethod · 0.45

Tested by

no test coverage detected