Пример #1
0
bool XpiksTestsApp::addDirectoriesForTest(const QList<QUrl> &urls) {
    SignalWaiter waiter;
    QObject::connect(&m_MetadataIOCoordinator, &MetadataIO::MetadataIOCoordinator::metadataReadingFinished,
                     &waiter, &SignalWaiter::finished);

    int addedCount = addDirectories(urls);
    LOG_INFO << "Added" << addedCount << "files";
    bool success = doContinueReading(waiter);
    return success;
}
Пример #2
0
bool CacheManager::addEmptyEntry(const std::string& name) {
    if (entryExists(name)) {
        return false;
    }

    std::unique_ptr<CacheData> cd(new CacheData);
    cd->createEmpty(name, entry_counter_++);

    cache_map_[name] = std::move(cd);

    addDirectories(name);

    return true;
}
Пример #3
0
bool CacheManager::addFileContents(const std::string& name,
                                   const std::string& path) {
    if (entryExists(name)) {
        return false;
    }

    std::unique_ptr<CacheData> cd(new CacheData);

    if (!cd->loadFromFile(name, entry_counter_++, path)) {
        return false;
    }

    cache_map_[name] = std::move(cd);

    addDirectories(name);

    return true;
}