From e6f462e04a2045f9306fd450e2098bd7ec4ccfed Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Fri, 15 Mar 2024 22:55:44 -0700 Subject: [PATCH] fix some warnings --- interface/src/Application.cpp | 2 +- interface/src/LODManager.cpp | 4 ++-- .../src/scripting/WindowScriptingInterface.cpp | 14 +++++++------- libraries/audio-client/src/AudioClient.cpp | 2 ++ libraries/avatars/src/AvatarData.cpp | 12 ++++++------ libraries/graphics-scripting/CMakeLists.txt | 4 ++++ libraries/render-utils/src/text/Font.cpp | 4 ++-- .../src/AssetScriptingInterface.cpp | 14 +++++++------- .../src/ConsoleScriptingInterface.cpp | 8 ++++---- libraries/script-engine/src/Mat4.cpp | 2 +- libraries/script-engine/src/Quat.cpp | 2 +- libraries/script-engine/src/ScriptUUID.cpp | 2 +- libraries/script-engine/src/Vec3.cpp | 2 +- .../script-engine/src/v8/ScriptEngineV8.cpp | 8 ++++---- .../shared/src/PortableHighResolutionClock.h | 2 ++ libraries/shared/src/shared/WebRTC.h | 2 ++ libraries/ui/CMakeLists.txt | 4 ++++ libraries/ui/src/ui/OffscreenQmlSurface.cpp | 2 ++ plugins/JSAPIExample/src/JSAPIExample.cpp | 2 +- tools/nitpick/src/TestRunnerDesktop.cpp | 17 +++++++++-------- tools/nitpick/src/TestRunnerDesktop.h | 5 +++-- 21 files changed, 66 insertions(+), 48 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 431bd2cb96..8d99e41668 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -7657,7 +7657,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptManagerPoint { auto connection = std::make_shared(); - *connection = scriptManager->connect(scriptManager.get(), &ScriptManager::scriptEnding, [scriptManager, connection]() { + *connection = scriptManager->connect(scriptManager.get(), &ScriptManager::scriptEnding, [this, scriptManager, connection]() { // Request removal of controller routes with callbacks to a given script engine auto userInputMapper = DependencyManager::get(); // scheduleScriptEndpointCleanup will have the last instance of shared pointer to script manager diff --git a/interface/src/LODManager.cpp b/interface/src/LODManager.cpp index 8c7865cd17..9512b2f758 100644 --- a/interface/src/LODManager.cpp +++ b/interface/src/LODManager.cpp @@ -64,7 +64,7 @@ void LODManager::setRenderTimes(float presentTime, float engineRunTime, float ba } void LODManager::autoAdjustLOD(float realTimeDelta) { - std::lock_guard lock{ _automaticLODLock }; + std::lock_guard lock(_automaticLODLock); // The "render time" is the worse of: // - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N @@ -300,7 +300,7 @@ void LODManager::resetLODAdjust() { } void LODManager::setAutomaticLODAdjust(bool value) { - std::lock_guard lock{ _automaticLODLock }; + std::lock_guard lock(_automaticLODLock); _automaticLODAdjust = value; saveSettings(); emit autoLODChanged(); diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index 27564b39eb..b70798d02a 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -78,7 +78,7 @@ WindowScriptingInterface::~WindowScriptingInterface() { } ScriptValue WindowScriptingInterface::hasFocus() { - Q_ASSERT(engine); + Q_ASSERT(engine()); return engine()->newValue(qApp->hasFocus()); } @@ -107,7 +107,7 @@ void WindowScriptingInterface::alert(const QString& message) { /// \param const QString& message message to display /// \return ScriptValue `true` if 'Yes' was clicked, `false` otherwise ScriptValue WindowScriptingInterface::confirm(const QString& message) { - Q_ASSERT(engine); + Q_ASSERT(engine()); return engine()->newValue((QMessageBox::Yes == OffscreenUi::question("", message, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes))); } @@ -117,7 +117,7 @@ ScriptValue WindowScriptingInterface::confirm(const QString& message) { /// \return ScriptValue string text value in text box if the dialog was accepted, `null` otherwise. ScriptValue WindowScriptingInterface::prompt(const QString& message, const QString& defaultText) { QString result = OffscreenUi::getText(nullptr, "", message, QLineEdit::Normal, defaultText); - Q_ASSERT(engine); + Q_ASSERT(engine()); auto sResult = engine()->newValue(result); if (sResult.equals(engine()->newValue(""))) { return engine()->nullValue(); @@ -234,7 +234,7 @@ ScriptValue WindowScriptingInterface::browseDir(const QString& title, const QStr if (!result.isEmpty()) { setPreviousBrowseLocation(QFileInfo(result).absolutePath()); } - Q_ASSERT(engine); + Q_ASSERT(engine()); return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result); } @@ -279,7 +279,7 @@ ScriptValue WindowScriptingInterface::browse(const QString& title, const QString if (!result.isEmpty()) { setPreviousBrowseLocation(QFileInfo(result).absolutePath()); } - Q_ASSERT(engine); + Q_ASSERT(engine()); return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result); } @@ -327,7 +327,7 @@ ScriptValue WindowScriptingInterface::save(const QString& title, const QString& if (!result.isEmpty()) { setPreviousBrowseLocation(QFileInfo(result).absolutePath()); } - Q_ASSERT(engine); + Q_ASSERT(engine()); return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result); } @@ -378,7 +378,7 @@ ScriptValue WindowScriptingInterface::browseAssets(const QString& title, const Q if (!result.isEmpty()) { setPreviousBrowseAssetLocation(QFileInfo(result).absolutePath()); } - Q_ASSERT(engine); + Q_ASSERT(engine()); return result.isEmpty() ? engine()->nullValue() : engine()->newValue(result); } diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 6eb77da4d7..16b217bc53 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -27,7 +27,9 @@ #endif #ifdef WIN32 +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 +#endif #include #include #include diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 21cfec65d4..4068f7c547 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -2566,7 +2566,7 @@ QDataStream& operator>>(QDataStream& in, AttachmentData& attachment) { void AttachmentDataObject::setModelURL(const QString& modelURL) { AttachmentData data = scriptvalue_cast(thisObject()); data.modelURL = modelURL; - Q_ASSERT(engine); + Q_ASSERT(engine()); thisObject() = engine()->toScriptValue(data); } @@ -2577,7 +2577,7 @@ QString AttachmentDataObject::getModelURL() const { void AttachmentDataObject::setJointName(const QString& jointName) { AttachmentData data = scriptvalue_cast(thisObject()); data.jointName = jointName; - Q_ASSERT(engine); + Q_ASSERT(engine()); thisObject() = engine()->toScriptValue(data); } @@ -2588,7 +2588,7 @@ QString AttachmentDataObject::getJointName() const { void AttachmentDataObject::setTranslation(const glm::vec3& translation) { AttachmentData data = scriptvalue_cast(thisObject()); data.translation = translation; - Q_ASSERT(engine); + Q_ASSERT(engine()); thisObject() = engine()->toScriptValue(data); } @@ -2599,7 +2599,7 @@ glm::vec3 AttachmentDataObject::getTranslation() const { void AttachmentDataObject::setRotation(const glm::quat& rotation) { AttachmentData data = scriptvalue_cast(thisObject()); data.rotation = rotation; - Q_ASSERT(engine); + Q_ASSERT(engine()); thisObject() = engine()->toScriptValue(data); } @@ -2610,7 +2610,7 @@ glm::quat AttachmentDataObject::getRotation() const { void AttachmentDataObject::setScale(float scale) { AttachmentData data = scriptvalue_cast(thisObject()); data.scale = scale; - Q_ASSERT(engine); + Q_ASSERT(engine()); thisObject() = engine()->toScriptValue(data); } @@ -2621,7 +2621,7 @@ float AttachmentDataObject::getScale() const { void AttachmentDataObject::setIsSoft(bool isSoft) { AttachmentData data = scriptvalue_cast(thisObject()); data.isSoft = isSoft; - Q_ASSERT(engine); + Q_ASSERT(engine()); thisObject() = engine()->toScriptValue(data); } diff --git a/libraries/graphics-scripting/CMakeLists.txt b/libraries/graphics-scripting/CMakeLists.txt index 3542704fc8..46dc2130ea 100644 --- a/libraries/graphics-scripting/CMakeLists.txt +++ b/libraries/graphics-scripting/CMakeLists.txt @@ -2,3 +2,7 @@ set(TARGET_NAME graphics-scripting) setup_hifi_library() link_hifi_libraries(shared networking graphics model-serializers image material-networking model-networking script-engine) include_hifi_library_headers(gpu) + +if (WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() \ No newline at end of file diff --git a/libraries/render-utils/src/text/Font.cpp b/libraries/render-utils/src/text/Font.cpp index 81cdaa51c9..d95eca2c6b 100644 --- a/libraries/render-utils/src/text/Font.cpp +++ b/libraries/render-utils/src/text/Font.cpp @@ -385,7 +385,7 @@ void Font::buildVertices(Font::DrawInfo& drawInfo, const QString& str, const glm std::vector quadBuilders; quadBuilders.reserve(glyphsAndCorners.size()); { - int i = glyphsAndCorners.size() - 1; + int i = (int)glyphsAndCorners.size() - 1; while (i >= 0) { auto nextGlyphAndCorner = glyphsAndCorners[i]; float rightSpacing = rightEdge - (nextGlyphAndCorner.second.x + nextGlyphAndCorner.first.d); @@ -410,7 +410,7 @@ void Font::buildVertices(Font::DrawInfo& drawInfo, const QString& str, const glm } // The quadBuilders is backwards now because we looped over the glyphs backwards to adjust their alignment - for (int i = quadBuilders.size() - 1; i >= 0; i--) { + for (int i = (int)quadBuilders.size() - 1; i >= 0; i--) { quint16 verticesOffset = numVertices; drawInfo.verticesBuffer->append(quadBuilders[i]); numVertices += VERTICES_PER_QUAD; diff --git a/libraries/script-engine/src/AssetScriptingInterface.cpp b/libraries/script-engine/src/AssetScriptingInterface.cpp index dd28cf74ee..f412d9d2d6 100644 --- a/libraries/script-engine/src/AssetScriptingInterface.cpp +++ b/libraries/script-engine/src/AssetScriptingInterface.cpp @@ -74,7 +74,7 @@ void AssetScriptingInterface::uploadData(QString data, const ScriptValue& callba auto upload = DependencyManager::get()->createUpload(dataByteArray); Promise deferred = makePromise(__FUNCTION__); - Q_ASSERT(engine); + Q_ASSERT(engine()); auto scriptEngine = engine(); deferred->ready([=](QString error, QVariantMap result) { auto url = result.value("url").toString(); @@ -98,7 +98,7 @@ void AssetScriptingInterface::setMapping(QString path, QString hash, const Scrip auto handler = jsBindCallback(thisObject(), callback); auto setMappingRequest = assetClient()->createSetMappingRequest(path, hash); Promise deferred = makePromise(__FUNCTION__); - Q_ASSERT(engine); + Q_ASSERT(engine()); auto scriptEngine = engine(); deferred->ready([=](QString error, QVariantMap result) { jsCallback(handler, scriptEngine->newValue(error), result); @@ -136,7 +136,7 @@ void AssetScriptingInterface::downloadData(QString urlString, const ScriptValue& auto assetRequest = assetClient->createRequest(hash); Promise deferred = makePromise(__FUNCTION__); - Q_ASSERT(engine); + Q_ASSERT(engine()); auto scriptEngine = engine(); deferred->ready([=](QString error, QVariantMap result) { // FIXME: to remain backwards-compatible the signature here is "callback(data, n/a)" @@ -200,7 +200,7 @@ void AssetScriptingInterface::getMapping(QString asset, const ScriptValue& callb JS_VERIFY(AssetUtils::isValidFilePath(path), "invalid ATP file path: " + asset + "(path:"+path+")"); JS_VERIFY(callback.isFunction(), "expected second parameter to be a callback function"); Promise promise = getAssetInfo(path); - Q_ASSERT(engine); + Q_ASSERT(engine()); auto scriptEngine = engine(); promise->ready([=](QString error, QVariantMap result) { jsCallback(handler, scriptEngine->newValue(error), scriptEngine->newValue(result.value("hash").toString())); @@ -234,7 +234,7 @@ Promise AssetScriptingInterface::jsPromiseReady(Promise promise, const ScriptVal if (!jsVerify(handler.isValid(), "jsPromiseReady -- invalid callback handler")) { return nullptr; } - Q_ASSERT(engine); + Q_ASSERT(engine()); auto scriptEngine = engine(); return promise->ready([this, handler, scriptEngine](QString error, QVariantMap result) { jsCallback(handler, scriptEngine->newValue(error), result); @@ -244,7 +244,7 @@ Promise AssetScriptingInterface::jsPromiseReady(Promise promise, const ScriptVal void AssetScriptingInterface::jsCallback(const ScriptValue& handler, const ScriptValue& error, const ScriptValue& result) { Q_ASSERT(thread() == QThread::currentThread()); - Q_ASSERT(engine); + Q_ASSERT(engine()); //V8TODO: which kind of script context guard needs to be used here? ScriptContextGuard scriptContextGuard(_scriptManager->engine()->currentContext()); auto errorValue = !error.toBool() ? engine()->nullValue() : error; @@ -546,7 +546,7 @@ void AssetScriptingInterface::loadFromCache(const ScriptValue& options, const Sc } bool AssetScriptingInterface::canWriteCacheValue(const QUrl& url) { - Q_ASSERT(engine); + Q_ASSERT(engine()); auto scriptManager = engine()->manager(); if (!scriptManager) { return false; diff --git a/libraries/script-engine/src/ConsoleScriptingInterface.cpp b/libraries/script-engine/src/ConsoleScriptingInterface.cpp index 1c4c07dddd..ac55ec423e 100644 --- a/libraries/script-engine/src/ConsoleScriptingInterface.cpp +++ b/libraries/script-engine/src/ConsoleScriptingInterface.cpp @@ -82,14 +82,14 @@ ScriptValue ConsoleScriptingInterface::exception(ScriptContext* context, ScriptE void ConsoleScriptingInterface::time(QString labelName) { _timerDetails.insert(labelName, QDateTime::currentDateTime().toUTC()); QString message = QString("%1: Timer started").arg(labelName); - Q_ASSERT(engine); + Q_ASSERT(engine()); if (ScriptManager* scriptManager = engine()->manager()) { scriptManager->scriptPrintedMessage(message, context()->currentFileName(), context()->currentLineNumber()); } } void ConsoleScriptingInterface::timeEnd(QString labelName) { - Q_ASSERT(engine); + Q_ASSERT(engine()); if (ScriptManager* scriptManager = engine()->manager()) { if (!_timerDetails.contains(labelName)) { scriptManager->scriptErrorMessage("No such label found " + labelName, context()->currentFileName(), context()->currentLineNumber()); @@ -138,7 +138,7 @@ ScriptValue ConsoleScriptingInterface::assertion(ScriptContext* context, ScriptE } void ConsoleScriptingInterface::trace() { - Q_ASSERT(engine); + Q_ASSERT(engine()); ScriptEnginePointer scriptEngine = engine(); if (ScriptManager* scriptManager = scriptEngine->manager()) { scriptManager->scriptPrintedMessage @@ -148,7 +148,7 @@ void ConsoleScriptingInterface::trace() { } void ConsoleScriptingInterface::clear() { - Q_ASSERT(engine); + Q_ASSERT(engine()); if (ScriptManager* scriptManager = engine()->manager()) { scriptManager->clearDebugLogWindow(); } diff --git a/libraries/script-engine/src/Mat4.cpp b/libraries/script-engine/src/Mat4.cpp index fefcf6a0f6..a333d28ef8 100644 --- a/libraries/script-engine/src/Mat4.cpp +++ b/libraries/script-engine/src/Mat4.cpp @@ -90,7 +90,7 @@ void Mat4::print(const QString& label, const glm::mat4& m, bool transpose) const QString message = QString("%1 %2").arg(qPrintable(label)); message = message.arg(glm::to_string(out).c_str()); qCDebug(scriptengine) << message; - Q_ASSERT(engine); + Q_ASSERT(engine()); if (ScriptManager* scriptManager = engine()->manager()) { scriptManager->print(message); } diff --git a/libraries/script-engine/src/Quat.cpp b/libraries/script-engine/src/Quat.cpp index 492534f021..3c882d7292 100644 --- a/libraries/script-engine/src/Quat.cpp +++ b/libraries/script-engine/src/Quat.cpp @@ -126,7 +126,7 @@ void Quat::print(const QString& label, const glm::quat& q, bool asDegrees) { message = message.arg(glm::to_string(glm::dquat(q)).c_str()); } qCDebug(scriptengine) << message; - Q_ASSERT(engine); + Q_ASSERT(engine()); if (ScriptManager* scriptManager = engine()->manager()) { scriptManager->print(message); } diff --git a/libraries/script-engine/src/ScriptUUID.cpp b/libraries/script-engine/src/ScriptUUID.cpp index a6c054d2f6..376796c0dd 100644 --- a/libraries/script-engine/src/ScriptUUID.cpp +++ b/libraries/script-engine/src/ScriptUUID.cpp @@ -45,7 +45,7 @@ void ScriptUUID::print(const QString& label, const QUuid& id) { QString message = QString("%1 %2").arg(qPrintable(label)); message = message.arg(id.toString()); qCDebug(scriptengine) << message; - Q_ASSERT(engine); + Q_ASSERT(engine()); if (ScriptManager* scriptManager = engine()->manager()) { scriptManager->print(message); } diff --git a/libraries/script-engine/src/Vec3.cpp b/libraries/script-engine/src/Vec3.cpp index 6b689d4c4c..95897dc276 100644 --- a/libraries/script-engine/src/Vec3.cpp +++ b/libraries/script-engine/src/Vec3.cpp @@ -39,7 +39,7 @@ void Vec3::print(const QString& label, const glm::vec3& v) { QString message = QString("%1 %2").arg(qPrintable(label)); message = message.arg(glm::to_string(glm::dvec3(v)).c_str()); qCDebug(scriptengine) << message; - Q_ASSERT(engine); + Q_ASSERT(engine()); if (ScriptManager* scriptManager = engine()->manager()) { scriptManager->print(message); } diff --git a/libraries/script-engine/src/v8/ScriptEngineV8.cpp b/libraries/script-engine/src/v8/ScriptEngineV8.cpp index 1b92fa8c56..5a9dead93f 100644 --- a/libraries/script-engine/src/v8/ScriptEngineV8.cpp +++ b/libraries/script-engine/src/v8/ScriptEngineV8.cpp @@ -539,7 +539,7 @@ void ScriptEngineV8::storeGlobalObjectContents() { v8::Local globalMemberObjects = v8::Object::New(_v8Isolate); auto globalMemberNames = context->Global()->GetPropertyNames(context).ToLocalChecked(); - for (size_t i = 0; i < globalMemberNames->Length(); i++) { + for (uint32_t i = 0; i < globalMemberNames->Length(); i++) { auto name = globalMemberNames->Get(context, i).ToLocalChecked(); if(!globalMemberObjects->Set(context, name, context->Global()->Get(context, name).ToLocalChecked()).FromMaybe(false)) { Q_ASSERT(false); @@ -645,7 +645,7 @@ ScriptValue ScriptEngineV8::evaluateInClosure(const ScriptValue& _closure, // Since V8 cannot use arbitrary object as global object, objects from main global need to be copied to closure's global object auto globalObjectContents = _globalObjectContents.Get(_v8Isolate); auto globalMemberNames = globalObjectContents->GetPropertyNames(globalObjectContents->CreationContext()).ToLocalChecked(); - for (size_t i = 0; i < globalMemberNames->Length(); i++) { + for (uint32_t i = 0; i < globalMemberNames->Length(); i++) { auto name = globalMemberNames->Get(closureContext, i).ToLocalChecked(); if(!closureContext->Global()->Set(closureContext, name, globalObjectContents->Get(globalObjectContents->CreationContext(), name).ToLocalChecked()).FromMaybe(false)) { Q_ASSERT(false); @@ -656,7 +656,7 @@ ScriptValue ScriptEngineV8::evaluateInClosure(const ScriptValue& _closure, // Objects from closure need to be copied to global object too // V8TODO: I'm not sure which context to use with Get auto closureMemberNames = closureObject->GetPropertyNames(closureContext).ToLocalChecked(); - for (size_t i = 0; i < closureMemberNames->Length(); i++) { + for (uint32_t i = 0; i < closureMemberNames->Length(); i++) { auto name = closureMemberNames->Get(closureContext, i).ToLocalChecked(); if(!closureContext->Global()->Set(closureContext, name, closureObject->Get(closureContext, name).ToLocalChecked()).FromMaybe(false)) { Q_ASSERT(false); @@ -717,7 +717,7 @@ ScriptValue ScriptEngineV8::evaluateInClosure(const ScriptValue& _closure, auto requireMemberNames = oldRequireObject->GetPropertyNames(oldRequireObject->CreationContext()).ToLocalChecked(); - for (size_t i = 0; i < requireMemberNames->Length(); i++) { + for (uint32_t i = 0; i < requireMemberNames->Length(); i++) { auto name = requireMemberNames->Get(closureContext, i).ToLocalChecked(); v8::Local oldObject; if (!oldRequireObject->Get(oldRequireObject->CreationContext(), name).ToLocal(&oldObject)) { diff --git a/libraries/shared/src/PortableHighResolutionClock.h b/libraries/shared/src/PortableHighResolutionClock.h index 5650a27f3c..a13f23bf16 100644 --- a/libraries/shared/src/PortableHighResolutionClock.h +++ b/libraries/shared/src/PortableHighResolutionClock.h @@ -25,7 +25,9 @@ #if defined(_MSC_VER) && _MSC_VER < 1900 +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include // The following struct is not compliant with the HF coding standard, but uses underscores to match the classes diff --git a/libraries/shared/src/shared/WebRTC.h b/libraries/shared/src/shared/WebRTC.h index 9f3c954b60..1ddccd8428 100644 --- a/libraries/shared/src/shared/WebRTC.h +++ b/libraries/shared/src/shared/WebRTC.h @@ -30,7 +30,9 @@ # define WEBRTC_DATA_CHANNELS 1 # define WEBRTC_WIN 1 # define NOMINMAX 1 +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN 1 +#endif #elif defined(Q_OS_ANDROID) // I don't yet have a working libwebrtc for android // # define WEBRTC_AUDIO 1 diff --git a/libraries/ui/CMakeLists.txt b/libraries/ui/CMakeLists.txt index 1af3ca0ba8..b9d41e3551 100644 --- a/libraries/ui/CMakeLists.txt +++ b/libraries/ui/CMakeLists.txt @@ -10,3 +10,7 @@ include_hifi_library_headers(controllers) # Required for some low level GL interaction in the OffscreenQMLSurface set(OpenGL_GL_PREFERENCE "GLVND") target_opengl() + +if (WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() \ No newline at end of file diff --git a/libraries/ui/src/ui/OffscreenQmlSurface.cpp b/libraries/ui/src/ui/OffscreenQmlSurface.cpp index b79a99b150..88c7329a4f 100644 --- a/libraries/ui/src/ui/OffscreenQmlSurface.cpp +++ b/libraries/ui/src/ui/OffscreenQmlSurface.cpp @@ -5,6 +5,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // + #include "OffscreenQmlSurface.h" #include @@ -41,6 +42,7 @@ #include #include #include + #include #include #include diff --git a/plugins/JSAPIExample/src/JSAPIExample.cpp b/plugins/JSAPIExample/src/JSAPIExample.cpp index ad23838e04..02b59ba412 100644 --- a/plugins/JSAPIExample/src/JSAPIExample.cpp +++ b/plugins/JSAPIExample/src/JSAPIExample.cpp @@ -165,7 +165,7 @@ namespace REPLACE_ME_WITH_UNIQUE_NAME { * settings = null; // optional best pratice; allows the object to be reclaimed ASAP by the JS garbage collector */ ScriptValue getScopedSettings(const QString& scope) { - Q_ASSERT(engine); + Q_ASSERT(engine()); auto engine = Scriptable::engine(); if (!engine) { return ScriptValue(); diff --git a/tools/nitpick/src/TestRunnerDesktop.cpp b/tools/nitpick/src/TestRunnerDesktop.cpp index a7f0e6689d..ca288cae56 100644 --- a/tools/nitpick/src/TestRunnerDesktop.cpp +++ b/tools/nitpick/src/TestRunnerDesktop.cpp @@ -4,6 +4,7 @@ // Created by Nissim Hadar on 1 Sept 2018. // Copyright 2013 High Fidelity, Inc. // Copyright 2020 Vircadia contributors. +// Copyright 2024 Overte e.V. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -177,7 +178,7 @@ void TestRunnerDesktop::run() { _user = nitpick->getSelectedUser(); // This will be restored at the end of the tests - saveExistingHighFidelityAppDataFolder(); + saveExistingAppDataFolder(); if (_usePreviousInstallationCheckBox->isChecked()) { installationComplete(); @@ -266,8 +267,8 @@ void TestRunnerDesktop::runInstaller() { folderName += QString(" - ") + getPRNumberFromURL(_url->text()); } - script.write((QString("cp -Rf \"$VOLUME/") + folderName + "/interface.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); - script.write((QString("cp -Rf \"$VOLUME/") + folderName + "/Sandbox.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); + script.write((QString("cp -Rf \"$VOLUME/") + folderName + "/interface.app\" \"" + _workingFolder + "/Overte/\"\n").toStdString().c_str()); + script.write((QString("cp -Rf \"$VOLUME/") + folderName + "/Sandbox.app\" \"" + _workingFolder + "/Overte/\"\n").toStdString().c_str()); script.write("hdiutil detach \"$VOLUME\"\n"); script.write("killall yes\n"); @@ -313,7 +314,7 @@ void TestRunnerDesktop::verifyInstallationSucceeded() { #endif } -void TestRunnerDesktop::saveExistingHighFidelityAppDataFolder() { +void TestRunnerDesktop::saveExistingAppDataFolder() { QString dataDirectory{ "NOT FOUND" }; #ifdef Q_OS_WIN dataDirectory = qgetenv("USERPROFILE") + "\\AppData\\Roaming"; @@ -339,9 +340,9 @@ void TestRunnerDesktop::saveExistingHighFidelityAppDataFolder() { // Copy an "empty" AppData folder (i.e. no entities) QDir canonicalAppDataFolder; #ifdef Q_OS_WIN - canonicalAppDataFolder = QDir::currentPath() + "/AppDataHighFidelity"; + canonicalAppDataFolder.setPath(QDir::currentPath() + "/AppDataOverte"); #elif defined Q_OS_MAC - canonicalAppDataFolder = QCoreApplication::applicationDirPath() + "/AppDataHighFidelity"; + canonicalAppDataFolder.setPath(QCoreApplication::applicationDirPath() + "/AppDataOverte"); #endif if (canonicalAppDataFolder.exists()) { copyFolder(canonicalAppDataFolder.path(), _appDataFolder.path()); @@ -566,7 +567,7 @@ void TestRunnerDesktop::evaluateResults() { void TestRunnerDesktop::automaticTestRunEvaluationComplete(const QString& zippedFolder, int numberOfFailures) { addBuildNumberToResults(zippedFolder); - restoreHighFidelityAppDataFolder(); + restoreAppDataFolder(); _statusLabel->setText("Testing complete"); @@ -604,7 +605,7 @@ void TestRunnerDesktop::addBuildNumberToResults(const QString& zippedFolderName) } } -void TestRunnerDesktop::restoreHighFidelityAppDataFolder() { +void TestRunnerDesktop::restoreAppDataFolder() { _appDataFolder.removeRecursively(); if (_savedAppDataFolder != QDir()) { diff --git a/tools/nitpick/src/TestRunnerDesktop.h b/tools/nitpick/src/TestRunnerDesktop.h index dce2dce2ba..ba9c66ac74 100644 --- a/tools/nitpick/src/TestRunnerDesktop.h +++ b/tools/nitpick/src/TestRunnerDesktop.h @@ -3,6 +3,7 @@ // // Created by Nissim Hadar on 1 Sept 2018. // Copyright 2013 High Fidelity, Inc. +// Copyright 2024 Overte e.V. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -52,8 +53,8 @@ public: void runInstaller(); void verifyInstallationSucceeded(); - void saveExistingHighFidelityAppDataFolder(); - void restoreHighFidelityAppDataFolder(); + void saveExistingAppDataFolder(); + void restoreAppDataFolder(); void createSnapshotFolder();