hand the launchURL off to RenderingClient

This commit is contained in:
Stephen Birarda 2015-01-29 14:29:41 -08:00
parent 2657af8d4b
commit f37fc30e0c
3 changed files with 14 additions and 6 deletions

View file

@ -36,10 +36,16 @@
#include "GVRInterface.h"
static QString launchURLString = "";
GVRInterface::GVRInterface(int argc, char* argv[]) :
QApplication(argc, argv),
_inVRMode(false)
{
// did we get launched with a lookup URL? If so it is time to give that to the AddressManager
qDebug() << "We were opened via a hifi URL -" << launchURLString;
launchURLString = "";
_client = new RenderingClient(this);
connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
@ -65,7 +71,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
extern "C" {
JNIEXPORT void Java_io_highfidelity_gvrinterface_InterfaceActivity_handleHifiURL(JNIEnv *jni, jclass clazz, jstring hifiURLString) {
qDebug() << "The lookup string in c++ is" << QAndroidJniObject(hifiURLString).toString();
launchURLString = QAndroidJniObject(hifiURLString).toString();
}
}

View file

@ -21,11 +21,16 @@
RenderingClient* RenderingClient::_instance = NULL;
RenderingClient::RenderingClient(QObject *parent) :
RenderingClient::RenderingClient(QObject *parent, const QString& launchURLString) :
Client(parent)
{
_instance = this;
// connect to AddressManager and pass it the launch URL, if we have one
auto addressManager = DependencyManager::get<AddressManager>();
connect(addressManager.data(), &AddressManager::locationChangeRequired, this, &RenderingClient::goToLocation);
addressManager->loadSettings(launchURLString);
// tell the NodeList which node types all rendering clients will want to know about
DependencyManager::get<NodeList>()->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer);
@ -42,9 +47,6 @@ RenderingClient::RenderingClient(QObject *parent) :
connect(audioThread, &QThread::started, audioClient.data(), &AudioClient::start);
audioThread->start();
connect(DependencyManager::get<AddressManager>().data(), &AddressManager::locationChangeRequired,
this, &RenderingClient::goToLocation);
}
RenderingClient::~RenderingClient() {

View file

@ -21,7 +21,7 @@
class RenderingClient : public Client {
Q_OBJECT
public:
RenderingClient(QObject* parent = 0);
RenderingClient(QObject* parent = 0, const QString& launchURLString = QString());
~RenderingClient();
const glm::vec3& getPosition() const { return _position; }