History

Merge branch 'master' of https://github.com/highfidelity/hifi into removeLogSpam

Brad Hefta-Gaub committed 9 years ago

Commit c65471e2 parents dbbed46 61c60fc45 files · +2136 −510Browse files

Showing the changes to libraries/script-engine/src/FileScriptingInterface.cpp (1 of 45 files). Show all

Unified · Split

libraries/script-engine/src/FileScriptingInterface.cpp+5−23
@@ -32,7 +32,7 @@ FileScriptingInterface::FileScriptingInterface(QObject* parent) : QObject(parent · 31 unmodified lines
3232 // nothing for now
3333 }
3434
35−void FileScriptingInterface::runUnzip(QString path, QUrl url) {
35+void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd) {
3636 qCDebug(scriptengine) << "Url that was downloaded: " + url.toString();
3737 qCDebug(scriptengine) << "Path where download is saved: " + path;
3838 QString fileName = "/" + path.section("/", -1);
@@ -45,15 +45,13 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url) { · 6 unmodified lines
4545 }
4646
4747 QString file = unzipFile(path, tempDir);
48+ QString filename = QUrl::fromLocalFile(file).toString();
4849 if (file != "") {
49− qCDebug(scriptengine) << "Object file to upload: " + file;
50− QUrl url = QUrl::fromLocalFile(file);
51− emit unzipSuccess(url.toString());
50+ qCDebug(scriptengine) << "File to upload: " + filename;
5251 } else {
53− qCDebug(scriptengine) << "unzip failed";
52+ qCDebug(scriptengine) << "Unzip failed";
5453 }
55− qCDebug(scriptengine) << "Removing temporary directory at: " + tempDir;
56− QDir(tempDir).removeRecursively();
54+ emit unzipResult(path, filename, autoAdd);
5755 }
5856
5957 // fix to check that we are only referring to a temporary directory
@@ -69,21 +67,6 @@ bool FileScriptingInterface::isTempDir(QString tempDir) { · 9 unmodified lines
6967 return (testContainer == tempContainer);
7068 }
7169
72−// checks whether the webview is displaying a Clara.io page for Marketplaces.qml
73−bool FileScriptingInterface::isClaraLink(QUrl url) {
74− return (url.toString().contains("clara.io") && !url.toString().contains("clara.io/signup"));
75−}
76−
77−bool FileScriptingInterface::isZippedFbx(QUrl url) {
78− return (url.toString().endsWith("fbx.zip"));
79−}
80−
81−// checks whether a user tries to download a file that is not in .fbx format
82−bool FileScriptingInterface::isZipped(QUrl url) {
83− return (url.toString().endsWith(".zip"));
84−}
85−
86−// this function is not in use
8770 QString FileScriptingInterface::getTempDir() {
8871 QTemporaryDir dir;
8972 dir.setAutoRemove(false);
@@ -109,7 +92,6 @@ void FileScriptingInterface::downloadZip(QString path, const QString link) { · 19 unmodified lines
10992 request->send();
11093 }
11194
112−
11395 QString FileScriptingInterface::unzipFile(QString path, QString tempDir) {
11496
11597 QDir dir(path);