Renamed isZipped for more clarity on checking for non-fbx files

This commit is contained in:
elisa-lj11 2016-09-02 16:48:55 -07:00
parent 6721cc8dfb
commit 2f07ba87af
3 changed files with 12 additions and 11 deletions

View file

@ -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: {

View file

@ -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;

View file

@ -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);