Showing the changes to libraries/networking/src/BaseAssetScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -36,8 +36,6 @@ BaseAssetScriptingInterface::BaseAssetScriptingInterface(QObject* parent) : QObj · 35 unmodified lines | ||
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | bool BaseAssetScriptingInterface::initializeCache() { |
| 39 | − qDebug() << "BaseAssetScriptingInterface::getCacheStatus -- current values" << _cache.cacheDirectory() << _cache.cacheSize() << _cache.maximumCacheSize(); | |
| 40 | − | |
| 41 | 39 | // NOTE: *instances* of QNetworkDiskCache are not thread-safe -- however, different threads can effectively |
| 42 | 40 | // use the same underlying cache if configured with identical settings. Once AssetClient's disk cache settings |
| 43 | 41 | // become available we configure our instance to match. |
| @@ -50,29 +48,23 @@ bool BaseAssetScriptingInterface::initializeCache() { · 6 unmodified lines | ||
| 50 | 48 | } |
| 51 | 49 | |
| 52 | 50 | // attempt to initialize the cache |
| 53 | − qDebug() << "BaseAssetScriptingInterface::getCacheStatus -- invoking AssetClient::init" << assetClient().data(); | |
| 54 | 51 | QMetaObject::invokeMethod(assetClient().data(), "init"); |
| 55 | 52 | |
| 56 | − qDebug() << "BaseAssetScriptingInterface::getCacheStatus querying cache status" << QThread::currentThread(); | |
| 57 | 53 | Promise deferred = makePromise("BaseAssetScriptingInterface--queryCacheStatus"); |
| 58 | 54 | deferred->then([&](QVariantMap result) { |
| 59 | − qDebug() << "//queryCacheStatus" << QThread::currentThread(); | |
| 60 | 55 | auto cacheDirectory = result.value("cacheDirectory").toString(); |
| 61 | − auto cacheSize = result.value("cacheSize").toLongLong(); | |
| 62 | 56 | auto maximumCacheSize = result.value("maximumCacheSize").toLongLong(); |
| 63 | − qDebug() << "///queryCacheStatus" << cacheDirectory << cacheSize << maximumCacheSize; | |
| 64 | 57 | _cache.setCacheDirectory(cacheDirectory); |
| 65 | 58 | _cache.setMaximumCacheSize(maximumCacheSize); |
| 66 | 59 | }); |
| 67 | 60 | deferred->fail([&](QString error) { |
| 68 | − qDebug() << "//queryCacheStatus ERROR" << QThread::currentThread() << error; | |
| 61 | + qDebug() << "BaseAssetScriptingInterface::queryCacheStatus ERROR" << QThread::currentThread() << error; | |
| 69 | 62 | }); |
| 70 | 63 | assets->cacheInfoRequest(deferred); |
| 71 | 64 | return false; // cache is not ready yet |
| 72 | 65 | } |
| 73 | 66 | |
| 74 | 67 | QVariantMap BaseAssetScriptingInterface::getCacheStatus() { |
| 75 | − //assetClient()->cacheInfoRequest(this, "onCacheInfoResponse"); | |
| 76 | 68 | return { |
| 77 | 69 | { "cacheDirectory", _cache.cacheDirectory() }, |
| 78 | 70 | { "cacheSize", _cache.cacheSize() }, |
| @@ -104,7 +96,6 @@ QVariantMap BaseAssetScriptingInterface::queryCacheMeta(const QUrl& url) { · 25 unmodified lines | ||
| 104 | 96 | } |
| 105 | 97 | |
| 106 | 98 | QVariantMap BaseAssetScriptingInterface::loadFromCache(const QUrl& url) { |
| 107 | − qDebug() << "loadFromCache" << url; | |
| 108 | 99 | QVariantMap result = { |
| 109 | 100 | { "metadata", queryCacheMeta(url) }, |
| 110 | 101 | { "data", QByteArray() }, |
| @@ -112,7 +103,6 @@ QVariantMap BaseAssetScriptingInterface::loadFromCache(const QUrl& url) { · 1 unmodified line | ||
| 112 | 103 | // caller is responsible for the deletion of the ioDevice, hence the unique_ptr |
| 113 | 104 | if (auto ioDevice = std::unique_ptr<QIODevice>(_cache.data(url))) { |
| 114 | 105 | QByteArray data = ioDevice->readAll(); |
| 115 | − qCDebug(asset_client) << url.toDisplayString() << "loaded from disk cache (" << data.size() << " bytes)"; | |
| 116 | 106 | result["data"] = data; |
| 117 | 107 | } |
| 118 | 108 | return result; |
| @@ -170,7 +160,6 @@ Promise BaseAssetScriptingInterface::loadAsset(QString asset, bool decompress, Q · 51 unmodified lines | ||
| 170 | 160 | Q_ASSERT(thread() == QThread::currentThread()); |
| 171 | 161 | fetched->mixin(result); |
| 172 | 162 | if (decompress) { |
| 173 | − qDebug() << "loadAsset::decompressBytes..."; | |
| 174 | 163 | decompressBytes(result.value("data").toByteArray()) |
| 175 | 164 | ->mixin(result) |
| 176 | 165 | ->ready([=](QString error, QVariantMap result) { |
| @@ -182,7 +171,6 @@ Promise BaseAssetScriptingInterface::loadAsset(QString asset, bool decompress, Q · 5 unmodified lines | ||
| 182 | 171 | }); |
| 183 | 172 | |
| 184 | 173 | fetched->ready([=](QString error, QVariantMap result) { |
| 185 | − qDebug() << "loadAsset::fetched" << error; | |
| 186 | 174 | if (responseType == "arraybuffer") { |
| 187 | 175 | loaded->resolve(NoError, result); |
| 188 | 176 | } else { |
| @@ -268,7 +256,6 @@ Promise BaseAssetScriptingInterface::downloadBytes(QString hash) { · 79 unmodified lines | ||
| 268 | 256 | Promise deferred = makePromise(__FUNCTION__); |
| 269 | 257 | |
| 270 | 258 | QObject::connect(assetRequest, &AssetRequest::finished, assetRequest, [this, deferred](AssetRequest* request) { |
| 271 | − qDebug() << "...BaseAssetScriptingInterface::downloadBytes" << request->getErrorString(); | |
| 272 | 259 | // note: we are now on the "Resource Manager" thread |
| 273 | 260 | Q_ASSERT(QThread::currentThread() == request->thread()); |
| 274 | 261 | Q_ASSERT(request->getState() == AssetRequest::Finished); |
| @@ -287,7 +274,6 @@ Promise BaseAssetScriptingInterface::downloadBytes(QString hash) { · 12 unmodified lines | ||
| 287 | 274 | error = request->getError(); |
| 288 | 275 | result = { { "error", request->getError() } }; |
| 289 | 276 | } |
| 290 | − qDebug() << "//BaseAssetScriptingInterface::downloadBytes" << error << result.keys(); | |
| 291 | 277 | // forward thread-safe copies back to our thread |
| 292 | 278 | deferred->handle(error, result); |
| 293 | 279 | request->deleteLater(); |