mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +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
|
||||
|
||||
public:
|
||||
virtual ~Baker() = default;
|
||||
|
||||
bool shouldStop();
|
||||
|
||||
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() {
|
||||
Baker::abort();
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ class FBXBaker : public Baker {
|
|||
public:
|
||||
FBXBaker(const QUrl& fbxURL, TextureBakerThreadGetter textureThreadGetter,
|
||||
const QString& bakedOutputDir, const QString& originalOutputDir = "");
|
||||
~FBXBaker() override;
|
||||
|
||||
QUrl getFBXUrl() const { return _fbxURL; }
|
||||
QString getBakedFBXFilePath() const { return _bakedFBXFilePath; }
|
||||
|
|
Loading…
Reference in a new issue