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
4//4//
5// Created by Thijs Wenker on 9/10/14.5// Created by Thijs Wenker on 9/10/14.
6// Copyright 2014 High Fidelity, Inc.6// Copyright 2014 High Fidelity, Inc.
7// Copyright 2022 Overte e.V.
7//8//
8// Distributed under the Apache License, Version 2.0.9// Distributed under the Apache License, Version 2.0.
9// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html10// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -11,11 +12,19 @@ · 1 unmodified line
11 12
12#include "AccountServicesScriptingInterface.h"13#include "AccountServicesScriptingInterface.h"
13 14
15#include <ScriptEngineCast.h>
16
14#include "AccountManager.h"17#include "AccountManager.h"
15#include "Application.h"18#include "Application.h"
16#include "DiscoverabilityManager.h"19#include "DiscoverabilityManager.h"
17#include "ResourceCache.h"20#include "ResourceCache.h"
18 21
22STATIC_SCRIPT_TYPES_INITIALIZER(+[](ScriptManager* manager){
23 auto scriptEngine = manager->engine().get();
24
25 scriptRegisterMetaType(scriptEngine, DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue);
26});
27
19AccountServicesScriptingInterface::AccountServicesScriptingInterface() {28AccountServicesScriptingInterface::AccountServicesScriptingInterface() {
20 auto accountManager = DependencyManager::get<AccountManager>();29 auto accountManager = DependencyManager::get<AccountManager>();
21 connect(accountManager.data(), &AccountManager::usernameChanged, this, &AccountServicesScriptingInterface::onUsernameChanged);30 connect(accountManager.data(), &AccountManager::usernameChanged, this, &AccountServicesScriptingInterface::onUsernameChanged);