From 34d8fe307df1c736f0d5ea77649b6b63990458a5 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Tue, 19 Dec 2017 11:25:15 -0800 Subject: [PATCH] fixed getAssetList() --- .../GooglePolyScriptingInterface.cpp | 20 ++----------------- .../scripting/GooglePolyScriptingInterface.h | 3 +-- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/interface/src/scripting/GooglePolyScriptingInterface.cpp b/interface/src/scripting/GooglePolyScriptingInterface.cpp index 42c3b825ba..6387295315 100644 --- a/interface/src/scripting/GooglePolyScriptingInterface.cpp +++ b/interface/src/scripting/GooglePolyScriptingInterface.cpp @@ -40,14 +40,13 @@ void GooglePolyScriptingInterface::setAPIKey(QString key) { authCode = key; } -QByteArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) { +QString GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) { QUrl url = formatURLQuery(keyword, category, format); if (!url.isEmpty()) { //QJsonArray json = parseJSON(url, 0).toJsonArray(); //qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName"); QByteArray json = parseJSON(url, 0).toJsonDocument().toJson(); - qCDebug(scriptengine) << "asset list as string is: " << json; - return json; + return (QString) json; } else { qCDebug(scriptengine) << "Invalid filters were specified."; //return QJsonArray(); @@ -55,21 +54,6 @@ QByteArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString c } } -/*QJsonArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) { - QUrl url = formatURLQuery(keyword, category, format); - if (!url.isEmpty()) { - //QJsonArray json = parseJSON(url, 0).toJsonArray(); - //qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName"); - QJsonArray json = parseJSON(url, 0).toJsonArray(); - qCDebug(scriptengine) << "asset list as array is: " << json; - return json; - } else { - qCDebug(scriptengine) << "Invalid filters were specified."; - return QJsonArray(); - //return ""; - } -}*/ - QString GooglePolyScriptingInterface::getFBX(QString keyword, QString category) { QUrl url = formatURLQuery(keyword, category, "FBX"); return getModelURL(url); diff --git a/interface/src/scripting/GooglePolyScriptingInterface.h b/interface/src/scripting/GooglePolyScriptingInterface.h index f8b00462f3..7c6d810d13 100644 --- a/interface/src/scripting/GooglePolyScriptingInterface.h +++ b/interface/src/scripting/GooglePolyScriptingInterface.h @@ -25,8 +25,7 @@ public slots: void testPrint(QString input); void setAPIKey(QString key); - //QJsonArray getAssetList(QString keyword, QString category, QString format); - QByteArray getAssetList(QString keyword, QString category, QString format); + QString getAssetList(QString keyword, QString category, QString format); QString getFBX(QString keyword, QString category); QString getOBJ(QString keyword, QString category); QString getBlocks(QString keyword, QString category);