Remove _outputDir from BakeAssetTask

This commit is contained in:
Ryan Huffman 2017-12-08 17:56:33 -08:00
parent 5cf2ab5cbd
commit 65649fc331
2 changed files with 4 additions and 4 deletions

View file

@ -58,7 +58,6 @@ void BakeAssetTask::run() {
} }
QString tempOutputDir = PathUtils::generateTemporaryDir(); QString tempOutputDir = PathUtils::generateTemporaryDir();
_outputDir = tempOutputDir;
auto base = QFileInfo(QCoreApplication::applicationFilePath()).absoluteDir(); auto base = QFileInfo(QCoreApplication::applicationFilePath()).absoluteDir();
QString path = base.absolutePath() + "/oven"; QString path = base.absolutePath() + "/oven";
QString extension = _assetPath.mid(_assetPath.lastIndexOf('.') + 1); QString extension = _assetPath.mid(_assetPath.lastIndexOf('.') + 1);
@ -82,7 +81,8 @@ void BakeAssetTask::run() {
emit bakeFailed(_assetHash, _assetPath, errors); emit bakeFailed(_assetHash, _assetPath, errors);
} }
} else if (exitCode == OVEN_STATUS_CODE_SUCCESS) { } else if (exitCode == OVEN_STATUS_CODE_SUCCESS) {
auto files = _outputDir.entryInfoList(QDir::Files); QDir outputDir = tempOutputDir;
auto files = outputDir.entryInfoList(QDir::Files);
QVector<QString> outputFiles; QVector<QString> outputFiles;
for (auto& file : files) { for (auto& file : files) {
outputFiles.push_back(file.absoluteFilePath()); outputFiles.push_back(file.absoluteFilePath());
@ -95,7 +95,8 @@ void BakeAssetTask::run() {
} else { } else {
QString errors; QString errors;
if (exitCode == OVEN_STATUS_CODE_FAIL) { if (exitCode == OVEN_STATUS_CODE_FAIL) {
auto errorFilePath = _outputDir.absoluteFilePath("errors.txt"); QDir outputDir = tempOutputDir;
auto errorFilePath = outputDir.absoluteFilePath("errors.txt");
QFile errorFile { errorFilePath }; QFile errorFile { errorFilePath };
if (errorFile.open(QIODevice::ReadOnly)) { if (errorFile.open(QIODevice::ReadOnly)) {
errors = errorFile.readAll(); errors = errorFile.readAll();

View file

@ -44,7 +44,6 @@ private:
AssetHash _assetHash; AssetHash _assetHash;
AssetPath _assetPath; AssetPath _assetPath;
QString _filePath; QString _filePath;
QDir _outputDir;
std::unique_ptr<QProcess> _ovenProcess { nullptr }; std::unique_ptr<QProcess> _ovenProcess { nullptr };
std::atomic<bool> _wasAborted { false }; std::atomic<bool> _wasAborted { false };
}; };