History

Type registeration fixes for scripting engine

ksuprynowicz committed 4 years ago

Commit 0a3ec921 parent 50a6a6334 files · +266 −67Browse files

Showing the changes to interface/src/scripting/AccountServicesScriptingInterface.cpp (1 of 34 files). Show all

Unified · Split

interface/src/scripting/AccountServicesScriptingInterface.cpp+9−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 //
55 // Created by Thijs Wenker on 9/10/14.
66 // Copyright 2014 High Fidelity, Inc.
7+// Copyright 2022 Overte e.V.
78 //
89 // Distributed under the Apache License, Version 2.0.
910 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -11,11 +12,19 @@ · 1 unmodified line
1112
1213 #include "AccountServicesScriptingInterface.h"
1314
15+#include <ScriptEngineCast.h>
16+
1417 #include "AccountManager.h"
1518 #include "Application.h"
1619 #include "DiscoverabilityManager.h"
1720 #include "ResourceCache.h"
1821
22+STATIC_SCRIPT_TYPES_INITIALIZER(+[](ScriptManager* manager){
23+ auto scriptEngine = manager->engine().get();
24+
25+ scriptRegisterMetaType(scriptEngine, DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue);
26+});
27+
1928 AccountServicesScriptingInterface::AccountServicesScriptingInterface() {
2029 auto accountManager = DependencyManager::get<AccountManager>();
2130 connect(accountManager.data(), &AccountManager::usernameChanged, this, &AccountServicesScriptingInterface::onUsernameChanged);