The goal is to strip out data that can be used by untoward users in copying models, avatars, etc.
Showing the changes to libraries/script-engine/src/FileScriptingInterface.cpp (1 of 36 files). Show all
Unified · Split
| @@ -38,10 +38,7 @@ FileScriptingInterface::FileScriptingInterface(QObject* parent) : QObject(parent · 37 unmodified lines | |||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool isZip, bool isBlocks) { | 40 | void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool isZip, bool isBlocks) { |
| 41 | qCDebug(scriptengine) << "Url that was downloaded: " + url.toString(); | ||
| 42 | qCDebug(scriptengine) << "Path where download is saved: " + path; | ||
| 43 | QString fileName = "/" + path.section("/", -1); | 41 | QString fileName = "/" + path.section("/", -1); |
| 44 | qCDebug(scriptengine) << "Filename: " << fileName; | ||
| 45 | QString tempDir = path; | 42 | QString tempDir = path; |
| 46 | if (!isZip) { | 43 | if (!isZip) { |
| 47 | tempDir.remove(fileName); | 44 | tempDir.remove(fileName); |
| @@ -59,9 +56,7 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool · 11 unmodified lines | |||
| 59 | 56 | ||
| 60 | QStringList fileList = unzipFile(path, tempDir); | 57 | QStringList fileList = unzipFile(path, tempDir); |
| 61 | 58 | ||
| 62 | if (!fileList.isEmpty()) { | 59 | if(fileList.isEmpty()) { |
| 63 | qCDebug(scriptengine) << "First file to upload: " + fileList.first(); | ||
| 64 | } else { | ||
| 65 | qCDebug(scriptengine) << "Unzip failed"; | 60 | qCDebug(scriptengine) << "Unzip failed"; |
| 66 | } | 61 | } |
| 67 | 62 | ||
| @@ -131,7 +126,6 @@ QString FileScriptingInterface::convertUrlToPath(QUrl url) { · 63 unmodified lines | |||
| 131 | QString newUrl; | 126 | QString newUrl; |
| 132 | QString oldUrl = url.toString(); | 127 | QString oldUrl = url.toString(); |
| 133 | newUrl = oldUrl.section("filename=", 1, 1); | 128 | newUrl = oldUrl.section("filename=", 1, 1); |
| 134 | qCDebug(scriptengine) << "Filename should be: " + newUrl; | ||
| 135 | return newUrl; | 129 | return newUrl; |
| 136 | } | 130 | } |
| 137 | 131 | ||
| @@ -149,14 +143,12 @@ void FileScriptingInterface::downloadZip(QString path, const QString link) { · 11 unmodified lines | |||
| 149 | // this function is not in use | 143 | // this function is not in use |
| 150 | void FileScriptingInterface::recursiveFileScan(QFileInfo file, QString* dirName) { | 144 | void FileScriptingInterface::recursiveFileScan(QFileInfo file, QString* dirName) { |
| 151 | /*if (!file.isDir()) { | 145 | /*if (!file.isDir()) { |
| 152 | qCDebug(scriptengine) << "Regular file logged: " + file.fileName(); | ||
| 153 | return; | 146 | return; |
| 154 | }*/ | 147 | }*/ |
| 155 | QFileInfoList files; | 148 | QFileInfoList files; |
| 156 | // FIXME quazip hasn't been built on the android toolchain | 149 | // FIXME quazip hasn't been built on the android toolchain |
| 157 | #if !defined(Q_OS_ANDROID) | 150 | #if !defined(Q_OS_ANDROID) |
| 158 | if (file.fileName().contains(".zip")) { | 151 | if (file.fileName().contains(".zip")) { |
| 159 | qCDebug(scriptengine) << "Extracting archive: " + file.fileName(); | ||
| 160 | JlCompress::extractDir(file.fileName()); | 152 | JlCompress::extractDir(file.fileName()); |
| 161 | } | 153 | } |
| 162 | #endif | 154 | #endif |
| @@ -167,7 +159,6 @@ void FileScriptingInterface::recursiveFileScan(QFileInfo file, QString* dirName) · 4 unmodified lines | |||
| 167 | }*/ | 159 | }*/ |
| 168 | 160 | ||
| 169 | foreach (QFileInfo file, files) { | 161 | foreach (QFileInfo file, files) { |
| 170 | qCDebug(scriptengine) << "Looking into file: " + file.fileName(); | ||
| 171 | recursiveFileScan(file, dirName); | 162 | recursiveFileScan(file, dirName); |
| 172 | } | 163 | } |
| 173 | return; | 164 | return; |