mirror of
https://github.com/JulianGro/overte.git
synced 2025-06-05 10:50:28 +02:00
Merge remote-tracking branch 'upstream/master' into script-retry-improvements
This commit is contained in:
commit
144983a943
3 changed files with 5 additions and 2 deletions
|
@ -55,7 +55,8 @@ void BatchLoader::start() {
|
||||||
// Use a proxy callback to handle the call and emit the signal in a thread-safe way.
|
// Use a proxy callback to handle the call and emit the signal in a thread-safe way.
|
||||||
// If BatchLoader is deleted before the callback is called, the subsequent "emit" call will not do
|
// If BatchLoader is deleted before the callback is called, the subsequent "emit" call will not do
|
||||||
// anything.
|
// anything.
|
||||||
ScriptCacheSignalProxy* proxy = new ScriptCacheSignalProxy(scriptCache.data());
|
ScriptCacheSignalProxy* proxy = new ScriptCacheSignalProxy();
|
||||||
|
connect(scriptCache.data(), &ScriptCache::destroyed, proxy, &ScriptCacheSignalProxy::deleteLater);
|
||||||
|
|
||||||
connect(proxy, &ScriptCacheSignalProxy::contentAvailable, this, [this](const QString& url, const QString& contents, bool isURL, bool success) {
|
connect(proxy, &ScriptCacheSignalProxy::contentAvailable, this, [this](const QString& url, const QString& contents, bool isURL, bool success) {
|
||||||
if (isURL && success) {
|
if (isURL && success) {
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
class ScriptCacheSignalProxy : public QObject {
|
class ScriptCacheSignalProxy : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ScriptCacheSignalProxy(QObject* parent) : QObject(parent) { }
|
|
||||||
void receivedContent(const QString& url, const QString& contents, bool isURL, bool success);
|
void receivedContent(const QString& url, const QString& contents, bool isURL, bool success);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -229,6 +229,9 @@ void ScriptCache::scriptContentAvailable() {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Dubious, but retained here because it matches the behavior before fixing the threading
|
// Dubious, but retained here because it matches the behavior before fixing the threading
|
||||||
|
|
||||||
|
allCallbacks = scriptRequest.scriptUsers;
|
||||||
|
|
||||||
scriptContent = _scriptCache[url];
|
scriptContent = _scriptCache[url];
|
||||||
finished = true;
|
finished = true;
|
||||||
qCWarning(scriptengine) << "Error loading script from URL " << url;
|
qCWarning(scriptengine) << "Error loading script from URL " << url;
|
||||||
|
|
Loading…
Reference in a new issue