mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #114 from birarda/atp-mappings
fixes for styling and logging from CR
This commit is contained in:
commit
253b6e3067
5 changed files with 6 additions and 11 deletions
|
@ -222,8 +222,7 @@ void AssetServer::handleGetMappingOperation(ReceivedMessage& message, SharedNode
|
|||
auto assetHash = it->toString();
|
||||
replyPacket.writePrimitive(AssetServerError::NoError);
|
||||
replyPacket.write(QByteArray::fromHex(assetHash.toUtf8()));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
replyPacket.writePrimitive(AssetServerError::AssetNotFound);
|
||||
}
|
||||
}
|
||||
|
@ -578,7 +577,7 @@ bool AssetServer::deleteMappings(AssetPathList& paths) {
|
|||
if (sizeBefore != sizeNow) {
|
||||
qDebug() << "Deleted" << sizeBefore - sizeNow << "mappings in folder: " << path;
|
||||
} else {
|
||||
qDebug() << "Did not find any mappings in folder:" << path;
|
||||
qDebug() << "Did not find any mappings to delete in folder:" << path;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -4459,7 +4459,8 @@ void Application::toggleAssetServerWidget(QString filePath) {
|
|||
return;
|
||||
}
|
||||
|
||||
static const QUrl url("AssetServer.qml");
|
||||
static const QUrl url { "AssetServer.qml" };
|
||||
|
||||
auto startUpload = [=](QQmlContext* context, QObject* newObject){
|
||||
if (!filePath.isEmpty()) {
|
||||
emit uploadRequest(filePath);
|
||||
|
|
|
@ -225,8 +225,7 @@ void AssetMappingModel::refresh() {
|
|||
|
||||
lastItem = item;
|
||||
_pathToItemMap[fullPath] = lastItem;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
lastItem = it.value();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ AssetResourceRequest::~AssetResourceRequest() {
|
|||
}
|
||||
|
||||
bool AssetResourceRequest::urlIsAssetHash() const {
|
||||
static const QString ATP_HASH_REGEX_STRING = "^atp:([A-Fa-f0-9]{64})(\\.[\\w]+)?$";
|
||||
static const QString ATP_HASH_REGEX_STRING { "^atp:([A-Fa-f0-9]{64})(\\.[\\w]+)?$" };
|
||||
|
||||
QRegExp hashRegex { ATP_HASH_REGEX_STRING };
|
||||
return hashRegex.exactMatch(_url.toString());
|
||||
|
|
|
@ -50,10 +50,6 @@ void AssetScriptingInterface::downloadData(QString urlString, QScriptValue callb
|
|||
auto parts = path.split(".", QString::SkipEmptyParts);
|
||||
auto hash = parts.length() > 0 ? parts[0] : "";
|
||||
|
||||
if (hash.length() != SHA256_HASH_HEX_LENGTH) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto assetClient = DependencyManager::get<AssetClient>();
|
||||
auto assetRequest = assetClient->createRequest(hash);
|
||||
|
||||
|
|
Loading…
Reference in a new issue