From 797016f497728b47da20f33d635f26dcc1dbaad1 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Wed, 15 Nov 2017 10:12:13 -0800 Subject: [PATCH 1/6] changed url for blocks app --- unpublishedScripts/marketplace/blocks/blocksApp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpublishedScripts/marketplace/blocks/blocksApp.js b/unpublishedScripts/marketplace/blocks/blocksApp.js index c9e8682b23..813a77c74a 100644 --- a/unpublishedScripts/marketplace/blocks/blocksApp.js +++ b/unpublishedScripts/marketplace/blocks/blocksApp.js @@ -14,7 +14,7 @@ (function () { var APP_NAME = "BLOCKS"; - var APP_URL = "https://vr.google.com/objects/"; + var APP_URL = "https://poly.google.com/"; var APP_OUTDATED_URL = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/updateToBlocks.html"; var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg"; var APP_ICON_ACTIVE = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-a.svg"; From be0d4646fac4e3fcdd0e45a88ae78e6a3510d479 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Fri, 17 Nov 2017 15:54:41 -0800 Subject: [PATCH 2/6] file structures in zip files replicated, more useful unzip debug print, updated blocks tablet app url --- interface/src/Application.cpp | 27 ++++++++++--------- .../src/FileScriptingInterface.cpp | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b21588958e..ccf9b98a7a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6324,20 +6324,19 @@ void Application::addAssetToWorldUnzipFailure(QString filePath) { addAssetToWorldError(filename, "Couldn't unzip file " + filename + "."); } -void Application::addAssetToWorld(QString filePath, QString zipFile, bool isZip, bool isBlocks) { +void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, bool isBlocks) { // Automatically upload and add asset to world as an alternative manual process initiated by showAssetServerWidget(). QString mapping; - QString path = filePath; QString filename = filenameFromPath(path); - if (isZip) { - QString assetFolder = zipFile.section("/", -1); - assetFolder.remove(".zip"); - mapping = "/" + assetFolder + "/" + filename; - } else if (isBlocks) { - qCDebug(interfaceapp) << "Path to asset folder: " << zipFile; - QString assetFolder = zipFile.section('/', -1); - assetFolder.remove(".zip?noDownload=false"); - mapping = "/" + assetFolder + "/" + filename; + if (isZip || isBlocks) { + QString assetName; + if (isZip) { + assetName = zipFile.section("/", -1).remove(".zip"); + } else if (isBlocks) { + assetName = zipFile.section("/", -1).remove(".zip?noDownload=false"); + } + QString assetFolder = path.section("model_repo/", -1); + mapping = "/" + assetName + "/" + assetFolder; } else { mapping = "/" + filename; } @@ -6723,8 +6722,10 @@ void Application::handleUnzip(QString zipFile, QStringList unzipFile, bool autoA if (autoAdd) { if (!unzipFile.isEmpty()) { for (int i = 0; i < unzipFile.length(); i++) { - qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); - addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + if (QFileInfo(unzipFile.at(i)).isFile()) { + qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); + addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + } } } else { addAssetToWorldUnzipFailure(zipFile); diff --git a/libraries/script-engine/src/FileScriptingInterface.cpp b/libraries/script-engine/src/FileScriptingInterface.cpp index 68a141ad97..fdae04f267 100644 --- a/libraries/script-engine/src/FileScriptingInterface.cpp +++ b/libraries/script-engine/src/FileScriptingInterface.cpp @@ -55,7 +55,7 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool QStringList fileList = unzipFile(path, tempDir); if (!fileList.isEmpty()) { - qCDebug(scriptengine) << "File to upload: " + fileList.first(); + qCDebug(scriptengine) << "First file to upload: " + fileList.first(); } else { qCDebug(scriptengine) << "Unzip failed"; } From 88823a169b216e6498b30916dd9c0a67283bf9e4 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Wed, 15 Nov 2017 10:12:13 -0800 Subject: [PATCH 3/6] changed url for blocks app --- unpublishedScripts/marketplace/blocks/blocksApp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpublishedScripts/marketplace/blocks/blocksApp.js b/unpublishedScripts/marketplace/blocks/blocksApp.js index c9e8682b23..813a77c74a 100644 --- a/unpublishedScripts/marketplace/blocks/blocksApp.js +++ b/unpublishedScripts/marketplace/blocks/blocksApp.js @@ -14,7 +14,7 @@ (function () { var APP_NAME = "BLOCKS"; - var APP_URL = "https://vr.google.com/objects/"; + var APP_URL = "https://poly.google.com/"; var APP_OUTDATED_URL = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/updateToBlocks.html"; var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg"; var APP_ICON_ACTIVE = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-a.svg"; From 3aa7cb440db4600126b09f340ee883edfd92b54f Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Fri, 17 Nov 2017 15:54:41 -0800 Subject: [PATCH 4/6] file structures in zip files replicated, more useful unzip debug print, updated blocks tablet app url --- interface/src/Application.cpp | 27 ++++++++++--------- .../src/FileScriptingInterface.cpp | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2624aa376f..f20f6a2995 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6328,20 +6328,19 @@ void Application::addAssetToWorldUnzipFailure(QString filePath) { addAssetToWorldError(filename, "Couldn't unzip file " + filename + "."); } -void Application::addAssetToWorld(QString filePath, QString zipFile, bool isZip, bool isBlocks) { +void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, bool isBlocks) { // Automatically upload and add asset to world as an alternative manual process initiated by showAssetServerWidget(). QString mapping; - QString path = filePath; QString filename = filenameFromPath(path); - if (isZip) { - QString assetFolder = zipFile.section("/", -1); - assetFolder.remove(".zip"); - mapping = "/" + assetFolder + "/" + filename; - } else if (isBlocks) { - qCDebug(interfaceapp) << "Path to asset folder: " << zipFile; - QString assetFolder = zipFile.section('/', -1); - assetFolder.remove(".zip?noDownload=false"); - mapping = "/" + assetFolder + "/" + filename; + if (isZip || isBlocks) { + QString assetName; + if (isZip) { + assetName = zipFile.section("/", -1).remove(".zip"); + } else if (isBlocks) { + assetName = zipFile.section("/", -1).remove(".zip?noDownload=false"); + } + QString assetFolder = path.section("model_repo/", -1); + mapping = "/" + assetName + "/" + assetFolder; } else { mapping = "/" + filename; } @@ -6727,8 +6726,10 @@ void Application::handleUnzip(QString zipFile, QStringList unzipFile, bool autoA if (autoAdd) { if (!unzipFile.isEmpty()) { for (int i = 0; i < unzipFile.length(); i++) { - qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); - addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + if (QFileInfo(unzipFile.at(i)).isFile()) { + qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i); + addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks); + } } } else { addAssetToWorldUnzipFailure(zipFile); diff --git a/libraries/script-engine/src/FileScriptingInterface.cpp b/libraries/script-engine/src/FileScriptingInterface.cpp index 68a141ad97..fdae04f267 100644 --- a/libraries/script-engine/src/FileScriptingInterface.cpp +++ b/libraries/script-engine/src/FileScriptingInterface.cpp @@ -55,7 +55,7 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool QStringList fileList = unzipFile(path, tempDir); if (!fileList.isEmpty()) { - qCDebug(scriptengine) << "File to upload: " + fileList.first(); + qCDebug(scriptengine) << "First file to upload: " + fileList.first(); } else { qCDebug(scriptengine) << "Unzip failed"; } From a54f4eca93511de032da628c30ff1815e39d8062 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Mon, 20 Nov 2017 14:02:46 -0800 Subject: [PATCH 5/6] simplified naming of zip folders --- interface/src/Application.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index fb54983d39..41353208f7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6336,12 +6336,7 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo QString mapping; QString filename = filenameFromPath(path); if (isZip || isBlocks) { - QString assetName; - if (isZip) { - assetName = zipFile.section("/", -1).remove(".zip"); - } else if (isBlocks) { - assetName = zipFile.section("/", -1).remove(".zip?noDownload=false"); - } + QString assetName = zipFile.section("/", -1).remove(QRegExp("\.zip(.*)$")); QString assetFolder = path.section("model_repo/", -1); mapping = "/" + assetName + "/" + assetFolder; } else { From fb6287503edbf70e7f443ee6da9a4832b93c3ff5 Mon Sep 17 00:00:00 2001 From: Elisa Lupin-Jimenez Date: Mon, 20 Nov 2017 15:12:11 -0800 Subject: [PATCH 6/6] hopefully fixed build error resulting from escape sequence --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 41353208f7..a7b0c4af3e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6336,7 +6336,7 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo QString mapping; QString filename = filenameFromPath(path); if (isZip || isBlocks) { - QString assetName = zipFile.section("/", -1).remove(QRegExp("\.zip(.*)$")); + QString assetName = zipFile.section("/", -1).remove(QRegExp("[.]zip(.*)$")); QString assetFolder = path.section("model_repo/", -1); mapping = "/" + assetName + "/" + assetFolder; } else {