mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 17:10:41 +02:00
Merge pull request #1302 from daleglass/qt5-fix-qstring-splitbehavior
Fix QString::SplitBehavior deprecation, replace with Qt::
This commit is contained in:
commit
6eb7b9ecff
6 changed files with 12 additions and 12 deletions
|
@ -3264,12 +3264,12 @@ void Application::initializeUi() {
|
||||||
auto newValidator = [=](const QUrl& url) -> bool {
|
auto newValidator = [=](const QUrl& url) -> bool {
|
||||||
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
|
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
|
||||||
QList<QString> safeURLS = { "" };
|
QList<QString> safeURLS = { "" };
|
||||||
safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
|
safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
// PULL SAFEURLS FROM INTERFACE.JSON Settings
|
// PULL SAFEURLS FROM INTERFACE.JSON Settings
|
||||||
|
|
||||||
QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
|
QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
|
||||||
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts);
|
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), Qt::SkipEmptyParts);
|
||||||
safeURLS += settingsSafeURLS;
|
safeURLS += settingsSafeURLS;
|
||||||
|
|
||||||
// END PULL SAFEURLS FROM INTERFACE.JSON Settings
|
// END PULL SAFEURLS FROM INTERFACE.JSON Settings
|
||||||
|
@ -8846,19 +8846,19 @@ void Application::initPlugins(const QStringList& arguments) {
|
||||||
parser.parse(arguments);
|
parser.parse(arguments);
|
||||||
|
|
||||||
if (parser.isSet(display)) {
|
if (parser.isSet(display)) {
|
||||||
auto preferredDisplays = parser.value(display).split(',', QString::SkipEmptyParts);
|
auto preferredDisplays = parser.value(display).split(',', Qt::SkipEmptyParts);
|
||||||
qInfo() << "Setting prefered display plugins:" << preferredDisplays;
|
qInfo() << "Setting prefered display plugins:" << preferredDisplays;
|
||||||
PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays);
|
PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parser.isSet(disableDisplays)) {
|
if (parser.isSet(disableDisplays)) {
|
||||||
auto disabledDisplays = parser.value(disableDisplays).split(',', QString::SkipEmptyParts);
|
auto disabledDisplays = parser.value(disableDisplays).split(',', Qt::SkipEmptyParts);
|
||||||
qInfo() << "Disabling following display plugins:" << disabledDisplays;
|
qInfo() << "Disabling following display plugins:" << disabledDisplays;
|
||||||
PluginManager::getInstance()->disableDisplays(disabledDisplays);
|
PluginManager::getInstance()->disableDisplays(disabledDisplays);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parser.isSet(disableInputs)) {
|
if (parser.isSet(disableInputs)) {
|
||||||
auto disabledInputs = parser.value(disableInputs).split(',', QString::SkipEmptyParts);
|
auto disabledInputs = parser.value(disableInputs).split(',', Qt::SkipEmptyParts);
|
||||||
qInfo() << "Disabling following input plugins:" << disabledInputs;
|
qInfo() << "Disabling following input plugins:" << disabledInputs;
|
||||||
PluginManager::getInstance()->disableInputs(disabledInputs);
|
PluginManager::getInstance()->disableInputs(disabledInputs);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ EntityTree::~EntityTree() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTree::setEntityScriptSourceWhitelist(const QString& entityScriptSourceWhitelist) {
|
void EntityTree::setEntityScriptSourceWhitelist(const QString& entityScriptSourceWhitelist) {
|
||||||
_entityScriptSourceWhitelist = entityScriptSourceWhitelist.split(',', QString::SkipEmptyParts);
|
_entityScriptSourceWhitelist = entityScriptSourceWhitelist.split(',', Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ void AssetResourceRequest::doSend() {
|
||||||
// We'll either have a hash or an ATP path to a file (that maps to a hash)
|
// We'll either have a hash or an ATP path to a file (that maps to a hash)
|
||||||
if (urlIsAssetHash(_url)) {
|
if (urlIsAssetHash(_url)) {
|
||||||
// We've detected that this is a hash - simply use AssetClient to request that asset
|
// We've detected that this is a hash - simply use AssetClient to request that asset
|
||||||
auto parts = _url.path().split(".", QString::SkipEmptyParts);
|
auto parts = _url.path().split(".", Qt::SkipEmptyParts);
|
||||||
auto hash = parts.length() > 0 ? parts[0] : "";
|
auto hash = parts.length() > 0 ? parts[0] : "";
|
||||||
|
|
||||||
requestHash(hash);
|
requestHash(hash);
|
||||||
|
|
|
@ -1624,7 +1624,7 @@ std::set<unsigned int> Model::getMeshIDsFromMaterialID(QString parentMaterialNam
|
||||||
};
|
};
|
||||||
|
|
||||||
if (parentMaterialName.length() > 2 && parentMaterialName.startsWith("[") && parentMaterialName.endsWith("]")) {
|
if (parentMaterialName.length() > 2 && parentMaterialName.startsWith("[") && parentMaterialName.endsWith("]")) {
|
||||||
QStringList list = parentMaterialName.split(",", QString::SkipEmptyParts);
|
QStringList list = parentMaterialName.split(",", Qt::SkipEmptyParts);
|
||||||
for (int i = 0; i < list.length(); i++) {
|
for (int i = 0; i < list.length(); i++) {
|
||||||
auto& target = list[i];
|
auto& target = list[i];
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
|
@ -187,7 +187,7 @@ void inputControllerFromScriptValue(const QScriptValue &object, controller::Inpu
|
||||||
//
|
//
|
||||||
// Extract the url portion of a url that has been encoded with encodeEntityIdIntoEntityUrl(...)
|
// Extract the url portion of a url that has been encoded with encodeEntityIdIntoEntityUrl(...)
|
||||||
QString extractUrlFromEntityUrl(const QString& url) {
|
QString extractUrlFromEntityUrl(const QString& url) {
|
||||||
auto parts = url.split(' ', QString::SkipEmptyParts);
|
auto parts = url.split(' ', Qt::SkipEmptyParts);
|
||||||
if (parts.length() > 0) {
|
if (parts.length() > 0) {
|
||||||
return parts[0];
|
return parts[0];
|
||||||
} else {
|
} else {
|
||||||
|
@ -2386,7 +2386,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
||||||
bool passList = false; // assume unsafe
|
bool passList = false; // assume unsafe
|
||||||
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
|
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
|
||||||
QList<QString> safeURLPrefixes = { "file:///", "atp:", "cache:" };
|
QList<QString> safeURLPrefixes = { "file:///", "atp:", "cache:" };
|
||||||
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
|
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
// Entity Script Whitelist toggle check.
|
// Entity Script Whitelist toggle check.
|
||||||
Setting::Handle<bool> whitelistEnabled {"private/whitelistEnabled", false };
|
Setting::Handle<bool> whitelistEnabled {"private/whitelistEnabled", false };
|
||||||
|
@ -2397,7 +2397,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
||||||
|
|
||||||
// Pull SAFEURLS from the Interface.JSON settings.
|
// Pull SAFEURLS from the Interface.JSON settings.
|
||||||
QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
|
QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
|
||||||
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts);
|
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), Qt::SkipEmptyParts);
|
||||||
safeURLPrefixes += settingsSafeURLS;
|
safeURLPrefixes += settingsSafeURLS;
|
||||||
// END Pull SAFEURLS from the Interface.JSON settings.
|
// END Pull SAFEURLS from the Interface.JSON settings.
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ QString FileUtils::readFile(const QString& filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList FileUtils::readLines(const QString& filename, QString::SplitBehavior splitBehavior) {
|
QStringList FileUtils::readLines(const QString& filename, QString::SplitBehavior splitBehavior) {
|
||||||
return readFile(filename).split(QRegularExpression("[\\r\\n]"), QString::SkipEmptyParts);
|
return readFile(filename).split(QRegularExpression("[\\r\\n]"), Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileUtils::locateFile(const QString& filePath) {
|
void FileUtils::locateFile(const QString& filePath) {
|
||||||
|
|
Loading…
Reference in a new issue