match requested hash key url when populating batch-loaded script contents

This commit is contained in:
humbletim 2016-11-01 11:46:09 -04:00
parent a79541a83a
commit f9747d8a44

View file

@ -44,7 +44,6 @@ void BatchLoader::start() {
return;
}
for (const auto& rawURL : _urls) {
QUrl url = expandScriptUrl(normalizeScriptURL(rawURL));
@ -57,12 +56,12 @@ void BatchLoader::start() {
// anything.
ScriptCacheSignalProxy* proxy = new ScriptCacheSignalProxy(scriptCache.data());
connect(proxy, &ScriptCacheSignalProxy::contentAvailable, this, [this](const QString& url, const QString& contents, bool isURL, bool success) {
connect(proxy, &ScriptCacheSignalProxy::contentAvailable, this, [this, rawURL](const QString& url, const QString& contents, bool isURL, bool success) {
if (isURL && success) {
_data.insert(url, contents);
_data.insert(rawURL, contents);
qCDebug(scriptengine) << "Loaded: " << url;
} else {
_data.insert(url, QString());
_data.insert(rawURL, QString());
qCDebug(scriptengine) << "Could not load: " << url;
}