Delete QMessageBox after usage

Change-Id: Icba5fddb5596f263f2cbb19f91b6ce95ca7785c6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Montel Laurent
2017-02-21 10:04:31 +01:00
committed by Laurent Montel
parent 2cf2aca136
commit 44802d754e
2 changed files with 12 additions and 12 deletions

View File

@@ -894,18 +894,18 @@ void SessionManagerPrivate::askUserAboutFailedProjects()
if (!failedProjects.isEmpty()) {
QString fileList =
QDir::toNativeSeparators(failedProjects.join(QLatin1String("<br>")));
auto box = new QMessageBox(QMessageBox::Warning,
QMessageBox box(QMessageBox::Warning,
SessionManager::tr("Failed to restore project files"),
SessionManager::tr("Could not restore the following project files:<br><b>%1</b>").
arg(fileList));
auto keepButton = new QPushButton(SessionManager::tr("Keep projects in Session"), box);
auto removeButton = new QPushButton(SessionManager::tr("Remove projects from Session"), box);
box->addButton(keepButton, QMessageBox::AcceptRole);
box->addButton(removeButton, QMessageBox::DestructiveRole);
auto keepButton = new QPushButton(SessionManager::tr("Keep projects in Session"), &box);
auto removeButton = new QPushButton(SessionManager::tr("Remove projects from Session"), &box);
box.addButton(keepButton, QMessageBox::AcceptRole);
box.addButton(removeButton, QMessageBox::DestructiveRole);
box->exec();
box.exec();
if (box->clickedButton() == removeButton)
if (box.clickedButton() == removeButton)
m_failedProjects.clear();
}
}