History

fixed getAssetList()

Elisa Lupin-Jimenez committed 8 years ago

Commit 34d8fe31 parent 8a9e5bc2 files · +3 −20Browse files

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

Unified · Split

interface/src/scripting/GooglePolyScriptingInterface.cpp+2−18
@@ -40,14 +40,13 @@ void GooglePolyScriptingInterface::setAPIKey(QString key) { · 39 unmodified lines
40 authCode = key;40 authCode = key;
41}41}
42 42
43QByteArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) {43QString GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) {
44 QUrl url = formatURLQuery(keyword, category, format);44 QUrl url = formatURLQuery(keyword, category, format);
45 if (!url.isEmpty()) {45 if (!url.isEmpty()) {
46 //QJsonArray json = parseJSON(url, 0).toJsonArray();46 //QJsonArray json = parseJSON(url, 0).toJsonArray();
47 //qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName");47 //qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName");
48 QByteArray json = parseJSON(url, 0).toJsonDocument().toJson();48 QByteArray json = parseJSON(url, 0).toJsonDocument().toJson();
49 qCDebug(scriptengine) << "asset list as string is: " << json;49 return (QString) json;
50 return json;
51 } else {50 } else {
52 qCDebug(scriptengine) << "Invalid filters were specified.";51 qCDebug(scriptengine) << "Invalid filters were specified.";
53 //return QJsonArray();52 //return QJsonArray();
@@ -55,21 +54,6 @@ QByteArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString c · 1 unmodified line
55 }54 }
56}55}
57 56
58/*QJsonArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) {
59 QUrl url = formatURLQuery(keyword, category, format);
60 if (!url.isEmpty()) {
61 //QJsonArray json = parseJSON(url, 0).toJsonArray();
62 //qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName");
63 QJsonArray json = parseJSON(url, 0).toJsonArray();
64 qCDebug(scriptengine) << "asset list as array is: " << json;
65 return json;
66 } else {
67 qCDebug(scriptengine) << "Invalid filters were specified.";
68 return QJsonArray();
69 //return "";
70 }
71}*/
72
73QString GooglePolyScriptingInterface::getFBX(QString keyword, QString category) {57QString GooglePolyScriptingInterface::getFBX(QString keyword, QString category) {
74 QUrl url = formatURLQuery(keyword, category, "FBX");58 QUrl url = formatURLQuery(keyword, category, "FBX");
75 return getModelURL(url);59 return getModelURL(url);