switch to bool per CR feedback

This commit is contained in:
humbletim 2018-01-24 14:28:22 -05:00
parent 3ebf322fcf
commit e8f0df4363
2 changed files with 3 additions and 3 deletions

View file

@ -42,7 +42,7 @@ bool BaseAssetScriptingInterface::initializeCache() {
if (!assetClient()) {
return false; // not yet possible to initialize the cache
}
if (!_cacheDirectory.isEmpty()) {
if (_cacheReady) {
return true; // cache is ready
}
@ -51,7 +51,7 @@ bool BaseAssetScriptingInterface::initializeCache() {
Promise deferred = makePromise("BaseAssetScriptingInterface--queryCacheStatus");
deferred->then([this](QVariantMap result) {
_cacheDirectory = result.value("cacheDirectory").toString();
_cacheReady = !result.value("cacheDirectory").toString().isEmpty();
});
deferred->fail([](QString error) {
qDebug() << "BaseAssetScriptingInterface::queryCacheStatus ERROR" << QThread::currentThread() << error;

View file

@ -40,7 +40,7 @@ public slots:
QString hashDataHex(const QByteArray& data) { return hashData(data).toHex(); }
protected:
QString _cacheDirectory;
bool _cacheReady{ false };
bool initializeCache();
Promise getCacheStatus();
Promise queryCacheMeta(const QUrl& url);