diff --git a/hifi_qt.py b/hifi_qt.py index f22d8099ef..9e0fb8617f 100644 --- a/hifi_qt.py +++ b/hifi_qt.py @@ -139,7 +139,7 @@ endif() return if 'Windows' == system: - self.qtUrl = self.assets_url + '/dependencies/qt5/qt5-install-5.15.10-qtwebengine-5.15.15-2023.06.17-kde1742cc4f85f1b57c5f8ef51d62ff0b958f38912de57a9094aa3a3e3bf35ae6cb-windows-x86_64.tar.xz' + self.qtUrl = self.assets_url + '/dependencies/qt5/qt5-install-5.15.10-2023.09.17-windows-x86_64.tar.xz' elif 'Darwin' == system: self.qtUrl = self.assets_url + '/dependencies/vcpkg/qt5-install-5.15.2-macos.tar.gz' elif 'Linux' == system: @@ -151,10 +151,8 @@ endif() # The `or 0` conditional assignment prevents the int parsing error from hiding the useful Qt package error u_major = int( distro.major_version() or '0' ) if distro.id() == 'ubuntu' or distro.id() == 'linuxmint': - if (distro.id() == 'ubuntu' and u_major == 18) or distro.id() == 'linuxmint' and u_major == 19: - self.qtUrl = self.assets_url + '/dependencies/qt5/qt5-install-5.15.5-2022.07.17-kde_ea4efc067b47c11b1aac61668afd8578a6834f5b-ubuntu-18.04-amd64.tar.xz' - elif (distro.id() == 'ubuntu' and u_major == 20) or distro.id() == 'linuxmint' and u_major == 20: - self.qtUrl = self.assets_url + '/dependencies/qt5/qt5-install-5.15.5-2022.08.12-kde_0b4d44f2ff1103349bac22b9b207cfcc1f50a53a-ubuntu-20.04-amd64.tar.xz' + if (distro.id() == 'ubuntu' and u_major == 20) or distro.id() == 'linuxmint' and u_major == 20: + self.qtUrl = self.assets_url + '/dependencies/qt5/qt5-install-5.15.10-2023.09.16-kde_15e6be42c230046646237698fa761b8fb3df71ee-ubuntu-20.04-amd64.tar.xz' elif (distro.id() == 'ubuntu' and u_major > 20) or (distro.id() == 'linuxmint' and u_major > 20): self.__no_qt_package_error() else: diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7213d45055..628d9173b8 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -973,7 +973,7 @@ const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true; const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false; const bool DEFAULT_PREFER_STYLUS_OVER_LASER = false; const bool DEFAULT_PREFER_AVATAR_FINGER_OVER_STYLUS = false; -const QString DEFAULT_CURSOR_NAME = "DEFAULT"; +const QString DEFAULT_CURSOR_NAME = "SYSTEM"; const bool DEFAULT_MINI_TABLET_ENABLED = false; const bool DEFAULT_AWAY_STATE_WHEN_FOCUS_LOST_IN_VR_ENABLED = true; diff --git a/libraries/model-serializers/src/FSTReader.cpp b/libraries/model-serializers/src/FSTReader.cpp index 80f9079745..0b832f78fd 100644 --- a/libraries/model-serializers/src/FSTReader.cpp +++ b/libraries/model-serializers/src/FSTReader.cpp @@ -20,6 +20,9 @@ #include #include + +const QStringList SINGLE_VALUE_PROPERTIES{"name", "filename", "texdir", "script", "comment"}; + hifi::VariantMultiHash FSTReader::parseMapping(QIODevice* device) { hifi::VariantMultiHash properties; @@ -32,9 +35,25 @@ hifi::VariantMultiHash FSTReader::parseMapping(QIODevice* device) { if (sections.size() < 2) { continue; } + + // We can have URLs like: + // filename = https://www.dropbox.com/scl/fi/xxx/avatar.fbx?rlkey=xxx&dl=1\n + // These confuse the parser due to the presence of = in the URL. + // + // SINGLE_VALUE_PROPERTIES contains a list of things that may be URLs or contain an = + // for some other reason, and that we know for sure contain only a single value after + // the first =. + // + // Really though, we should just use JSON instead. QByteArray name = sections.at(0).trimmed(); - if (sections.size() == 2) { - properties.insert(name, sections.at(1).trimmed()); + bool isSingleValue = SINGLE_VALUE_PROPERTIES.contains(name); + + if (sections.size() == 2 || isSingleValue) { + // As per the above, we can have '=' signs inside of URLs, so instead of + // using the split string, just use everything after the first '='. + + QString value = line.mid(line.indexOf("=")+1).trimmed(); + properties.insert(name, value); } else if (sections.size() == 3) { QVariantHash heading = properties.value(name).toHash(); heading.insert(sections.at(1).trimmed(), sections.at(2).trimmed()); diff --git a/libraries/networking/src/ResourceCache.cpp b/libraries/networking/src/ResourceCache.cpp index 41cf7cfe5f..4e36fb4646 100644 --- a/libraries/networking/src/ResourceCache.cpp +++ b/libraries/networking/src/ResourceCache.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "NetworkAccessManager.h" #include "NetworkLogging.h" @@ -700,6 +701,29 @@ void Resource::init(bool resetLoaded) { } else if (!(_url.isValid())) { _startedLoading = _failedToLoad = true; } + + + // Dropbox by default creates URLs like: + // https://www.dropbox.com/scl/fi/xxx/avatar.fbx?rlkey=xxx&dl=0 + // + // Which go to an HTTP page that allows previewing and downloading the file. To actually download, + // a link with dl=1 at the end is needed instead. Users may often use the HTTP page by mistake, but + // we can't do anything useful with it. + // + // So we just catch and forcefully rewrite it here. + if (_activeUrl.host() == "www.dropbox.com" ) { + if ( _activeUrl.hasQuery() ) { + QUrlQuery query(_activeUrl); + if (query.queryItemValue("dl") == "0") { + query.removeQueryItem("dl"); + query.addQueryItem("dl", "1"); + + _activeUrl.setQuery(query); + qCDebug(networking) << "Rewrote Dropbox URL to force download"; + } + } + } + } void Resource::attemptRequest() { diff --git a/tools/qt-builder/Dockerfile_Ubuntu_20.04_Qt5 b/tools/qt-builder/Dockerfile_Ubuntu_20.04_Qt5 index 94bda6d410..0d7173f450 100644 --- a/tools/qt-builder/Dockerfile_Ubuntu_20.04_Qt5 +++ b/tools/qt-builder/Dockerfile_Ubuntu_20.04_Qt5 @@ -4,11 +4,11 @@ # - Check which commit you are building https://invent.kde.org/qt/qt/qt5/-/tree/kde/5.15 # - Adjust this file to include the commit hash you are building, the date, the number of threads you want to use (-j10), the platform, and the Qt and QtWebEngine versions. # Keep in mind that building Qt requires a lot of memory. You should have over 1.2GiB of system memory available per thread. -# - Run the build process with something like `PROGRESS_NO_TRUNC=1 DOCKER_BUILDKIT=1 BUILDKIT_STEP_LOG_MAX_SIZE=-1 docker build --progress plain -t overte-qt5:5.15.9-2023.05.21-kde_fb3ec282151b1ee281a24f0545a40ac6438537c2 -f Dockerfile_Ubuntu_20.04_Qt5 .` +# - Run the build process with something like `PROGRESS_NO_TRUNC=1 DOCKER_BUILDKIT=1 BUILDKIT_STEP_LOG_MAX_SIZE=-1 docker build --progress plain -t overte-qt5:5.15.10-2023.09.16-kde_15e6be42c230046646237698fa761b8fb3df71ee -f Dockerfile_Ubuntu_20.04_Qt5 .` # Buildkit is used to cache intermittent steps in case you need to modify something afterwards. # - Once the build has completed, create a container from the image and export the created Qt package. -# `docker create --name extract overte-qt5:5.15.9-2023.05.21-kde_fb3ec282151b1ee281a24f0545a40ac6438537c2` -# `docker cp extract:qt5-install-5.15.9-2023.05.21-kde_fb3ec282151b1ee281a24f0545a40ac6438537c2-ubuntu-20.04-amd64.tar.xz /path/on/host` +# `docker create --name extract overte-qt5:5.15.10-2023.09.16-kde_15e6be42c230046646237698fa761b8fb3df71ee` +# `docker cp extract:qt5-install-5.15.10-2023.09.16-kde_15e6be42c230046646237698fa761b8fb3df71ee-ubuntu-20.04-amd64.tar.xz /path/on/host` # `docker rm extract` FROM ubuntu:20.04 @@ -42,32 +42,32 @@ RUN sed -i qt5/qtbase/mkspecs/linux-g++-64/qmake.conf -e 's/\/usr\/X11R6\/lib64/ RUN apt-get -y build-dep qt5-default # Install build dependencies -RUN apt-get -y install git python gperf flex bison pkg-config mesa-utils libgl1-mesa-dev make g++ libdbus-glib-1-dev libnss3-dev nodejs libxkbfile-dev libx11-dev +RUN apt-get -y install git python gperf flex bison pkg-config mesa-utils libgl1-mesa-dev make g++ libdbus-glib-1-dev libnss3-dev nodejs libxkbfile-dev libx11-dev libwebp-dev RUN mkdir qt5-install && mkdir qt5-build WORKDIR qt5-build RUN ../qt5/configure -force-debug-info -release -opensource -confirm-license -platform linux-g++ -recheck-all -nomake tests -nomake examples -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -skip qtlottie -skip qtquick3d -skip qtpim -skip qtdocgallery -no-warnings-are-errors -no-pch -no-icu -prefix ../qt5-install -RUN NINJAFLAGS='-j16' make -j16 +RUN NINJAFLAGS='-j6' make -j6 -RUN make -j16 module-qtscript +RUN make -j6 module-qtscript -RUN make -j16 install +RUN make -j6 install WORKDIR ./qtscript -RUN make -j16 install +RUN make -j6 install WORKDIR ../../qt5-install RUN find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; # Overwrite QtWebengine version to work around version conflicts -RUN find . -name \Qt5WebEngine*Config.cmake -exec sed -i '' -e 's/5\.15\.14/5\.15\.9/g' {} \; -RUN cp lib/libQt5WebEngine.so.5.15.14 lib/libQt5WebEngine.so.5.15.9 -RUN cp lib/libQt5WebEngineCore.so.5.15.14 lib/libQt5WebEngineCore.so.5.15.9 -RUN cp lib/libQt5WebEngineWidgets.so.5.15.14 lib/libQt5WebEngineWidgets.so.5.15.9 -RUN cp lib/libQt5Pdf.so.5.15.14 lib/libQt5Pdf.so.5.15.9 -RUN cp lib/libQt5PdfWidgets.so.5.15.14 lib/libQt5PdfWidgets.so.5.15.9 +RUN find . -name \Qt5WebEngine*Config.cmake -exec sed -i '' -e 's/5\.15\.14/5\.15\.10/g' {} \; +RUN cp lib/libQt5WebEngine.so.5.15.14 lib/libQt5WebEngine.so.5.15.10 +RUN cp lib/libQt5WebEngineCore.so.5.15.14 lib/libQt5WebEngineCore.so.5.15.10 +RUN cp lib/libQt5WebEngineWidgets.so.5.15.14 lib/libQt5WebEngineWidgets.so.5.15.10 +RUN cp lib/libQt5Pdf.so.5.15.14 lib/libQt5Pdf.so.5.15.10 +RUN cp lib/libQt5PdfWidgets.so.5.15.14 lib/libQt5PdfWidgets.so.5.15.10 COPY ./qt.conf ./bin/ @@ -75,4 +75,4 @@ COPY ./qt.conf ./bin/ RUN cp ../qt5-build/config.summary ./ WORKDIR .. -RUN XZ_OPT='-T0' tar -Jcvf qt5-install-5.15.9-2023.05.21-kde_fb3ec282151b1ee281a24f0545a40ac6438537c2-ubuntu-20.04-amd64.tar.xz qt5-install +RUN XZ_OPT='-T0' tar -Jcvf qt5-install-5.15.10-2023.09.16-kde_15e6be42c230046646237698fa761b8fb3df71ee-ubuntu-20.04-amd64.tar.xz qt5-install