mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:58:56 +02:00
Review fixes
This commit is contained in:
parent
cd901f9e32
commit
e0e4ffb214
2 changed files with 7 additions and 4 deletions
|
@ -3517,6 +3517,7 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) {
|
||||||
surfaceContext->setContextProperty("About", AboutUtil::getInstance());
|
surfaceContext->setContextProperty("About", AboutUtil::getInstance());
|
||||||
surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); // Deprecated
|
surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); // Deprecated
|
||||||
surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data());
|
surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data());
|
||||||
|
surfaceContext->setContextProperty("ExternalResource", ExternalResource::getInstance());
|
||||||
|
|
||||||
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
|
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
|
||||||
surfaceContext->setContextProperty("Steam", new SteamScriptingInterface(engine, steamClient.get()));
|
surfaceContext->setContextProperty("Steam", new SteamScriptingInterface(engine, steamClient.get()));
|
||||||
|
@ -3631,6 +3632,8 @@ void Application::setupQmlSurface(QQmlContext* surfaceContext, bool setAdditiona
|
||||||
surfaceContext->setContextProperty("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data());
|
surfaceContext->setContextProperty("WalletScriptingInterface", DependencyManager::get<WalletScriptingInterface>().data());
|
||||||
surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data());
|
surfaceContext->setContextProperty("ResourceRequestObserver", DependencyManager::get<ResourceRequestObserver>().data());
|
||||||
surfaceContext->setContextProperty("PlatformInfo", PlatformInfoScriptingInterface::getInstance());
|
surfaceContext->setContextProperty("PlatformInfo", PlatformInfoScriptingInterface::getInstance());
|
||||||
|
surfaceContext->setContextProperty("ExternalResource", ExternalResource::getInstance());
|
||||||
|
|
||||||
// This `module` context property is blank for the QML scripting interface so that we don't get log errors when importing
|
// This `module` context property is blank for the QML scripting interface so that we don't get log errors when importing
|
||||||
// certain JS files from both scripts (in the JS context) and QML (in the QML context).
|
// certain JS files from both scripts (in the JS context) and QML (in the QML context).
|
||||||
surfaceContext->setContextProperty("module", "");
|
surfaceContext->setContextProperty("module", "");
|
||||||
|
@ -7539,7 +7542,7 @@ void Application::registerScriptEngineWithApplicationServices(const ScriptEngine
|
||||||
|
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("ExternalResource", ExternalResource::getInstance());
|
scriptEngine->registerGlobalObject("ExternalResource", ExternalResource::getInstance());
|
||||||
scriptEngine->registerEnum("ExternalResource.Bucket", QMetaEnum::fromType<ExternalResource::Bucket>());
|
scriptEngine->registerEnum("ExternalResource", QMetaEnum::fromType<ExternalResource::Bucket>());
|
||||||
|
|
||||||
registerInteractiveWindowMetaType(scriptEngine.data());
|
registerInteractiveWindowMetaType(scriptEngine.data());
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class ExternalResource : public QObject {
|
||||||
* @param relative_path The path of the resource within the bucket
|
* @param relative_path The path of the resource within the bucket
|
||||||
* @returns The resulting URL as a QUrl
|
* @returns The resulting URL as a QUrl
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QUrl getQUrl(Bucket bucket, const QUrl& relative_path);
|
QUrl getQUrl(Bucket bucket, const QUrl& relative_path);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,7 +89,7 @@ class ExternalResource : public QObject {
|
||||||
* @param relative_path The path of the resource within the bucket
|
* @param relative_path The path of the resource within the bucket
|
||||||
* @returns The resulting URL as a QUrl
|
* @returns The resulting URL as a QUrl
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QUrl getQUrl(Bucket bucket, QString path) {
|
QUrl getQUrl(Bucket bucket, QString path) {
|
||||||
return getQUrl(bucket, QUrl(path));
|
return getQUrl(bucket, QUrl(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class ExternalResource : public QObject {
|
||||||
* @param relative_path The path of the resource within the bucket
|
* @param relative_path The path of the resource within the bucket
|
||||||
* @returns The resulting URL as a QString
|
* @returns The resulting URL as a QString
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QString getUrl(Bucket bucket, const QUrl &relative_path) {
|
QString getUrl(Bucket bucket, const QUrl &relative_path) {
|
||||||
return ExternalResource::getQUrl(bucket, relative_path).toString();
|
return ExternalResource::getQUrl(bucket, relative_path).toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue