| 156 | } |
| 157 | |
| 158 | void LibrariesUpdateCoordinator::updateLibrary(const QString &path) |
| 159 | { |
| 160 | QDir pathDir(path); |
| 161 | if (!pathDir.exists()) { |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | QEventLoop eventLoop; |
| 166 | auto libraryCreator = new LibraryCreator(settings); |
| 167 | std::shared_ptr<LibraryCreator> sharedPtr(libraryCreator); |
| 168 | currentLibraryCreator = sharedPtr; |
| 169 | |
| 170 | QString cleanPath = QDir::cleanPath(pathDir.absolutePath()); |
| 171 | |
| 172 | libraryCreator->updateLibrary(cleanPath, LibraryPaths::libraryDataPath(cleanPath)); |
| 173 | |
| 174 | connect(libraryCreator, &LibraryCreator::finished, &eventLoop, &QEventLoop::quit); |
| 175 | |
| 176 | libraryCreator->start(); |
| 177 | eventLoop.exec(); |
| 178 | } |
| 179 | |
| 180 | void LibrariesUpdateCoordinator::stop() |
| 181 | { |