fixed getAssetList()

This commit is contained in:
Elisa Lupin-Jimenez 2017-12-19 11:25:15 -08:00
parent 8a9e5bc39d
commit 34d8fe307d
2 changed files with 3 additions and 20 deletions

View file

@ -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);

View file

@ -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);