diff --git a/interface/resources/qml/Marketplaces.qml b/interface/resources/qml/Marketplaces.qml index 8e6fe51245..70a20286d3 100644 --- a/interface/resources/qml/Marketplaces.qml +++ b/interface/resources/qml/Marketplaces.qml @@ -83,17 +83,18 @@ Rectangle { onLinkHovered: { desktop.currentUrl = hoveredUrl; //runJavaScript(checkFileType, function(){console.log("Remove filetypes JS injection");}); + if (File.isZippedFbx(desktop.currentUrl)) { + runJavaScript(simpleDownload, function(){console.log("Download JS injection");}); + return; + } - if (File.isNotFbx(desktop.currentUrl)) { + if (File.isZipped(desktop.currentUrl)) { statusLabel.text = claraError; statusBar.color = hifi.colors.redHighlight; statusIcon.text = hifi.glyphs.alert; runJavaScript(notFbxHandler, displayErrorStatus()); } - - if (File.isZippedFbx(desktop.currentUrl)) { - runJavaScript(simpleDownload, function(){console.log("Download JS injection");}); - } + } onLoadingChanged: { diff --git a/libraries/script-engine/src/FileScriptingInterface.cpp b/libraries/script-engine/src/FileScriptingInterface.cpp index 0ad9aadd8d..ad6a3cdf6f 100644 --- a/libraries/script-engine/src/FileScriptingInterface.cpp +++ b/libraries/script-engine/src/FileScriptingInterface.cpp @@ -73,15 +73,15 @@ bool FileScriptingInterface::isClaraLink(QUrl url) { return (url.toString().contains("clara.io") && !url.toString().contains("clara.io/signup")); } -// checks whether a user tries to download a file that is not in .fbx format -bool FileScriptingInterface::isNotFbx(QUrl url) { - return (url.toString().endsWith(".zip") && !(url.toString().contains("fbx") )); -} - bool FileScriptingInterface::isZippedFbx(QUrl url) { return (url.toString().endsWith("fbx.zip")); } +// checks whether a user tries to download a file that is not in .fbx format +bool FileScriptingInterface::isZipped(QUrl url) { + return (url.toString().endsWith(".zip")); +} + // this function is not in use QString FileScriptingInterface::getTempDir() { QTemporaryDir dir; diff --git a/libraries/script-engine/src/FileScriptingInterface.h b/libraries/script-engine/src/FileScriptingInterface.h index ffb10d7ada..d9a100b293 100644 --- a/libraries/script-engine/src/FileScriptingInterface.h +++ b/libraries/script-engine/src/FileScriptingInterface.h @@ -24,8 +24,8 @@ public: public slots: - bool isNotFbx(QUrl url); bool isZippedFbx(QUrl url); + bool isZipped(QUrl url); bool isClaraLink(QUrl url); QString convertUrlToPath(QUrl url); void runUnzip(QString path, QUrl url);