Commit b360e73f authored by Tobias Hunger's avatar Tobias Hunger
Browse files

JsonWizard: Use up-to-date file information



This avoids a new project being opened if you are trying to add a new
subproject to some existing project.

Change-Id: Ic5a2f4b0dedbfd6994c59e4944fc32b11d648871
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent cda0320f
...@@ -162,14 +162,12 @@ void JsonWizard::accept() ...@@ -162,14 +162,12 @@ void JsonWizard::accept()
Utils::Wizard::accept(); Utils::Wizard::accept();
QString errorMessage; QString errorMessage;
GeneratorFiles list = fileList(); if (fileList().isEmpty())
if (list.isEmpty())
return; return;
emit prePromptForOverwrite(m_files); emit prePromptForOverwrite(m_files);
JsonWizardGenerator::OverwriteResult overwrite = JsonWizardGenerator::OverwriteResult overwrite =
JsonWizardGenerator::promptForOverwrite(&list, &errorMessage); JsonWizardGenerator::promptForOverwrite(&m_files, &errorMessage);
if (overwrite == JsonWizardGenerator::OverwriteError) { if (overwrite == JsonWizardGenerator::OverwriteError) {
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Overwrite Files"), errorMessage); QMessageBox::warning(this, tr("Failed to Overwrite Files"), errorMessage);
...@@ -177,27 +175,27 @@ void JsonWizard::accept() ...@@ -177,27 +175,27 @@ void JsonWizard::accept()
} }
emit preFormatFiles(m_files); emit preFormatFiles(m_files);
if (!JsonWizardGenerator::formatFiles(this, &list, &errorMessage)) { if (!JsonWizardGenerator::formatFiles(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Format Files"), errorMessage); QMessageBox::warning(this, tr("Failed to Format Files"), errorMessage);
return; return;
} }
emit preWriteFiles(m_files); emit preWriteFiles(m_files);
if (!JsonWizardGenerator::writeFiles(this, &list, &errorMessage)) { if (!JsonWizardGenerator::writeFiles(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Write Files"), errorMessage); QMessageBox::warning(this, tr("Failed to Write Files"), errorMessage);
return; return;
} }
emit postProcessFiles(m_files); emit postProcessFiles(m_files);
if (!JsonWizardGenerator::postWrite(this, &list, &errorMessage)) { if (!JsonWizardGenerator::postWrite(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Post-Process Files"), errorMessage); QMessageBox::warning(this, tr("Failed to Post-Process Files"), errorMessage);
return; return;
} }
emit filesReady(m_files); emit filesReady(m_files);
if (!JsonWizardGenerator::allDone(this, &list, &errorMessage)) { if (!JsonWizardGenerator::allDone(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Open Files"), errorMessage); QMessageBox::warning(this, tr("Failed to Open Files"), errorMessage);
return; return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment