History

file structures in zip files replicated, more useful unzip debug print, updated blocks tablet app url

Elisa Lupin-Jimenez committed 8 years ago

Commit 3aa7cb41 parent 88823a12 files · +15 −14Browse files

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

Unified · Split

interface/src/Application.cpp+14−13
@@ -6328,20 +6328,19 @@ void Application::addAssetToWorldUnzipFailure(QString filePath) { · 6327 unmodified lines
63286328 addAssetToWorldError(filename, "Couldn't unzip file " + filename + ".");
63296329 }
63306330
6331−void Application::addAssetToWorld(QString filePath, QString zipFile, bool isZip, bool isBlocks) {
6331+void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, bool isBlocks) {
63326332 // Automatically upload and add asset to world as an alternative manual process initiated by showAssetServerWidget().
63336333 QString mapping;
6334− QString path = filePath;
63356334 QString filename = filenameFromPath(path);
6336− if (isZip) {
6337− QString assetFolder = zipFile.section("/", -1);
6338− assetFolder.remove(".zip");
6339− mapping = "/" + assetFolder + "/" + filename;
6340− } else if (isBlocks) {
6341− qCDebug(interfaceapp) << "Path to asset folder: " << zipFile;
6342− QString assetFolder = zipFile.section('/', -1);
6343− assetFolder.remove(".zip?noDownload=false");
6344− mapping = "/" + assetFolder + "/" + filename;
6335+ if (isZip || isBlocks) {
6336+ QString assetName;
6337+ if (isZip) {
6338+ assetName = zipFile.section("/", -1).remove(".zip");
6339+ } else if (isBlocks) {
6340+ assetName = zipFile.section("/", -1).remove(".zip?noDownload=false");
6341+ }
6342+ QString assetFolder = path.section("model_repo/", -1);
6343+ mapping = "/" + assetName + "/" + assetFolder;
63456344 } else {
63466345 mapping = "/" + filename;
63476346 }
@@ -6727,8 +6726,10 @@ void Application::handleUnzip(QString zipFile, QStringList unzipFile, bool autoA · 379 unmodified lines
67276726 if (autoAdd) {
67286727 if (!unzipFile.isEmpty()) {
67296728 for (int i = 0; i < unzipFile.length(); i++) {
6730− qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i);
6731− addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks);
6729+ if (QFileInfo(unzipFile.at(i)).isFile()) {
6730+ qCDebug(interfaceapp) << "Preparing file for asset server: " << unzipFile.at(i);
6731+ addAssetToWorld(unzipFile.at(i), zipFile, isZip, isBlocks);
6732+ }
67326733 }
67336734 } else {
67346735 addAssetToWorldUnzipFailure(zipFile);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t