mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 12:33:27 +02:00
Voxel import fix
This commit is contained in:
parent
c17476c985
commit
ef39d019ac
2 changed files with 54 additions and 40 deletions
|
@ -10,7 +10,6 @@
|
|||
#include <QStandardPaths>
|
||||
#include <QGridLayout>
|
||||
#include <QSplitter>
|
||||
#include <QApplication>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
@ -121,6 +120,8 @@ ImportDialog::ImportDialog(QWidget* parent) :
|
|||
setLayout();
|
||||
|
||||
connect(&_importButton, SIGNAL(pressed()), SLOT(import()));
|
||||
connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
|
||||
|
||||
connect(&_cancelButton, SIGNAL(pressed()), SLOT(close()));
|
||||
connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
|
||||
}
|
||||
|
@ -131,7 +132,6 @@ ImportDialog::~ImportDialog() {
|
|||
|
||||
void ImportDialog::import() {
|
||||
emit accepted();
|
||||
close();
|
||||
}
|
||||
|
||||
void ImportDialog::accept() {
|
||||
|
@ -251,7 +251,6 @@ void ImportDialog::setImportTypes() {
|
|||
QJsonObject fileFormatObject = fileFormat.toObject();
|
||||
|
||||
QString ext(fileFormatObject["extension"].toString());
|
||||
QString description(fileFormatObject.value("description").toString());
|
||||
QString icon(fileFormatObject.value("icon").toString());
|
||||
|
||||
if (formatsCounter > 0) {
|
||||
|
|
|
@ -103,6 +103,21 @@ int VoxelImporter::preImport() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
_filename = filename;
|
||||
|
||||
if (_nextTask) {
|
||||
delete _nextTask;
|
||||
}
|
||||
|
||||
_nextTask = new ImportTask(_filename);
|
||||
connect(_nextTask, SIGNAL(destroyed()), SLOT(launchTask()));
|
||||
|
||||
if (_currentTask != NULL) {
|
||||
_voxelTree.cancelImport();
|
||||
} else {
|
||||
launchTask();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue