forked from qt-creator/qt-creator
Delete QMessageBox after usage
Change-Id: Icba5fddb5596f263f2cbb19f91b6ce95ca7785c6 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Laurent Montel
parent
2cf2aca136
commit
44802d754e
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user