mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 09:53:30 +02:00
Add removal of temporary files in FBXBaker
This commit is contained in:
parent
218d58df81
commit
de2c1aabac
3 changed files with 14 additions and 0 deletions
|
@ -18,6 +18,8 @@ class Baker : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual ~Baker() = default;
|
||||||
|
|
||||||
bool shouldStop();
|
bool shouldStop();
|
||||||
|
|
||||||
bool hasErrors() const { return !_errorList.isEmpty(); }
|
bool hasErrors() const { return !_errorList.isEmpty(); }
|
||||||
|
|
|
@ -56,6 +56,17 @@ FBXBaker::FBXBaker(const QUrl& fbxURL, TextureBakerThreadGetter textureThreadGet
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FBXBaker::~FBXBaker() {
|
||||||
|
if (_tempDir.exists()) {
|
||||||
|
if (!_tempDir.remove(_originalFBXFilePath)) {
|
||||||
|
qCWarning(model_baking) << "Failed to remove temporary copy of fbx file:" << _originalFBXFilePath;
|
||||||
|
}
|
||||||
|
if (!_tempDir.rmdir(".")) {
|
||||||
|
qCWarning(model_baking) << "Failed to remove temporary directory:" << _tempDir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FBXBaker::abort() {
|
void FBXBaker::abort() {
|
||||||
Baker::abort();
|
Baker::abort();
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ class FBXBaker : public Baker {
|
||||||
public:
|
public:
|
||||||
FBXBaker(const QUrl& fbxURL, TextureBakerThreadGetter textureThreadGetter,
|
FBXBaker(const QUrl& fbxURL, TextureBakerThreadGetter textureThreadGetter,
|
||||||
const QString& bakedOutputDir, const QString& originalOutputDir = "");
|
const QString& bakedOutputDir, const QString& originalOutputDir = "");
|
||||||
|
~FBXBaker() override;
|
||||||
|
|
||||||
QUrl getFBXUrl() const { return _fbxURL; }
|
QUrl getFBXUrl() const { return _fbxURL; }
|
||||||
QString getBakedFBXFilePath() const { return _bakedFBXFilePath; }
|
QString getBakedFBXFilePath() const { return _bakedFBXFilePath; }
|
||||||
|
|
Loading…
Reference in a new issue