Added a script command to clear caches.

This commit is contained in:
NissimHadar 2018-04-08 10:32:35 -07:00
parent f610d6b201
commit 7f70511d1a
2 changed files with 9 additions and 0 deletions

View file

@ -156,3 +156,7 @@ void TestScriptingInterface::profileRange(const QString& name, QScriptValue fn)
fn.call();
}
void TestScriptingInterface::clearCaches() {
qApp->reloadResourceCaches();
}

View file

@ -78,6 +78,11 @@ public slots:
Q_INVOKABLE void profileRange(const QString& name, QScriptValue function);
/**jsdoc
* Clear all caches (menu command Reload Content)
*/
void clearCaches();
private:
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
};