Clean up Qt compatibility code

This commit is contained in:
Julian Groß 2022-02-19 13:05:02 +01:00
parent 28c736e02b
commit 92907bd122
44 changed files with 177 additions and 348 deletions

View file

@ -23,12 +23,7 @@ public:
AvatarAudioStream(bool isStereo, int numStaticJitterFrames = -1);
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
AvatarAudioStream(const AvatarAudioStream&);
AvatarAudioStream& operator= (const AvatarAudioStream&);
#else
Q_DISABLE_COPY(AvatarAudioStream)
#endif
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) override;
};

View file

@ -5,6 +5,7 @@
// Created by Stephen Birarda on 9/5/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2021 Vircadia contributors.
// Copyright 2022 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
@ -1062,11 +1063,7 @@ void AvatarMixer::parseDomainServerSettings(const QJsonObject& domainSettings) {
static const QString AVATAR_WHITELIST_OPTION = "avatar_whitelist";
_slaveSharedData.skeletonURLWhitelist = avatarMixerGroupObject[AVATAR_WHITELIST_OPTION]
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
.toString().split(',', QString::KeepEmptyParts);
#else
.toString().split(',', Qt::KeepEmptyParts);
#endif
.toString().split(',', QTCOMPAT_KEEP_EMPTY_PARTS);
static const QString REPLACEMENT_AVATAR_OPTION = "replacement_avatar";
_slaveSharedData.skeletonReplacementURL = avatarMixerGroupObject[REPLACEMENT_AVATAR_OPTION]

View file

@ -5,6 +5,7 @@
// Created by Andrzej Kapolka on 5/10/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// Copyright 2022 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
@ -24,6 +25,8 @@
#include <gl/Config.h>
#include "QtCompatibility.h"
#include <QtCore/QResource>
#include <QtCore/QAbstractNativeEventFilter>
#include <QtCore/QCommandLineParser>
@ -3261,20 +3264,12 @@ void Application::initializeUi() {
auto newValidator = [=](const QUrl& url) -> bool {
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
QList<QString> safeURLS = { "" };
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
#else
safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), Qt::SkipEmptyParts);
#endif
safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QTCOMPAT_SKIP_EMPTY_PARTS);
// PULL SAFEURLS FROM INTERFACE.JSON Settings
QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts);
#else
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), Qt::SkipEmptyParts);
#endif
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QTCOMPAT_SKIP_EMPTY_PARTS);
safeURLS += settingsSafeURLS;
// END PULL SAFEURLS FROM INTERFACE.JSON Settings
@ -8851,31 +8846,19 @@ void Application::initPlugins(const QStringList& arguments) {
parser.parse(arguments);
if (parser.isSet(display)) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
auto preferredDisplays = parser.value(display).split(',', QString::SkipEmptyParts);
#else
auto preferredDisplays = parser.value(display).split(',', Qt::SkipEmptyParts);
#endif
auto preferredDisplays = parser.value(display).split(',', QTCOMPAT_SKIP_EMPTY_PARTS);
qInfo() << "Setting prefered display plugins:" << preferredDisplays;
PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays);
}
if (parser.isSet(disableDisplays)) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
auto disabledDisplays = parser.value(disableDisplays).split(',', QString::SkipEmptyParts);
#else
auto disabledDisplays = parser.value(disableDisplays).split(',', Qt::SkipEmptyParts);
#endif
auto disabledDisplays = parser.value(disableDisplays).split(',', QTCOMPAT_SKIP_EMPTY_PARTS);
qInfo() << "Disabling following display plugins:" << disabledDisplays;
PluginManager::getInstance()->disableDisplays(disabledDisplays);
}
if (parser.isSet(disableInputs)) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
auto disabledInputs = parser.value(disableInputs).split(',', QString::SkipEmptyParts);
#else
auto disabledInputs = parser.value(disableInputs).split(',', Qt::SkipEmptyParts);
#endif
auto disabledInputs = parser.value(disableInputs).split(',', QTCOMPAT_SKIP_EMPTY_PARTS);
qInfo() << "Disabling following input plugins:" << disabledInputs;
PluginManager::getInstance()->disableInputs(disabledInputs);
}

View file

@ -5,6 +5,7 @@
// Created by Andrzej Kapolka on 5/10/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// Copyright 2022 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
@ -15,6 +16,7 @@
#include <functional>
#include "QtCompatibility.h"
#include <QtCore/QHash>
#include <QtCore/QPointer>
#include <QtCore/QSet>
@ -648,11 +650,7 @@ private:
EntityTreePointer _entityClipboard;
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
mutable QMutex _viewMutex { QMutex::Recursive };
#else
mutable QRecursiveMutex _viewMutex;
#endif
mutable QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_viewMutex);
ViewFrustum _viewFrustum; // current state of view frustum, perspective, orientation, etc.
ViewFrustum _displayViewFrustum;
@ -778,11 +776,7 @@ private:
bool _isMissingSequenceNumbers { false };
void checkChangeCursor();
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
mutable QMutex _changeCursorLock { QMutex::Recursive };
#else
mutable QRecursiveMutex _changeCursorLock;
#endif
mutable QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_changeCursorLock);
Qt::CursorShape _desiredCursor{ Qt::BlankCursor };
bool _cursorNeedsChanging { false };

View file

@ -22,12 +22,7 @@ public:
void simulate(float deltaTime) override;
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
MyHead(const Head&);
MyHead& operator= (const MyHead&);
#else
Q_DISABLE_COPY(MyHead)
#endif
};
#endif // hifi_MyHead_h

View file

@ -3,6 +3,7 @@
//
// Created by Sam Gateau on 29/6/2018.
// Copyright 2018 High Fidelity, Inc.
// Copyright 2022 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
@ -12,6 +13,7 @@
#include <gl/OffscreenGLCanvas.h>
#include <gl/GLWidget.h>
#include "QtCompatibility.h"
#include <qmutex.h>
#include <render/Engine.h>
@ -68,12 +70,7 @@ private:
void render_runRenderFrame(RenderArgs* renderArgs);
protected:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
mutable QMutex _renderArgsMutex{ QMutex::Recursive };
#else
mutable QRecursiveMutex _renderArgsMutex;
#endif
mutable QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_renderArgsMutex);
AppRenderArgs _appRenderArgs;
RateCounter<500> _renderLoopCounter;

View file

@ -4,6 +4,7 @@
//
// Modified by Zander Otavka on 7/15/15
// Copyright 2014 High Fidelity, Inc.
// Copyright 2022 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
@ -18,6 +19,7 @@
#ifndef hifi_Overlays_h
#define hifi_Overlays_h
#include "QtCompatibility.h"
#include <QMouseEvent>
#include <QReadWriteLock>
#include <QScriptValue>
@ -746,11 +748,7 @@ signals:
private:
void cleanupOverlaysToDelete();
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
mutable QMutex _mutex { QMutex::Recursive };
#else
mutable QRecursiveMutex _mutex;
#endif
mutable QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_mutex);
QMap<QUuid, Overlay::Pointer> _overlays;
QList<Overlay::Pointer> _overlaysToDelete;

View file

@ -45,12 +45,7 @@ protected:
QSharedPointer<Resource> _resource;
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
AnimNodeLoader(const AnimNodeLoader&) = delete;
AnimNodeLoader& operator=(const AnimNodeLoader&) = delete;
#else
Q_DISABLE_COPY(AnimNodeLoader)
#endif
};
#endif // hifi_AnimNodeLoader

View file

@ -184,12 +184,7 @@ protected:
QString _lastPlayedState;
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
AnimRandomSwitch(const AnimRandomSwitch&) = delete;
AnimRandomSwitch& operator=(const AnimRandomSwitch&) = delete;
#else
Q_DISABLE_COPY(AnimRandomSwitch)
#endif
};
#endif // hifi_AnimRandomSwitch_h

View file

@ -107,12 +107,7 @@ protected:
std::vector<Transition> _transitions;
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
State(const State&) = delete;
State& operator=(const State&) = delete;
#else
Q_DISABLE_COPY(State)
#endif
};
public:
@ -155,12 +150,7 @@ protected:
QString _currentStateVar;
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
AnimStateMachine(const AnimStateMachine&) = delete;
AnimStateMachine& operator=(const AnimStateMachine&) = delete;
#else
Q_DISABLE_COPY(AnimStateMachine)
#endif
};
#endif // hifi_AnimStateMachine_h

View file

@ -72,12 +72,7 @@ private:
bool wouldExceedLimits();
AudioInjectorManager() { createThread(); }
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
AudioInjectorManager(const AudioInjectorManager&) = delete;
AudioInjectorManager& operator=(const AudioInjectorManager&) = delete;
#else
Q_DISABLE_COPY(AudioInjectorManager)
#endif
void createThread();

View file

@ -28,12 +28,7 @@ public:
virtual const QUuid& getStreamIdentifier() const override { return _streamIdentifier; }
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
InjectedAudioStream(const InjectedAudioStream&);
InjectedAudioStream& operator= (const InjectedAudioStream&);
#else
Q_DISABLE_COPY(InjectedAudioStream)
#endif
AudioStreamStats getAudioStreamStats() const override;
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) override;

View file

@ -1887,12 +1887,7 @@ protected:
virtual void clearAvatarGrabData(const QUuid& grabID);
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
AvatarData(const AvatarData&);
AvatarData& operator= (const AvatarData&);
#else
Q_DISABLE_COPY(AvatarData)
#endif
friend void avatarStateFromFrame(const QByteArray& frameData, AvatarData* _avatar);
static QUrl _defaultFullAvatarModelUrl;

View file

@ -128,12 +128,7 @@ protected:
AvatarData* _owningAvatar;
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
HeadData(const HeadData&);
HeadData& operator= (const HeadData&);
#else
Q_DISABLE_COPY(HeadData)
#endif
void setHeadOrientation(const glm::quat& orientation);
};

View file

@ -1,6 +1,7 @@
//
// Created by Sam Gateau on 4/27/15.
// Copyright 2015 High Fidelity, Inc.
// Copyright 2022 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
@ -10,6 +11,8 @@
#include <set>
#include "QtCompatibility.h"
#include <QtCore/QThread>
#include <QtCore/QFile>
@ -738,11 +741,7 @@ Mapping::Pointer UserInputMapper::newMapping(const QString& mappingName) {
// if (request->getResult() == ResourceRequest::Success) {
// result = parseMapping(QString(request->getData()));
// } else {
// #if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
// qCWarning(controllers) << "Failed to load mapping url <" << jsonUrl << ">" << endl;
// #else
// qCWarning(controllers) << "Failed to load mapping url <" << jsonUrl << ">" << Qt::endl;
// #endif
// qCWarning(controllers) << "Failed to load mapping url <" << jsonUrl << ">" << QTCOMPAT_ENDL;
// }
// request->deleteLater();
// }
@ -1181,22 +1180,13 @@ Mapping::Pointer UserInputMapper::parseMapping(const QString& json) {
if (doc.isNull()) {
qCDebug(controllers) << "Invalid JSON...\n";
qCDebug(controllers) << error.errorString();
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qCDebug(controllers) << "JSON was:\n" << json << endl;
#else
qCDebug(controllers) << "JSON was:\n" << json << Qt::endl;
#endif
qCDebug(controllers) << "JSON was:\n" << json << QTCOMPAT_ENDL;
return Mapping::Pointer();
}
if (!doc.isObject()) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qWarning() << "Mapping json Document is not an object" << endl;
qCDebug(controllers) << "JSON was:\n" << json << endl;
#else
qWarning() << "Mapping json Document is not an object" << Qt::endl;
qCDebug(controllers) << "JSON was:\n" << json << Qt::endl;
#endif
qWarning() << "Mapping json Document is not an object" << QTCOMPAT_ENDL;
qCDebug(controllers) << "JSON was:\n" << json << QTCOMPAT_ENDL;
return Mapping::Pointer();
}
return parseMapping(doc.object());

View file

@ -2,6 +2,7 @@
// Created by Bradley Austin Davis Arnold on 2015/06/13
// Copyright 2015 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// Copyright 2022 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
@ -13,6 +14,7 @@
#include <atomic>
#include <cstdint>
#include "QtCompatibility.h"
#include <QtCore/QObject>
#include <QtCore/QMutex>
#include <QtCore/QPropertyAnimation>
@ -161,11 +163,7 @@ private:
// application specific position, when it's in desktop mode, the reticle position will simply move
// the system mouse.
glm::vec2 _reticlePositionInHMD { 0.0f, 0.0f };
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
mutable QMutex _reticleLock { QMutex::Recursive };
#else
mutable QRecursiveMutex _reticleLock;
#endif
mutable QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_reticleLock);
QPointF _lastKnownRealMouse;
bool _ignoreMouseMove { false };

View file

@ -4,6 +4,7 @@
//
// Created by Andrew Meadows on 2014.11.24
// Copyright 2014 High Fidelity, Inc.
// Copyright 2022 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
@ -15,6 +16,7 @@
#include <limits>
#include <unordered_set>
#include "QtCompatibility.h"
#include <QtCore/QObject>
#include <QVector>
@ -94,11 +96,7 @@ protected:
void callUpdateOnEntitiesThatNeedIt(uint64_t now);
virtual void sortEntitiesThatMoved();
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QMutex _mutex{ QMutex::Recursive };
#else
QRecursiveMutex _mutex;
#endif
QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_mutex);
SetOfEntities _entitiesToSort; // entities moved by simulation (and might need resort in EntityTree)
SetOfEntities _simpleKinematicEntities; // entities undergoing non-colliding kinematic motion

View file

@ -5,12 +5,15 @@
// Created by Brad Hefta-Gaub on 12/4/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// Copyright 2020 Vircadia contributors.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "EntityTree.h"
#include "QtCompatibility.h"
#include <QtCore/QDateTime>
#include <QtCore/QQueue>
#include <openssl/err.h>
@ -68,11 +71,7 @@ EntityTree::~EntityTree() {
}
void EntityTree::setEntityScriptSourceWhitelist(const QString& entityScriptSourceWhitelist) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
_entityScriptSourceWhitelist = entityScriptSourceWhitelist.split(',', QString::SkipEmptyParts);
#else
_entityScriptSourceWhitelist = entityScriptSourceWhitelist.split(',', Qt::SkipEmptyParts);
#endif
_entityScriptSourceWhitelist = entityScriptSourceWhitelist.split(',', QTCOMPAT_SKIP_EMPTY_PARTS);
}

View file

@ -163,12 +163,7 @@ private slots:
void postAccountSettingsError(QNetworkReply::NetworkError error);
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
AccountManager(AccountManager const& other) = delete;
void operator=(AccountManager const& other) = delete;
#else
Q_DISABLE_COPY(AccountManager);
#endif
void persistAccountToFile();

View file

@ -4,6 +4,7 @@
//
// Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc.
// Copyright 2022 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
@ -11,6 +12,7 @@
#include "AssetResourceRequest.h"
#include "QtCompatibility.h"
#include <QtCore/QLoggingCategory>
#include <Trace.h>
@ -59,11 +61,7 @@ void AssetResourceRequest::doSend() {
// We'll either have a hash or an ATP path to a file (that maps to a hash)
if (urlIsAssetHash(_url)) {
// We've detected that this is a hash - simply use AssetClient to request that asset
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
auto parts = _url.path().split(".", QString::SkipEmptyParts);
#else
auto parts = _url.path().split(".", Qt::SkipEmptyParts);
#endif
auto parts = _url.path().split(".", QTCOMPAT_SKIP_EMPTY_PARTS);
auto hash = parts.length() > 0 ? parts[0] : "";
requestHash(hash);

View file

@ -4,6 +4,7 @@
//
// Created by Simon Walton on 3/19/2018.
// Copyright 2018 High Fidelity, Inc.
// Copyright 2022 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
@ -14,6 +15,7 @@
#include <vector>
#include <memory>
#include "QtCompatibility.h"
#include <QtCore/QMutex>
class QUuid;
@ -39,11 +41,7 @@ public:
HMACHash result();
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QMutex _lock { QMutex::Recursive };
#else
QRecursiveMutex _lock;
#endif
QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_lock);
struct hmac_ctx_st* _hmacContext;
AuthMethod _authMethod;
};

View file

@ -28,18 +28,10 @@ public:
qint64 getMaxSegmentSize() const override { return NLPacket::maxPayloadSize(_packetType, _isOrdered); }
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
NLPacketList(PacketType packetType, QByteArray extendedHeader = QByteArray(), bool isReliable = false,
bool isOrdered = false);
NLPacketList(udt::PacketList&& packetList);
NLPacketList(const NLPacketList& other) = delete;
NLPacketList& operator=(const NLPacketList& other) = delete;
#else
Q_DISABLE_COPY(NLPacketList)
NLPacketList(PacketType packetType, QByteArray extendedHeader = QByteArray(), bool isReliable = false,
bool isOrdered = false);
NLPacketList(udt::PacketList&& packetList);
#endif
virtual std::unique_ptr<udt::Packet> createPacket() override;

View file

@ -109,12 +109,7 @@ public:
float getOutboundKbps() const;
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
Node(const Node &otherNode);
Node& operator=(Node otherNode);
#else
Q_DISABLE_COPY(Node)
#endif
NodeType_t _type;

View file

@ -156,20 +156,11 @@ private slots:
void maybeSendIgnoreSetToNode(SharedNodePointer node);
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
NodeList() : LimitedNodeList(INVALID_PORT, INVALID_PORT) {
assert(false); // Not implemented, needed for DependencyManager templates compile
}
NodeList(char ownerType, int socketListenPort = INVALID_PORT, int dtlsListenPort = INVALID_PORT);
NodeList(NodeList const&) = delete; // Don't implement, needed to avoid copies of singleton
void operator=(NodeList const&) = delete; // Don't implement, needed to avoid copies of singleton
#else
Q_DISABLE_COPY(NodeList)
NodeList() : LimitedNodeList(INVALID_PORT, INVALID_PORT) {
assert(false); // Not implemented, needed for DependencyManager templates compile
}
NodeList(char ownerType, int socketListenPort = INVALID_PORT, int dtlsListenPort = INVALID_PORT);
#endif
void processDomainServerAuthRequest(const QByteArray& packet);
void requestAuthForDomainServer();

View file

@ -64,12 +64,7 @@ protected:
SequenceNumber _sendCurrSeqNum; // current maximum seq num sent out
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
CongestionControl(const CongestionControl& other) = delete;
CongestionControl& operator=(const CongestionControl& other) = delete;
#else
Q_DISABLE_COPY(CongestionControl);
#endif
};

View file

@ -48,22 +48,12 @@ public:
void setType(Type type);
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
ControlPacket(Type type, qint64 size = -1);
ControlPacket(std::unique_ptr<char[]> data, qint64 size, const SockAddr& senderSockAddr);
ControlPacket(ControlPacket&& other);
ControlPacket(const ControlPacket& other) = delete;
ControlPacket& operator=(ControlPacket&& other);
ControlPacket& operator=(const ControlPacket& other) = delete;
#else
Q_DISABLE_COPY(ControlPacket)
ControlPacket(Type type, qint64 size = -1);
ControlPacket(std::unique_ptr<char[]> data, qint64 size, const SockAddr& senderSockAddr);
ControlPacket(ControlPacket&& other);
ControlPacket& operator=(ControlPacket&& other);
#endif
// Header read/write
void readType();

View file

@ -85,12 +85,7 @@ private:
friend class SendQueue;
friend class Socket;
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
PacketList(const PacketList& other) = delete;
PacketList& operator=(const PacketList& other) = delete;
#else
Q_DISABLE_COPY(PacketList)
#endif
// Takes the first packet of the list and returns it.
template<typename T> std::unique_ptr<T> takeFront();

View file

@ -5,6 +5,7 @@
// Created by Clement on 7/21/15.
// Copyright 2015 High Fidelity, Inc.
// Copyright 2021 Vircadia contributors.
// Copyright 2022 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
@ -21,6 +22,7 @@
#include <mutex>
#include <unordered_map>
#include "QtCompatibility.h"
#include <QtCore/QObject>
#include <QtCore/QReadWriteLock>
@ -90,12 +92,7 @@ private slots:
void run();
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
SendQueue(SendQueue& other) = delete;
SendQueue(SendQueue&& other) = delete;
#else
Q_DISABLE_COPY_MOVE(SendQueue)
#endif
SendQueue(Socket* socket, SockAddr dest, SequenceNumber currentSequenceNumber,
MessageNumber currentMessageNumber, bool hasReceivedHandshakeACK);

View file

@ -4,6 +4,7 @@
//
// Created by Brad Hefta-Gaub on 8/12/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2022 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
@ -14,6 +15,8 @@
#include <unordered_map>
#include "QtCompatibility.h"
#include <PacketSender.h>
#include <udt/PacketHeaders.h>
@ -93,11 +96,7 @@ protected:
int _maxPendingMessages;
bool _releaseQueuedMessagesPending;
QMutex _pendingPacketsLock;
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QMutex _packetsQueueLock{ QMutex::Recursive };
#else
QRecursiveMutex _packetsQueueLock; // don't let different threads release the queue while another thread is writing to it
#endif
QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_packetsQueueLock); // don't let different threads release the queue while another thread is writing to it
std::list<EditMessagePair> _preServerEdits; // these will get packed into other larger packets
std::list<std::unique_ptr<NLPacket>> _preServerSingleMessagePackets; // these will go out as is

View file

@ -4,6 +4,7 @@
//
// Created by Andrew Meadows 2015.04.27
// Copyright 2015 High Fidelity, Inc.
// Copyright 2022 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
@ -16,6 +17,8 @@
#include <map>
#include <set>
#include "QtCompatibility.h"
#include <btBulletDynamicsCommon.h>
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
@ -129,11 +132,7 @@ private:
QList<EntityDynamicPointer> _dynamicsToAdd;
QSet<QUuid> _dynamicsToRemove;
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QMutex _dynamicsMutex { QMutex::Recursive };
#else
QRecursiveMutex _dynamicsMutex;
#endif
QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_dynamicsMutex);
workload::SpacePointer _space;
uint64_t _nextBidExpiry;

View file

@ -4,6 +4,7 @@
//
// Created by Andrzej Kapolka on 10/18/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2022 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
@ -11,6 +12,7 @@
#include "Model.h"
#include "QtCompatibility.h"
#include <QMetaType>
#include <QRunnable>
#include <QThreadPool>
@ -1637,11 +1639,8 @@ std::set<unsigned int> Model::getMeshIDsFromMaterialID(QString parentMaterialNam
};
if (parentMaterialName.length() > 2 && parentMaterialName.startsWith("[") && parentMaterialName.endsWith("]")) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QStringList list = parentMaterialName.split(",", QString::SkipEmptyParts);
#else
QStringList list = parentMaterialName.split(",", Qt::SkipEmptyParts);
#endif
QStringList list = parentMaterialName.split(",", QTCOMPAT_SKIP_EMPTY_PARTS);
for (int i = 0; i < list.length(); i++) {
auto& target = list[i];
if (i == 0) {

View file

@ -4,6 +4,7 @@
//
// Created by Andrzej Kapolka on 10/18/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2022 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
@ -12,6 +13,7 @@
#ifndef hifi_Model_h
#define hifi_Model_h
#include "QtCompatibility.h"
#include <QBitArray>
#include <QObject>
#include <QUrl>
@ -444,11 +446,7 @@ protected:
QVector<float> _blendedBlendshapeCoefficients;
int _blendNumber { 0 };
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
mutable QMutex _mutex{ QMutex::Recursive };
#else
mutable QRecursiveMutex _mutex;
#endif
mutable QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_mutex);
bool _overrideModelTransform { false };
bool _triangleSetsValid { false };

View file

@ -4,6 +4,7 @@
//
// Created by Brad Hefta-Gaub on 12/14/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2022 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
@ -14,6 +15,7 @@
#include <chrono>
#include <thread>
#include "QtCompatibility.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QEventLoop>
#include <QtCore/QFileInfo>
@ -187,11 +189,8 @@ void inputControllerFromScriptValue(const QScriptValue &object, controller::Inpu
//
// Extract the url portion of a url that has been encoded with encodeEntityIdIntoEntityUrl(...)
QString extractUrlFromEntityUrl(const QString& url) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
auto parts = url.split(' ', QString::SkipEmptyParts);
#else
auto parts = url.split(' ', Qt::SkipEmptyParts);
#endif
auto parts = url.split(' ', QTCOMPAT_SKIP_EMPTY_PARTS);
if (parts.length() > 0) {
return parts[0];
} else {
@ -2390,11 +2389,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
bool passList = false; // assume unsafe
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
QList<QString> safeURLPrefixes = { "file:///", "atp:", "cache:" };
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
#else
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), Qt::SkipEmptyParts);
#endif
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QTCOMPAT_SKIP_EMPTY_PARTS);
// Entity Script Whitelist toggle check.
Setting::Handle<bool> whitelistEnabled {"private/whitelistEnabled", false };
@ -2405,11 +2400,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
// Pull SAFEURLS from the Interface.JSON settings.
QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts);
#else
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), Qt::SkipEmptyParts);
#endif
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QTCOMPAT_SKIP_EMPTY_PARTS);
safeURLPrefixes += settingsSafeURLS;
// END Pull SAFEURLS from the Interface.JSON settings.

View file

@ -4,6 +4,7 @@
//
// Created by Clément Brisset on 12/10/14.
// Copyright 2014 High Fidelity, Inc.
// Copyright 2022 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
@ -12,6 +13,7 @@
#ifndef hifi_DependencyManager_h
#define hifi_DependencyManager_h
#include "QtCompatibility.h"
#include <QtGlobal>
#include <QDebug>
#include <QHash>
@ -89,11 +91,7 @@ private:
QHash<size_t, QSharedPointer<Dependency>> _instanceHash;
QHash<size_t, size_t> _inheritanceHash;
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
mutable QMutex _instanceHashMutex { QMutex::Recursive };
#else
mutable QRecursiveMutex _instanceHashMutex;
#endif
mutable QTCOMPAT_DECLARE_RECURSIVE_MUTEX(_instanceHashMutex);
mutable QMutex _inheritanceHashMutex;
bool _exiting { false };

View file

@ -0,0 +1,60 @@
//
// QtCompatibility.h
//
// Created by Julian Groß on 2022-02-04
// Copyright 2022 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
//
#include <QtGlobal>
// Compatibility with Qt < 5.13
#ifndef Q_DISABLE_COPY
#define Q_DISABLE_COPY(className) \
className(const className &) = delete;\
className &operator=(const className &) = delete;
#endif
// Compatibility with Qt < 5.13
#ifndef Q_DISABLE_COPY_MOVE
#define Q_DISABLE_COPY_MOVE(className) \
className(className & other) = delete;\
className(className && other) = delete;
#endif
// Compatibility with Qt < 5.15
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
#define QTCOMPAT_ENDL endl
#else
#define QTCOMPAT_ENDL Qt::endl
#endif
// Compatibility with Qt < 5.15
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
#define QTCOMPAT_KEEP_EMPTY_PARTS QString::KeepEmptyParts
#else
#define QTCOMPAT_KEEP_EMPTY_PARTS Qt::KeepEmptyParts
#endif
// Compatibility with Qt < 5.15
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
#define QTCOMPAT_SPLIT_BEHAVIOR QString::SplitBehavior
#else
#define QTCOMPAT_SPLIT_BEHAVIOR Qt::SplitBehavior
#endif
// Compatibility with Qt < 5.15
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
#define QTCOMPAT_SKIP_EMPTY_PARTS QString::SkipEmptyParts
#else
#define QTCOMPAT_SKIP_EMPTY_PARTS Qt::SkipEmptyParts
#endif
// Compatibility with Qt < 5.14
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
#define QTCOMPAT_DECLARE_RECURSIVE_MUTEX(name) QMutex name { QMutex::Recursive }
#else
#define QTCOMPAT_DECLARE_RECURSIVE_MUTEX(name) QRecursiveMutex name
#endif

View file

@ -4,6 +4,7 @@
//
// Created by Stojce Slavkovski on 12/23/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2022 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
@ -14,6 +15,7 @@
#include <mutex>
#include "../QtCompatibility.h"
#include <QtCore/QDateTime>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
@ -67,15 +69,9 @@ QString FileUtils::readFile(const QString& filename) {
return result;
}
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
QStringList FileUtils::readLines(const QString& filename, QString::SplitBehavior splitBehavior) {
return readFile(filename).split(QRegularExpression("[\\r\\n]"), QString::SkipEmptyParts);
QStringList FileUtils::readLines(const QString& filename, QTCOMPAT_SPLIT_BEHAVIOR splitBehavior) {
return readFile(filename).split(QRegularExpression("[\\r\\n]"), QTCOMPAT_SKIP_EMPTY_PARTS);
}
#else
QStringList FileUtils::readLines(const QString& filename, Qt::SplitBehavior splitBehavior) {
return readFile(filename).split(QRegularExpression("[\\r\\n]"), Qt::SkipEmptyParts);
}
#endif
void FileUtils::locateFile(const QString& filePath) {

View file

@ -4,6 +4,7 @@
//
// Created by Stojce Slavkovski on 12/23/13.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2022 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
@ -12,6 +13,7 @@
#ifndef hifi_FileUtils_h
#define hifi_FileUtils_h
#include "../QtCompatibility.h"
#include <QtCore/QString>
class FileUtils {
@ -24,11 +26,7 @@ public:
static bool isRelative(const QString& fileName);
static QString standardPath(QString subfolder);
static QString readFile(const QString& filename);
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
static QStringList readLines(const QString& filename, QString::SplitBehavior splitBehavior = QString::KeepEmptyParts);
#else
static QStringList readLines(const QString& filename, Qt::SplitBehavior splitBehavior = Qt::KeepEmptyParts);
#endif
static QStringList readLines(const QString& filename, QTCOMPAT_SPLIT_BEHAVIOR splitBehavior = QTCOMPAT_KEEP_EMPTY_PARTS);
static QString replaceDateTimeTokens(const QString& path);
static QString computeDocumentPath(const QString& path);
static bool canCreateFile(const QString& fullPath);

View file

@ -141,11 +141,7 @@ public:
}
private:
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
MenuUserData(const MenuUserData&);
#else
Q_DISABLE_COPY(MenuUserData);
#endif
QMetaObject::Connection _shutdownConnection;
QMetaObject::Connection _changedConnection;

View file

@ -4,6 +4,7 @@
//
// Created by Seth Alves on 2016-10-5
// Copyright 2015 High Fidelity, Inc.
// Copyright 2022 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
@ -11,6 +12,7 @@
#include "ACClientApp.h"
#include "QtCompatibility.h"
#include <QDataStream>
#include <QThread>
#include <QLoggingCategory>
@ -49,11 +51,7 @@ ACClientApp::ACClientApp(int argc, char* argv[]) :
parser.addOption(listenPortOption);
if (!parser.parse(QCoreApplication::arguments())) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qCritical() << parser.errorText() << endl;
#else
qCritical() << parser.errorText() << Qt::endl;
#endif
qCritical() << parser.errorText() << QTCOMPAT_ENDL;
parser.showHelp();
Q_UNREACHABLE();
}

View file

@ -4,6 +4,7 @@
//
// Created by Seth Alves on 2017-3-15
// Copyright 2017 High Fidelity, Inc.
// Copyright 2022 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
@ -11,6 +12,7 @@
#include "ATPClientApp.h"
#include "QtCompatibility.h"
#include <QDataStream>
#include <QTextStream>
#include <QThread>
@ -59,11 +61,7 @@ ATPClientApp::ATPClientApp(int argc, char* argv[]) :
parser.addOption(listenPortOption);
if (!parser.parse(QCoreApplication::arguments())) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qCritical() << parser.errorText() << endl;
#else
qCritical() << parser.errorText() << Qt::endl;
#endif
qCritical() << parser.errorText() << QTCOMPAT_ENDL;
parser.showHelp();
Q_UNREACHABLE();
}

View file

@ -5,6 +5,7 @@
// Created by Seth Alves on 3/5/15.
// Copyright 2015 High Fidelity, Inc.
// Copyright 2021 Vircadia contributors.
// Copyright 2022 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
@ -12,6 +13,7 @@
#include "ICEClientApp.h"
#include "QtCompatibility.h"
#include <QDataStream>
#include <QLoggingCategory>
#include <QCommandLineParser>
@ -47,11 +49,7 @@ ICEClientApp::ICEClientApp(int argc, char* argv[]) :
parser.addOption(cacheSTUNOption);
if (!parser.parse(QCoreApplication::arguments())) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qCritical() << parser.errorText() << endl;
#else
qCritical() << parser.errorText() << Qt::endl;
#endif
qCritical() << parser.errorText() << QTCOMPAT_ENDL;
parser.showHelp();
Q_UNREACHABLE();
}

View file

@ -3,6 +3,7 @@
//
// Created by Nissim Hadar on 2 Nov 2017.
// Copyright 2013 High Fidelity, Inc.
// Copyright 2022 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
@ -10,6 +11,7 @@
#include "TestCreator.h"
#include <assert.h>
#include "QtCompatibility.h"
#include <QtCore/QTextStream>
#include <QDirIterator>
#include <QHostInfo>
@ -207,20 +209,11 @@ void TestCreator::appendTestResultsToFile(const TestResult& testResult, const QP
// Create text file describing the failure
QTextStream stream(&descriptionFile);
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
stream << "TestCreator in folder " << testResult._pathname.left(testResult._pathname.length() - 1) << endl; // remove trailing '/'
stream << "Expected image was " << testResult._expectedImageFilename << endl;
stream << "Actual image was " << testResult._actualImageFilename << endl;
stream << "Similarity index was " << testResult._errorGlobal << endl;
stream << "Worst tile was " << testResult._errorLocal << endl;
#else
stream << "TestCreator in folder " << testResult._pathname.left(testResult._pathname.length() - 1) << Qt::endl; // remove trailing '/'
stream << "Expected image was " << testResult._expectedImageFilename << Qt::endl;
stream << "Actual image was " << testResult._actualImageFilename << Qt::endl;
stream << "Similarity index was " << testResult._errorGlobal << Qt::endl;
stream << "Worst tile was " << testResult._errorLocal << Qt::endl;
#endif
stream << "TestCreator in folder " << testResult._pathname.left(testResult._pathname.length() - 1) << QTCOMPAT_ENDL; // remove trailing '/'
stream << "Expected image was " << testResult._expectedImageFilename << QTCOMPAT_ENDL;
stream << "Actual image was " << testResult._actualImageFilename << QTCOMPAT_ENDL;
stream << "Similarity index was " << testResult._errorGlobal << QTCOMPAT_ENDL;
stream << "Worst tile was " << testResult._errorLocal << QTCOMPAT_ENDL;
descriptionFile.close();
@ -424,11 +417,7 @@ void TestCreator::includeTest(QTextStream& textStream, const QString& testPathna
QString partialPath = extractPathFromTestsDown(testPathname);
QString partialPathWithoutTests = partialPath.right(partialPath.length() - 7);
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
textStream << "Script.include(testsRootPath + \"" << partialPathWithoutTests + "\");" << endl;
#else
textStream << "Script.include(testsRootPath + \"" << partialPathWithoutTests + "\");" << Qt::endl;
#endif
textStream << "Script.include(testsRootPath + \"" << partialPathWithoutTests + "\");" << QTCOMPAT_ENDL;
}
void TestCreator::createTests(const QString& clientProfile) {
@ -1007,73 +996,39 @@ void TestCreator::createRecursiveScript(const QString& directory, bool interacti
QTextStream textStream(&recursiveTestsFile);
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
textStream << "// This is an automatically generated file, created by nitpick" << endl;
#else
textStream << "// This is an automatically generated file, created by nitpick" << Qt::endl;
#endif
textStream << "// This is an automatically generated file, created by nitpick" << QTCOMPAT_ENDL;
// Include 'nitpick.js'
QString branch = nitpick->getSelectedBranch();
QString user = nitpick->getSelectedUser();
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
textStream << "PATH_TO_THE_REPO_PATH_UTILS_FILE = \"https://raw.githubusercontent.com/" + user + "/hifi_tests/" + branch +
"/tests/utils/branchUtils.js\";"
<< endl;
textStream << "Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);" << endl << endl;
<< QTCOMPAT_ENDL;
textStream << "Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);" << QTCOMPAT_ENDL << QTCOMPAT_ENDL;
// The 'depth' variable is used to signal when to start running the recursive scripts
textStream << "if (typeof depth === 'undefined') {" << endl;
textStream << " depth = 0;" << endl;
textStream << " nitpick = createNitpick(Script.resolvePath(\".\"));" << endl;
textStream << " testsRootPath = nitpick.getTestsRootPath();" << endl << endl;
textStream << " nitpick.enableRecursive();" << endl;
textStream << " nitpick.enableAuto();" << endl;
textStream << "} else {" << endl;
textStream << " depth++" << endl;
textStream << "}" << endl << endl;
textStream << "if (typeof depth === 'undefined') {" << QTCOMPAT_ENDL;
textStream << " depth = 0;" << QTCOMPAT_ENDL;
textStream << " nitpick = createNitpick(Script.resolvePath(\".\"));" << QTCOMPAT_ENDL;
textStream << " testsRootPath = nitpick.getTestsRootPath();" << QTCOMPAT_ENDL << QTCOMPAT_ENDL;
textStream << " nitpick.enableRecursive();" << QTCOMPAT_ENDL;
textStream << " nitpick.enableAuto();" << QTCOMPAT_ENDL;
textStream << "} else {" << QTCOMPAT_ENDL;
textStream << " depth++" << QTCOMPAT_ENDL;
textStream << "}" << QTCOMPAT_ENDL << QTCOMPAT_ENDL;
// Now include the test scripts
for (int i = 0; i < directories.length(); ++i) {
includeTest(textStream, directories.at(i));
}
textStream << endl;
textStream << "if (depth > 0) {" << endl;
textStream << " depth--;" << endl;
textStream << "} else {" << endl;
textStream << " nitpick.runRecursive();" << endl;
textStream << "}" << endl << endl;
#else
textStream << "PATH_TO_THE_REPO_PATH_UTILS_FILE = \"https://raw.githubusercontent.com/" + user + "/hifi_tests/" + branch +
"/tests/utils/branchUtils.js\";"
<< Qt::endl;
textStream << "Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);" << Qt::endl << Qt::endl;
// The 'depth' variable is used to signal when to start running the recursive scripts
textStream << "if (typeof depth === 'undefined') {" << Qt::endl;
textStream << " depth = 0;" << Qt::endl;
textStream << " nitpick = createNitpick(Script.resolvePath(\".\"));" << Qt::endl;
textStream << " testsRootPath = nitpick.getTestsRootPath();" << Qt::endl << Qt::endl;
textStream << " nitpick.enableRecursive();" << Qt::endl;
textStream << " nitpick.enableAuto();" << Qt::endl;
textStream << "} else {" << Qt::endl;
textStream << " depth++" << Qt::endl;
textStream << "}" << Qt::endl << Qt::endl;
// Now include the test scripts
for (int i = 0; i < directories.length(); ++i) {
includeTest(textStream, directories.at(i));
}
textStream << Qt::endl;
textStream << "if (depth > 0) {" << Qt::endl;
textStream << " depth--;" << Qt::endl;
textStream << "} else {" << Qt::endl;
textStream << " nitpick.runRecursive();" << Qt::endl;
textStream << "}" << Qt::endl << Qt::endl;
#endif
textStream << QTCOMPAT_ENDL;
textStream << "if (depth > 0) {" << QTCOMPAT_ENDL;
textStream << " depth--;" << QTCOMPAT_ENDL;
textStream << "} else {" << QTCOMPAT_ENDL;
textStream << " nitpick.runRecursive();" << QTCOMPAT_ENDL;
textStream << "}" << QTCOMPAT_ENDL << QTCOMPAT_ENDL;
recursiveTestsFile.close();

View file

@ -4,12 +4,14 @@
//
// Created by Anthony Thibault on 11/4/16.
// Copyright 2016 High Fidelity, Inc.
// Copyright 2022 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
//
#include "SkeletonDumpApp.h"
#include "QtCompatibility.h"
#include <QCommandLineParser>
#include <QFile>
#include <FBXSerializer.h>
@ -29,11 +31,7 @@ SkeletonDumpApp::SkeletonDumpApp(int argc, char* argv[]) : QCoreApplication(argc
parser.addOption(inputFilenameOption);
if (!parser.parse(QCoreApplication::arguments())) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qCritical() << parser.errorText() << endl;
#else
qCritical() << parser.errorText() << Qt::endl;
#endif
qCritical() << parser.errorText() << QTCOMPAT_ENDL;
parser.showHelp();
_returnCode = 1;
return;

View file

@ -4,6 +4,7 @@
//
// Created by Seth Alves on 3/5/15.
// Copyright 2015 High Fidelity, Inc.
// Copyright 2022 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
@ -11,6 +12,7 @@
#include "VHACDUtilApp.h"
#include "QtCompatibility.h"
#include <QCommandLineParser>
#include <Trace.h>
@ -188,11 +190,7 @@ VHACDUtilApp::VHACDUtilApp(int argc, char* argv[]) :
if (!parser.parse(QCoreApplication::arguments())) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
qCritical() << parser.errorText() << endl;
#else
qCritical() << parser.errorText() << Qt::endl;
#endif
qCritical() << parser.errorText() << QTCOMPAT_ENDL;
parser.showHelp();
Q_UNREACHABLE();
}