Merge pull request #114 from birarda/atp-mappings

fixes for styling and logging from CR
This commit is contained in:
Clément Brisset 2016-03-15 14:42:01 -07:00
commit 253b6e3067
5 changed files with 6 additions and 11 deletions

View file

@ -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 {

View file

@ -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);

View file

@ -225,8 +225,7 @@ void AssetMappingModel::refresh() {
lastItem = item;
_pathToItemMap[fullPath] = lastItem;
}
else {
} else {
lastItem = it.value();
}
}

View file

@ -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());

View file

@ -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);