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()
Utils::Wizard::accept();
QString errorMessage;
GeneratorFiles list = fileList();
if (list.isEmpty())
if (fileList().isEmpty())
return;
emit prePromptForOverwrite(m_files);
JsonWizardGenerator::OverwriteResult overwrite =
JsonWizardGenerator::promptForOverwrite(&list, &errorMessage);
JsonWizardGenerator::promptForOverwrite(&m_files, &errorMessage);
if (overwrite == JsonWizardGenerator::OverwriteError) {
if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Overwrite Files"), errorMessage);
......@@ -177,27 +175,27 @@ void JsonWizard::accept()
}
emit preFormatFiles(m_files);
if (!JsonWizardGenerator::formatFiles(this, &list, &errorMessage)) {
if (!JsonWizardGenerator::formatFiles(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Format Files"), errorMessage);
return;
}
emit preWriteFiles(m_files);
if (!JsonWizardGenerator::writeFiles(this, &list, &errorMessage)) {
if (!JsonWizardGenerator::writeFiles(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Write Files"), errorMessage);
return;
}
emit postProcessFiles(m_files);
if (!JsonWizardGenerator::postWrite(this, &list, &errorMessage)) {
if (!JsonWizardGenerator::postWrite(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Post-Process Files"), errorMessage);
return;
}
emit filesReady(m_files);
if (!JsonWizardGenerator::allDone(this, &list, &errorMessage)) {
if (!JsonWizardGenerator::allDone(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty())
QMessageBox::warning(this, tr("Failed to Open Files"), errorMessage);
return;
......
Markdown is supported
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