Refactoring. Delete repetitive code.

--HG--
branch : feature
This commit is contained in:
dismine 2014-06-18 15:11:48 +03:00
parent 1a25b82019
commit 2406334138
2 changed files with 4 additions and 16 deletions

View File

@ -1565,14 +1565,8 @@ void MainWindow::FullParseFile()
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
#endif #endif
QMessageBox msgBox; QMessageBox::critical(this, tr("Critical error!"), tr("Error parsing file (std::bad_alloc)."), QMessageBox::Ok,
msgBox.setWindowTitle(tr("Error!")); QMessageBox::Ok);
msgBox.setText(tr("Error parsing file."));
msgBox.setInformativeText("std::bad_alloc");
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.setIcon(QMessageBox::Warning);
msgBox.exec();
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
#endif #endif

View File

@ -687,14 +687,8 @@ void VPattern::LiteParseTree()
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
#endif #endif
QMessageBox msgBox; QMessageBox::critical(nullptr, tr("Critical error!"), tr("Error parsing file (std::bad_alloc)."), QMessageBox::Ok,
msgBox.setWindowTitle(tr("Error!")); QMessageBox::Ok);
msgBox.setText(tr("Error parsing file."));
msgBox.setInformativeText("std::bad_alloc");
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.setIcon(QMessageBox::Warning);
msgBox.exec();
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
#endif #endif