From 67365243807697758b656b86650e4d54cd78c7be Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 3 May 2023 12:55:19 +0800 Subject: [PATCH] - fix: Crash at startup when current problem in the problem set is connected with source file. --- NEWS.md | 4 ++++ RedPandaIDE/RedPandaIDE.pro | 2 +- RedPandaIDE/mainwindow.cpp | 6 ++++-- Red_Panda_CPP.pro | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 44256aeb..5abd5aab 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +Red Panda C++ Version 2.22 + + - fix: Crash at startup when current problem in the problem set is connected with source file. + Red Panda C++ Version 2.21 - change: The option "Check for stack smashing attacks (-fstack-protector)" is turned off by default in the Debug compiler set settings. diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index a470276b..5cb0ab4a 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -8,7 +8,7 @@ isEmpty(APP_NAME) { } isEmpty(APP_VERSION) { - APP_VERSION = 2.21 + APP_VERSION = 2.22 } contains(QMAKE_HOST.arch, x86_64):{ diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index b1c70388..c103f104 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -4034,8 +4034,10 @@ void MainWindow::onProblemSetIndexChanged(const QModelIndex ¤t, const QMod } else { mProblemSet_RemoveProblem->setEnabled(true); POJProblem problem = mOJProblemSetModel.problem(idx.row()); - if (problem && !problem->answerProgram.isEmpty()) { - openFile(problem->answerProgram); + if (mFullInitialized) { + if (problem && !problem->answerProgram.isEmpty()) { + openFile(problem->answerProgram); + } } mOJProblemModel.setProblem(problem); updateProblemTitle(); diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro index c0e0cabc..642b9de8 100644 --- a/Red_Panda_CPP.pro +++ b/Red_Panda_CPP.pro @@ -14,7 +14,7 @@ qsynedit.subdir = libs/qsynedit APP_NAME = RedPandaCPP -APP_VERSION = 2.21 +APP_VERSION = 2.22 # Add the dependencies so that the RedPandaIDE project can add the depended programs # into the main app bundle