From d72c6954174ac2469d4b4324bc9739b4854b84fd Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Fri, 1 Apr 2016 16:21:32 -0700 Subject: [PATCH] Sanitize ResourceCache to expose to JS/QML fix sanitize --- interface/src/Application.cpp | 5 ++--- libraries/networking/src/ResourceCache.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bd1a44fc76..f11fd22e2f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -588,9 +588,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : // Model background downloads need to happen on the Datagram Processor Thread. The idle loop will // emit checkBackgroundDownloads to cause the ModelCache to check it's queue for requested background // downloads. - QSharedPointer modelCacheP = DependencyManager::get(); - ResourceCache* modelCache = modelCacheP.data(); - connect(this, &Application::checkBackgroundDownloads, modelCache, &ResourceCache::checkAsynchronousGets); + auto modelCache = DependencyManager::get(); + connect(this, &Application::checkBackgroundDownloads, modelCache.data(), &ModelCache::checkAsynchronousGets); // put the audio processing on a separate thread QThread* audioThread = new QThread(); diff --git a/libraries/networking/src/ResourceCache.h b/libraries/networking/src/ResourceCache.h index f674c96a1e..10f0289052 100644 --- a/libraries/networking/src/ResourceCache.h +++ b/libraries/networking/src/ResourceCache.h @@ -109,7 +109,7 @@ protected: /// \param fallback a fallback URL to load if the desired one is unavailable /// \param delayLoad if true, don't load the resource immediately; wait until load is first requested /// \param extra extra data to pass to the creator, if appropriate - Q_INVOKABLE QSharedPointer getResource(const QUrl& url, const QUrl& fallback = QUrl(), + QSharedPointer getResource(const QUrl& url, const QUrl& fallback = QUrl(), bool delayLoad = false, void* extra = NULL); /// Creates a new resource. @@ -123,7 +123,7 @@ protected: /// Attempt to load a resource if requests are below the limit, otherwise queue the resource for loading /// \return true if the resource began loading, otherwise false if the resource is in the pending queue - Q_INVOKABLE static bool attemptRequest(Resource* resource); + static bool attemptRequest(Resource* resource); static void requestCompleted(Resource* resource); static bool attemptHighestPriorityRequest();