From d80abbcf94d3ffab795087adbd2465a1fc7bac69 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 3 Mar 2023 18:17:26 +0800 Subject: [PATCH] - fix: Problem's memory limit unit can't be correctly saved. --- NEWS.md | 1 + RedPandaIDE/widgets/ojproblempropertywidget.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index bdb4d2c7..8fbe5cbe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -20,6 +20,7 @@ Red Panda C++ Version 2.16 - fix: Shouldn't try evaluate value of the selection in the cpu info dialog. - enhancement: Show oct/bin/bin value in the memory view's tooltip. - fix: Hex float point literal is not correctly colored. + - fix: Problem's memory limit unit can't be correctly saved. Red Panda C++ Version 2.15 diff --git a/RedPandaIDE/widgets/ojproblempropertywidget.cpp b/RedPandaIDE/widgets/ojproblempropertywidget.cpp index e0a1e4c8..63d973d4 100644 --- a/RedPandaIDE/widgets/ojproblempropertywidget.cpp +++ b/RedPandaIDE/widgets/ojproblempropertywidget.cpp @@ -79,13 +79,13 @@ void OJProblemPropertyWidget::saveToProblem(POJProblem problem) problem->description = ui->txtDescription->toHtml(); problem->memoryLimit = ui->spinMemoryLimit->value(); problem->timeLimit = ui->spinTimeLimit->value(); - if (ui->cbTimeLimitUnit->currentText()=="sec") + if (ui->cbTimeLimitUnit->currentText()==tr("sec")) problem->timeLimitUnit = ProblemTimeLimitUnit::Seconds; else problem->timeLimitUnit = ProblemTimeLimitUnit::Milliseconds; - if (ui->cbTimeLimitUnit->currentText()=="KB") + if (ui->cbMemoryLimitUnit->currentText()==tr("KB")) problem->memoryLimitUnit = ProblemMemoryLimitUnit::KB; - else if (ui->cbTimeLimitUnit->currentText()=="MB") + else if (ui->cbMemoryLimitUnit->currentText()==tr("MB")) problem->memoryLimitUnit = ProblemMemoryLimitUnit::MB; else problem->memoryLimitUnit = ProblemMemoryLimitUnit::GB;