mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:38:27 +02:00
use categorized logging in ATPAssetMigrator
This commit is contained in:
parent
cc93767077
commit
d22c602041
1 changed files with 7 additions and 3 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QJsonDocument>
|
#include <QtCore/QJsonDocument>
|
||||||
#include <QtCore/QJsonObject>
|
#include <QtCore/QJsonObject>
|
||||||
|
#include <QtCore/QLoggingCategory>
|
||||||
#include <QtCore/QTemporaryFile>
|
#include <QtCore/QTemporaryFile>
|
||||||
#include <QtWidgets/QFileDialog>
|
#include <QtWidgets/QFileDialog>
|
||||||
#include <QtWidgets/QMessageBox>
|
#include <QtWidgets/QMessageBox>
|
||||||
|
@ -26,6 +27,9 @@
|
||||||
|
|
||||||
#include "../ui/AssetUploadDialogFactory.h"
|
#include "../ui/AssetUploadDialogFactory.h"
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(asset_migrator);
|
||||||
|
Q_LOGGING_CATEGORY(asset_migrator, "hf.asset_migrator");
|
||||||
|
|
||||||
ATPAssetMigrator& ATPAssetMigrator::getInstance() {
|
ATPAssetMigrator& ATPAssetMigrator::getInstance() {
|
||||||
static ATPAssetMigrator instance;
|
static ATPAssetMigrator instance;
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -40,7 +44,7 @@ void ATPAssetMigrator::loadEntityServerFile() {
|
||||||
QString(), QString("Entity-Server Content (*.gz)"));
|
QString(), QString("Entity-Server Content (*.gz)"));
|
||||||
|
|
||||||
if (!filename.isEmpty()) {
|
if (!filename.isEmpty()) {
|
||||||
qDebug() << "Selected filename for ATP asset migration: " << filename;
|
qCDebug(asset_migrator) << "Selected filename for ATP asset migration: " << filename;
|
||||||
|
|
||||||
static const QString MIGRATION_CONFIRMATION_TEXT {
|
static const QString MIGRATION_CONFIRMATION_TEXT {
|
||||||
"The ATP Asset Migration process will scan the selected entity-server file, upload discovered resources to the"\
|
"The ATP Asset Migration process will scan the selected entity-server file, upload discovered resources to the"\
|
||||||
|
@ -92,7 +96,7 @@ void ATPAssetMigrator::loadEntityServerFile() {
|
||||||
} else if (wantsToMigrateResource(modelURL)) {
|
} else if (wantsToMigrateResource(modelURL)) {
|
||||||
auto request = ResourceManager::createResourceRequest(this, modelURL);
|
auto request = ResourceManager::createResourceRequest(this, modelURL);
|
||||||
|
|
||||||
qDebug() << "Requesting" << modelURL << "for ATP asset migration";
|
qCDebug(asset_migrator) << "Requesting" << modelURL << "for ATP asset migration";
|
||||||
|
|
||||||
// add this combination of QUrl and QJsonValueRef to our multi hash so we can change the URL
|
// add this combination of QUrl and QJsonValueRef to our multi hash so we can change the URL
|
||||||
// to an ATP one once ready
|
// to an ATP one once ready
|
||||||
|
@ -138,7 +142,7 @@ void ATPAssetMigrator::migrateResource(ResourceRequest* request) {
|
||||||
// add this URL to our hash of AssetUpload to original URL
|
// add this URL to our hash of AssetUpload to original URL
|
||||||
_originalURLs.insert(upload, request->getUrl());
|
_originalURLs.insert(upload, request->getUrl());
|
||||||
|
|
||||||
qDebug() << "Starting upload of asset from" << request->getUrl();
|
qCDebug(asset_migrator) << "Starting upload of asset from" << request->getUrl();
|
||||||
|
|
||||||
// connect to the finished signal so we know when the AssetUpload is done
|
// connect to the finished signal so we know when the AssetUpload is done
|
||||||
QObject::connect(upload, &AssetUpload::finished, this, &ATPAssetMigrator::assetUploadFinished);
|
QObject::connect(upload, &AssetUpload::finished, this, &ATPAssetMigrator::assetUploadFinished);
|
||||||
|
|
Loading…
Reference in a new issue