mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 14:46:55 +02:00
Update metatype registration in assetBakeTask
This commit is contained in:
parent
6b098bfc6a
commit
2eecb41337
2 changed files with 10 additions and 4 deletions
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include "BakeAssetTask.h"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include <QtCore/QThread>
|
||||
#include <QCoreApplication>
|
||||
|
||||
|
@ -20,14 +22,18 @@ static const int OVEN_STATUS_CODE_SUCCESS { 0 };
|
|||
static const int OVEN_STATUS_CODE_FAIL { 1 };
|
||||
static const int OVEN_STATUS_CODE_ABORT { 2 };
|
||||
|
||||
std::once_flag registerMetaTypesFlag;
|
||||
|
||||
BakeAssetTask::BakeAssetTask(const AssetHash& assetHash, const AssetPath& assetPath, const QString& filePath) :
|
||||
_assetHash(assetHash),
|
||||
_assetPath(assetPath),
|
||||
_filePath(filePath)
|
||||
{
|
||||
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
|
||||
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
|
||||
|
||||
std::call_once(registerMetaTypesFlag, []() {
|
||||
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
|
||||
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
|
||||
});
|
||||
}
|
||||
|
||||
void cleanupTempFiles(QString tempOutputDir, std::vector<QString> files) {
|
||||
|
|
|
@ -98,11 +98,11 @@ int PathUtils::removeTemporaryApplicationDirs(QString appName) {
|
|||
auto pid = match.capturedRef("pid").toLongLong();
|
||||
auto timestamp = match.capturedRef("timestamp");
|
||||
if (!processIsRunning(pid)) {
|
||||
qDebug() << " Removing old temporary directory: " << absoluteDirPath;
|
||||
qDebug() << " Removing old temporary directory: " << dir.absoluteFilePath();
|
||||
absoluteDirPath.removeRecursively();
|
||||
removed++;
|
||||
} else {
|
||||
qDebug() << " Not removing (process is running): " << dir.absoluteDir();
|
||||
qDebug() << " Not removing (process is running): " << dir.absoluteFilePath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue