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

Method updateLibrary

YACReaderLibraryServer/console_ui_library_creator.cpp:53–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void ConsoleUILibraryCreator::updateLibrary(const QString &path)
54{
55 QDir pathDir(path);
56 if (!pathDir.exists()) {
57 std::cout << "Directory not found." << std::endl;
58 return;
59 }
60
61 QEventLoop eventLoop;
62 LibraryCreator *libraryCreator = new LibraryCreator(settings);
63 QString cleanPath = QDir::cleanPath(pathDir.absolutePath());
64
65 libraryCreator->updateLibrary(cleanPath, LibraryPaths::libraryDataPath(cleanPath));
66
67 connect(libraryCreator, &LibraryCreator::finished, this, &ConsoleUILibraryCreator::done);
68 connect(libraryCreator, &LibraryCreator::comicAdded, this, &ConsoleUILibraryCreator::newComic);
69 connect(libraryCreator, &LibraryCreator::failedOpeningDB, this, &ConsoleUILibraryCreator::manageUpdatingError);
70
71 connect(libraryCreator, &LibraryCreator::finished, &eventLoop, &QEventLoop::quit);
72
73 std::cout << "Processing comics";
74
75 libraryCreator->start();
76 eventLoop.exec();
77}
78
79void ConsoleUILibraryCreator::addExistingLibrary(const QString &name, const QString &path)
80{

Callers 1

updateLibraryFunction · 0.45

Calls 2

startMethod · 0.80
execMethod · 0.80

Tested by

no test coverage detected