mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 08:57:27 +02:00
Renamed isZipped for more clarity on checking for non-fbx files
This commit is contained in:
parent
6721cc8dfb
commit
2f07ba87af
3 changed files with 12 additions and 11 deletions
|
@ -83,17 +83,18 @@ Rectangle {
|
||||||
onLinkHovered: {
|
onLinkHovered: {
|
||||||
desktop.currentUrl = hoveredUrl;
|
desktop.currentUrl = hoveredUrl;
|
||||||
//runJavaScript(checkFileType, function(){console.log("Remove filetypes JS injection");});
|
//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;
|
statusLabel.text = claraError;
|
||||||
statusBar.color = hifi.colors.redHighlight;
|
statusBar.color = hifi.colors.redHighlight;
|
||||||
statusIcon.text = hifi.glyphs.alert;
|
statusIcon.text = hifi.glyphs.alert;
|
||||||
runJavaScript(notFbxHandler, displayErrorStatus());
|
runJavaScript(notFbxHandler, displayErrorStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (File.isZippedFbx(desktop.currentUrl)) {
|
|
||||||
runJavaScript(simpleDownload, function(){console.log("Download JS injection");});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoadingChanged: {
|
onLoadingChanged: {
|
||||||
|
|
|
@ -73,15 +73,15 @@ bool FileScriptingInterface::isClaraLink(QUrl url) {
|
||||||
return (url.toString().contains("clara.io") && !url.toString().contains("clara.io/signup"));
|
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) {
|
bool FileScriptingInterface::isZippedFbx(QUrl url) {
|
||||||
return (url.toString().endsWith("fbx.zip"));
|
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
|
// this function is not in use
|
||||||
QString FileScriptingInterface::getTempDir() {
|
QString FileScriptingInterface::getTempDir() {
|
||||||
QTemporaryDir dir;
|
QTemporaryDir dir;
|
||||||
|
|
|
@ -24,8 +24,8 @@ public:
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool isNotFbx(QUrl url);
|
|
||||||
bool isZippedFbx(QUrl url);
|
bool isZippedFbx(QUrl url);
|
||||||
|
bool isZipped(QUrl url);
|
||||||
bool isClaraLink(QUrl url);
|
bool isClaraLink(QUrl url);
|
||||||
QString convertUrlToPath(QUrl url);
|
QString convertUrlToPath(QUrl url);
|
||||||
void runUnzip(QString path, QUrl url);
|
void runUnzip(QString path, QUrl url);
|
||||||
|
|
Loading…
Reference in a new issue