From 8e720ebf002583c656c36e0665e9eea6bdc970a6 Mon Sep 17 00:00:00 2001 From: iotang <3057244225@qq.com> Date: Sat, 18 Apr 2020 17:39:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E4=B8=80=E6=AE=B5=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=8D=E8=A7=81=E4=BA=86=EF=BC=8C=E5=A5=87=E6=80=AA=E7=9A=84?= =?UTF-8?q?=E4=BA=8B=E6=83=85=E5=8F=91=E7=94=9F=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addcompilerwizard.cpp | 29 +- addtaskdialog.cpp | 8 - addtestcaseswizard.cpp | 7 - advancedcompilersettingsdialog.cpp | 2 - assignmentthread.cpp | 9 - compilersettings.cpp | 3 - contest.cpp | 18 - detaildialog.cpp | 9 - editvariabledialog.cpp | 1 - environmentvariablesdialog.cpp | 1 - exportutil.cpp | 35 -- filelineedit.cpp | 2 - forms/lemon.ui | 6 +- generalsettings.cpp | 3 - judgingdialog.cpp | 21 - judgingthread.cpp | 14 - lemon.cpp | 75 +-- lemon.h | 1 + lemon_zh_CN.qm | Bin 44003 -> 44316 bytes lemon_zh_CN.ts | 940 +++++++++++++++-------------- main.cpp | 7 - pics/acrobat.svg | 3 + resource.qrc | 1 + resultviewer.cpp | 11 - settings.cpp | 18 - statisticsbrowser.cpp | 24 +- statisticsbrowser.h | 2 +- summarytree.cpp | 4 - task.cpp | 2 - taskeditwidget.cpp | 16 - testcaseeditwidget.cpp | 6 - testlib_for_lemons.h | 36 -- visualsettings.cpp | 5 - watcher_macos.cpp | 2 - watcher_unix | Bin 17392 -> 32232 bytes watcher_unix.cpp | 2 - 36 files changed, 532 insertions(+), 791 deletions(-) create mode 100644 pics/acrobat.svg diff --git a/addcompilerwizard.cpp b/addcompilerwizard.cpp index 3984ddc0..056635d0 100644 --- a/addcompilerwizard.cpp +++ b/addcompilerwizard.cpp @@ -35,11 +35,9 @@ AddCompilerWizard::AddCompilerWizard(QWidget *parent) : ui(new Ui::AddCompilerWizard) { ui->setupUi(this); - ui->sourceFileExtensions->setValidator(new QRegExpValidator(QRegExp("(\\w+;)*\\w+"), this)); ui->bytecodeFileExtensions->setValidator(new QRegExpValidator(QRegExp("(\\w+;)*\\w+"), this)); ui->javaMemoryLimit->setValidator(new QIntValidator(64, 2048, this)); - #ifdef Q_OS_LINUX if (QFileInfo::exists("/usr/bin/gcc")) @@ -61,7 +59,6 @@ AddCompilerWizard::AddCompilerWizard(QWidget *parent) : ui->pythonPath->setText("/usr/bin/python"); #endif - connect(ui->typeSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(compilerTypeChanged())); connect(ui->compilerSelectButton, SIGNAL(clicked()), @@ -89,12 +86,12 @@ AddCompilerWizard::~AddCompilerWizard() delete ui; } -const QList &AddCompilerWizard::getCompilerList() const +auto AddCompilerWizard::getCompilerList() const -> const QList & { return compilerList; } -int AddCompilerWizard::nextId() const +auto AddCompilerWizard::nextId() const -> int { if (currentId() == 0) { @@ -102,19 +99,16 @@ int AddCompilerWizard::nextId() const { return 1; } - else - { - return 2; - } - } - else - { - if (currentId() == 3) return -1; - else return 3; + + return 2; } + + if (currentId() == 3) return -1; + + return 3; } -bool AddCompilerWizard::validateCurrentPage() +auto AddCompilerWizard::validateCurrentPage() -> bool { if (currentId() == 1) { @@ -534,12 +528,10 @@ void AddCompilerWizard::accept() compiler->setCompilerName("gcc"); compiler->setCompilerLocation(ui->gccPath->text()); compiler->setSourceExtensions("c"); - QString stackArg = ""; #ifdef Q_OS_WIN32 stackArg = " -Wl,--stack=2147483647"; #endif - compiler->addConfiguration("default", "-o %s %s.* -lm" + stackArg, ""); if (ui->gccRecommendedCheck->isChecked()) @@ -577,12 +569,10 @@ void AddCompilerWizard::accept() compiler->setCompilerName("g++"); compiler->setCompilerLocation(ui->gppPath->text()); compiler->setSourceExtensions("cpp;cc;cxx"); - QString stackArg = ""; #ifdef Q_OS_WIN32 stackArg = " -Wl,--stack=2147483647"; #endif - compiler->addConfiguration("default", "-o %s %s.* -lm" + stackArg, ""); if (ui->gppRecommendedCheck->isChecked()) @@ -623,7 +613,6 @@ void AddCompilerWizard::accept() compiler->setCompilerName("fpc"); compiler->setCompilerLocation(ui->fpcPath->text()); compiler->setSourceExtensions("pas;pp;inc"); - compiler->addConfiguration("default", "%s.*", ""); if (ui->fpcRecommendedCheck->isChecked()) diff --git a/addtaskdialog.cpp b/addtaskdialog.cpp index f5d99e4b..99d563da 100644 --- a/addtaskdialog.cpp +++ b/addtaskdialog.cpp @@ -33,11 +33,9 @@ AddTaskDialog::AddTaskDialog(QWidget *parent) : ui(new Ui::AddTaskDialog) { ui->setupUi(this); - ui->fullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore() * 100, this)); ui->timeLimit->setValidator(new QIntValidator(1, Settings::upperBoundForTimeLimit(), this)); ui->memoryLimit->setValidator(new QIntValidator(1, Settings::upperBoundForMemoryLimit(), this)); - connect(ui->taskBox, SIGNAL(currentIndexChanged(int)), this, SLOT(taskBoxIndexChanged())); connect(ui->fullScore, SIGNAL(textChanged(QString)), @@ -69,9 +67,7 @@ auto AddTaskDialog::getFullScore(int index) const -> int return fullScore[index]; } - return 0; - } auto AddTaskDialog::getTimeLimit(int index) const -> int @@ -81,9 +77,7 @@ auto AddTaskDialog::getTimeLimit(int index) const -> int return timeLimit[index]; } - return 0; - } auto AddTaskDialog::getMemoryLimit(int index) const -> int @@ -93,9 +87,7 @@ auto AddTaskDialog::getMemoryLimit(int index) const -> int return memoryLimit[index]; } - return 0; - } void AddTaskDialog::taskBoxIndexChanged() diff --git a/addtestcaseswizard.cpp b/addtestcaseswizard.cpp index d199bfca..40869537 100644 --- a/addtestcaseswizard.cpp +++ b/addtestcaseswizard.cpp @@ -31,18 +31,15 @@ AddTestCasesWizard::AddTestCasesWizard(QWidget *parent) : ui(new Ui::AddTestCasesWizard) { ui->setupUi(this); - ui->fullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore(), this)); ui->timeLimit->setValidator(new QIntValidator(1, Settings::upperBoundForTimeLimit(), this)); ui->memoryLimit->setValidator(new QIntValidator(1, Settings::upperBoundForMemoryLimit(), this)); - connect(ui->fullScore, SIGNAL(textChanged(QString)), this, SLOT(fullScoreChanged(QString))); connect(ui->timeLimit, SIGNAL(textChanged(QString)), this, SLOT(timeLimitChanged(QString))); connect(ui->memoryLimit, SIGNAL(textChanged(QString)), this, SLOT(memoryLimitChanged(QString))); - QHeaderView *header = ui->argumentList->horizontalHeader(); for (int i = 0; i < 3; i ++) @@ -269,7 +266,6 @@ void AddTestCasesWizard::searchMatchedFiles() QStringList outputFiles; getFiles(Settings::dataPath(), "", inputFiles); getFiles(Settings::dataPath(), "", outputFiles); - QString regExp = getFullRegExp(inputFilesPattern); for (int i = 0; i < inputFiles.size(); i ++) @@ -294,7 +290,6 @@ void AddTestCasesWizard::searchMatchedFiles() std::sort(inputFiles.begin(), inputFiles.end(), compareFileName); std::sort(outputFiles.begin(), outputFiles.end(), compareFileName); - QList inputFilesMatchedPart; QList outputFilesMatchedPart; @@ -334,7 +329,6 @@ void AddTestCasesWizard::searchMatchedFiles() matchedPart.append(inputFilesMatchedPart[i]); } }*/ - loc.clear(); for (int i = 0; i < singleCases.size(); i ++) @@ -355,7 +349,6 @@ void AddTestCasesWizard::searchMatchedFiles() matchedInputFiles.clear(); matchedOutputFiles.clear(); ui->testCasesViewer->clear(); - QList keys = loc.uniqueKeys(); std::sort(keys.begin(), keys.end(), compareFileName); diff --git a/advancedcompilersettingsdialog.cpp b/advancedcompilersettingsdialog.cpp index fde7f648..71ce8667 100644 --- a/advancedcompilersettingsdialog.cpp +++ b/advancedcompilersettingsdialog.cpp @@ -36,11 +36,9 @@ AdvancedCompilerSettingsDialog::AdvancedCompilerSettingsDialog(QWidget *parent) ui(new Ui::AdvancedCompilerSettingsDialog) { ui->setupUi(this); - editCompiler = new Compiler(this); ui->bytecodeExtension->setValidator(new QRegExpValidator(QRegExp("(\\w+;)*\\w+"), this)); ui->configurationSelect->setLineEdit(new QLineEdit(this)); - connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(okayButtonClicked())); connect(ui->typeSelect, SIGNAL(currentIndexChanged(int)), diff --git a/assignmentthread.cpp b/assignmentthread.cpp index 920a0b06..a96d7691 100644 --- a/assignmentthread.cpp +++ b/assignmentthread.cpp @@ -113,7 +113,6 @@ auto AssignmentThread::traditionalTaskPrepare() -> bool compileState = NoValidSourceFile; QDir contestantDir; contestantDir = ! task->getSubFolderCheck() ? QDir(Settings::sourcePath() + contestantName) : QDir(Settings::sourcePath() + contestantName + QDir::separator() + task->getSourceFileName()); - QList compilerList = settings->getCompilerList(); for (auto &i : compilerList) @@ -252,7 +251,6 @@ auto AssignmentThread::traditionalTaskPrepare() -> bool if (i->getCompilerType() != Compiler::InterpretiveWithoutByteCode) { makeDialogAlert(tr("Compiling...")); - QString arguments = compilerArguments[j]; if (task->getTaskType() == Task::Interaction) @@ -399,11 +397,8 @@ void AssignmentThread::run() } } - skipEnabled = 0; - assign(); - exec(); } @@ -417,7 +412,6 @@ void AssignmentThread::assign() } TestCase *curTestCase = task->getTestCase(curTestCaseIndex); - bool beingSkipped = false; if (curSingleCaseIndex == curTestCase->getInputFiles().size()) @@ -512,10 +506,8 @@ void AssignmentThread::assign() } thread->setTask(task); - connect(thread, SIGNAL(finished()), this, SLOT(threadFinished())); connect(this, SIGNAL(stopJudgingSignal()), thread, SLOT(stopJudgingSlot())); - thread->setInputFile(Settings::dataPath() + curTestCase->getInputFiles().at(curSingleCaseIndex)); thread->setOutputFile(Settings::dataPath() + curTestCase->getOutputFiles().at(curSingleCaseIndex)); thread->setFullScore(curTestCase->getFullScore()); @@ -585,7 +577,6 @@ void AssignmentThread::threadFinished() running.remove(thread); countFinished ++; delete thread; - int nowScore = score[cur.first][cur.second]; if (cur.second + 1 == task->getTestCase(cur.first)->getInputFiles().size()) diff --git a/compilersettings.cpp b/compilersettings.cpp index e541fbdb..2306159b 100644 --- a/compilersettings.cpp +++ b/compilersettings.cpp @@ -34,14 +34,12 @@ CompilerSettings::CompilerSettings(QWidget *parent) : ui(new Ui::CompilerSettings) { ui->setupUi(this); - ui->sourceExtensions->setValidator(new QRegExpValidator(QRegExp("(\\w+;)*\\w+"), this)); deleteCompilerKeyAction = new QAction(ui->compilerList); deleteCompilerKeyAction->setShortcutContext(Qt::WidgetShortcut); deleteCompilerKeyAction->setShortcut(QKeySequence::Delete); deleteCompilerKeyAction->setEnabled(false); ui->compilerList->addAction(deleteCompilerKeyAction); - connect(ui->moveUpButton, SIGNAL(clicked()), this, SLOT(moveUpCompiler())); connect(ui->moveDownButton, SIGNAL(clicked()), @@ -70,7 +68,6 @@ CompilerSettings::~CompilerSettings() void CompilerSettings::resetEditSettings(Settings *settings) { editSettings = settings; - const QList &compilerList = editSettings->getCompilerList(); ui->compilerList->clear(); diff --git a/contest.cpp b/contest.cpp index 3b44bfd2..a60c7afe 100644 --- a/contest.cpp +++ b/contest.cpp @@ -67,9 +67,7 @@ auto Contest::getTask(int index) const -> Task * return taskList[index]; } - return nullptr; - } auto Contest::getTaskList() const -> const QList & @@ -98,9 +96,7 @@ auto Contest::getContestant(const QString &name) const -> Contestant * return contestantList.value(name); } - return nullptr; - } auto Contest::getContestantList() const -> QList @@ -237,7 +233,6 @@ void Contest::judge(Contestant *contestant) for (int i = 0; i < taskList.size(); i ++) { emit taskJudgingStarted(taskList[i]->getProblemTile()); - auto *thread = new AssignmentThread(); connect(thread, SIGNAL(dialogAlert(QString)), this, SIGNAL(dialogAlert(QString))); @@ -275,18 +270,15 @@ void Contest::judge(Contestant *contestant) contestant->setScore(i, thread->getScore()); contestant->setTimeUsed(i, thread->getTimeUsed()); contestant->setMemoryUsed(i, thread->getMemoryUsed()); - contestant->setCheckJudged(i, true); emit taskJudgedDisplay(taskList[i]->getProblemTile(), thread->getScore(), taskList[i]->getTotalScore()); emit taskJudgingFinished(); - delete thread; clearPath(Settings::temporaryPath()); } contestant->setJudgingTime(QDateTime::currentDateTime()); QDir().rmdir(Settings::temporaryPath()); - emit contestantJudgedDisplay(contestant->getContestantName(), contestant->getTotalScore(), getTotalScore()); emit contestantJudgingFinished(); } @@ -301,7 +293,6 @@ void Contest::judge(Contestant *contestant, const QSet &index) if (!index.contains(i)) continue; emit taskJudgingStarted(taskList[i]->getProblemTile()); - auto *thread = new AssignmentThread(); connect(thread, SIGNAL(dialogAlert(QString)), this, SIGNAL(dialogAlert(QString))); @@ -339,18 +330,15 @@ void Contest::judge(Contestant *contestant, const QSet &index) contestant->setScore(i, thread->getScore()); contestant->setTimeUsed(i, thread->getTimeUsed()); contestant->setMemoryUsed(i, thread->getMemoryUsed()); - contestant->setCheckJudged(i, true); emit taskJudgedDisplay(taskList[i]->getProblemTile(), thread->getScore(), taskList[i]->getTotalScore()); emit taskJudgingFinished(); - delete thread; clearPath(Settings::temporaryPath()); } contestant->setJudgingTime(QDateTime::currentDateTime()); QDir().rmdir(Settings::temporaryPath()); - emit contestantJudgedDisplay(contestant->getContestantName(), contestant->getTotalScore(), getTotalScore()); emit contestantJudgingFinished(); } @@ -359,9 +347,7 @@ void Contest::judge(Contestant *contestant, int index) { emit contestantJudgingStart(contestant->getContestantName()); QDir(QDir::current()).mkdir(Settings::temporaryPath()); - emit taskJudgingStarted(taskList[index]->getProblemTile()); - auto *thread = new AssignmentThread(); connect(thread, SIGNAL(dialogAlert(QString)), this, SIGNAL(dialogAlert(QString))); @@ -399,17 +385,13 @@ void Contest::judge(Contestant *contestant, int index) contestant->setScore(index, thread->getScore()); contestant->setTimeUsed(index, thread->getTimeUsed()); contestant->setMemoryUsed(index, thread->getMemoryUsed()); - contestant->setCheckJudged(index, true); emit taskJudgedDisplay(taskList[index]->getProblemTile(), thread->getScore(), taskList[index]->getTotalScore()); emit taskJudgingFinished(); - delete thread; clearPath(Settings::temporaryPath()); - contestant->setJudgingTime(QDateTime::currentDateTime()); QDir().rmdir(Settings::temporaryPath()); - emit contestantJudgedDisplay(contestant->getContestantName(), contestant->getTotalScore(), getTotalScore()); emit contestantJudgingFinished(); } diff --git a/detaildialog.cpp b/detaildialog.cpp index a9c1b537..c938790f 100644 --- a/detaildialog.cpp +++ b/detaildialog.cpp @@ -54,15 +54,12 @@ void DetailDialog::refreshViewer(Contest *_contest, Contestant *_contestant) { contest = _contest; contestant = _contestant; - setWindowTitle(tr("Contestant: %1").arg(contestant->getContestantName())); ui->detailViewer->clear(); QString htmlCode; - htmlCode += ""; htmlCode += ""; htmlCode += ""; - QList taskList = contest->getTaskList(); for (int i = 0; i < taskList.size(); i++) @@ -132,7 +129,6 @@ void DetailDialog::refreshViewer(Contest *_contest, Contestant *_contestant) htmlCode += QString(R"(%1)").arg(tr("Time Used")); htmlCode += QString(R"(%1)").arg(tr("Memory Used")); htmlCode += QString(R"(%1)").arg(tr("Score")); - QList testCases = taskList[i]->getTestCaseList(); QList inputFiles = contestant->getInputFiles(i); QList< QList> result = contestant->getResult(i); @@ -158,13 +154,10 @@ void DetailDialog::refreshViewer(Contest *_contest, Contestant *_contestant) } htmlCode += QString(R"(%1)").arg(inputFiles[j][k]); - QString text; QString bgColor = "rgb(255, 255, 255)"; QString frColor = "rgb(0, 0, 0)"; - Settings::setTextAndColor(result[j][k], text, frColor, bgColor); - htmlCode += QString(R"(%1)").arg(text).arg(bgColor).arg(frColor); if (! message[j][k].isEmpty()) @@ -173,7 +166,6 @@ void DetailDialog::refreshViewer(Contest *_contest, Contestant *_contestant) } htmlCode += ""; - htmlCode += R"()"; if (timeUsed[j][k] != -1) @@ -186,7 +178,6 @@ void DetailDialog::refreshViewer(Contest *_contest, Contestant *_contestant) } htmlCode += ""; - htmlCode += R"()"; if (memoryUsed[j][k] != -1) diff --git a/editvariabledialog.cpp b/editvariabledialog.cpp index 47402143..7af2b6dc 100644 --- a/editvariabledialog.cpp +++ b/editvariabledialog.cpp @@ -30,7 +30,6 @@ EditVariableDialog::EditVariableDialog(QWidget *parent) : { ui->setupUi(this); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); - connect(ui->variableName, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); connect(ui->variableValue, SIGNAL(textChanged(QString)), diff --git a/environmentvariablesdialog.cpp b/environmentvariablesdialog.cpp index 0e9020a6..71978db3 100644 --- a/environmentvariablesdialog.cpp +++ b/environmentvariablesdialog.cpp @@ -30,7 +30,6 @@ EnvironmentVariablesDialog::EnvironmentVariablesDialog(QWidget *parent) : ui(new Ui::EnvironmentVariablesDialog) { ui->setupUi(this); - connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addButtonClicked())); connect(ui->editButton, SIGNAL(clicked()), diff --git a/exportutil.cpp b/exportutil.cpp index 20e7726b..ab1d8aa4 100644 --- a/exportutil.cpp +++ b/exportutil.cpp @@ -45,7 +45,6 @@ ExportUtil::ExportUtil(QObject *parent) : auto ExportUtil::getContestantHtmlCode(Contest *contest, Contestant *contestant, int num) -> QString { QString htmlCode; - QList taskList = contest->getTaskList(); for (int i = 0; i < taskList.size(); i ++) @@ -120,7 +119,6 @@ auto ExportUtil::getContestantHtmlCode(Contest *contest, Contestant *contestant, htmlCode += QString(R"(%1)").arg(tr("Time Used")); htmlCode += QString(R"(%1)").arg(tr("Memory Used")); htmlCode += QString(R"(%1)").arg(tr("Score")); - QList testCases = taskList[i]->getTestCaseList(); QList inputFiles = contestant->getInputFiles(i); QList< QList> result = contestant->getResult(i); @@ -146,13 +144,10 @@ auto ExportUtil::getContestantHtmlCode(Contest *contest, Contestant *contestant, } htmlCode += QString("%1").arg(inputFiles[j][k]); - QString text; QString bgColor = "rgb(255, 255, 255)"; QString frColor = "rgb(0, 0, 0)"; - Settings::setTextAndColor(result[j][k], text, frColor, bgColor); - htmlCode += QString("%1").arg(text).arg(bgColor).arg(frColor); if (! message[j][k].isEmpty()) @@ -165,7 +160,6 @@ auto ExportUtil::getContestantHtmlCode(Contest *contest, Contestant *contestant, } htmlCode += ""; - htmlCode += ""; if (timeUsed[j][k] != -1) @@ -178,7 +172,6 @@ auto ExportUtil::getContestantHtmlCode(Contest *contest, Contestant *contestant, } htmlCode += ""; - htmlCode += ""; if (memoryUsed[j][k] != -1) @@ -242,17 +235,14 @@ void ExportUtil::exportHtml(QWidget *widget, Contest *contest, const QString &fi QApplication::setOverrideCursor(Qt::WaitCursor); QTextStream out(&file); - QList contestantList = contest->getContestantList(); QList taskList = contest->getTaskList(); - out.setCodec("UTF-8"); out << ""; out << R"()"; out << ""; out << "" << tr("Contest Result") << ""; out << ""; - QList< QPair> sortList; for (auto &i : contestantList) @@ -297,14 +287,12 @@ void ExportUtil::exportHtml(QWidget *widget, Contest *contest, const QString &fi out << R"(

)"; out << QString(R"()").arg(tr("Rank")); out << QString(R"()").arg(tr("Name")); - out << QString(R"()").arg(tr("Total Score")); for (auto &i : taskList) out << QString(R"()").arg(i->getProblemTile()); out << ""; - QList fullScore; int sfullScore = contest->getTotalScore(); @@ -320,7 +308,6 @@ void ExportUtil::exportHtml(QWidget *widget, Contest *contest, const QString &fi .arg(rankList[contestant->getContestantName()] + 1); out << QString(R"()") .arg(loc[contestant]).arg(i.second); - int allScore = contestant->getTotalScore(); if (allScore >= 0) @@ -381,7 +368,6 @@ void ExportUtil::exportHtml(QWidget *widget, Contest *contest, const QString &fi } out << ""; - QApplication::restoreOverrideCursor(); QMessageBox::information(widget, tr("LemonLime"), tr("Export is done"), QMessageBox::Ok); } @@ -389,7 +375,6 @@ void ExportUtil::exportHtml(QWidget *widget, Contest *contest, const QString &fi auto ExportUtil::getSmallerContestantHtmlCode(Contest *contest, Contestant *contestant) -> QString { QString htmlCode; - QList taskList = contest->getTaskList(); for (int i = 0; i < taskList.size(); i ++) @@ -464,7 +449,6 @@ auto ExportUtil::getSmallerContestantHtmlCode(Contest *contest, Contestant *cont htmlCode += QString("").arg(tr("Time Used")); htmlCode += QString("").arg(tr("Memory Used")); htmlCode += QString("").arg(tr("Score")); - QList testCases = taskList[i]->getTestCaseList(); QList inputFiles = contestant->getInputFiles(i); QList< QList> result = contestant->getResult(i); @@ -490,13 +474,10 @@ auto ExportUtil::getSmallerContestantHtmlCode(Contest *contest, Contestant *cont } htmlCode += QString("").arg(inputFiles[j][k]); - QString text; QString bgColor; QString frColor; - Settings::setTextAndColor(result[j][k], text, frColor, bgColor); - htmlCode += QString(""; - htmlCode += ""; - htmlCode += "
%1%1%1%1
%2%1%1%1
%1%1").arg(text); if (! message[j][k].isEmpty()) @@ -509,7 +490,6 @@ auto ExportUtil::getSmallerContestantHtmlCode(Contest *contest, Contestant *cont } htmlCode += ""; if (timeUsed[j][k] != -1) @@ -522,7 +502,6 @@ auto ExportUtil::getSmallerContestantHtmlCode(Contest *contest, Contestant *cont } htmlCode += ""; if (memoryUsed[j][k] != -1) @@ -571,17 +550,14 @@ void ExportUtil::exportSmallerHtml(QWidget *widget, Contest *contest, const QStr QApplication::setOverrideCursor(Qt::WaitCursor); QTextStream out(&file); - QList contestantList = contest->getContestantList(); QList taskList = contest->getTaskList(); - out.setCodec("UTF-8"); out << ""; out << R"()"; out << ""; out << "" << tr("Contest Result") << ""; out << ""; - QList< QPair> sortList; for (auto &i : contestantList) @@ -626,14 +602,12 @@ void ExportUtil::exportSmallerHtml(QWidget *widget, Contest *contest, const QStr out << R"(

)"; out << QString("").arg(tr("Rank")); out << QString("").arg(tr("Name")); - out << QString("").arg(tr("Total Score")); for (auto &i : taskList) out << QString("").arg(i->getProblemTile()); out << QString(""); - QList fullScore; for (auto &i : taskList) @@ -649,7 +623,6 @@ void ExportUtil::exportSmallerHtml(QWidget *widget, Contest *contest, const QStr .arg(rankList[contestant->getContestantName()] + 1); out << QString("") .arg(loc[contestant]).arg(i.second); - int allScore = contestant->getTotalScore(); if (allScore != -1) @@ -686,7 +659,6 @@ void ExportUtil::exportSmallerHtml(QWidget *widget, Contest *contest, const QStr } out << ""; - QApplication::restoreOverrideCursor(); QMessageBox::information(widget, tr("LemonLime"), tr("Export is done"), QMessageBox::Ok); } @@ -704,7 +676,6 @@ void ExportUtil::exportCsv(QWidget *widget, Contest *contest, const QString &fil QApplication::setOverrideCursor(Qt::WaitCursor); QTextStream out(&file); - QList contestantList = contest->getContestantList(); QList taskList = contest->getTaskList(); QList< QPair> sortList; @@ -805,7 +776,6 @@ void ExportUtil::exportXls(QWidget *widget, Contest *contest, const QString &fil } QApplication::setOverrideCursor(Qt::WaitCursor); - QList contestantList = contest->getContestantList(); QList taskList = contest->getTaskList(); QList< QPair> sortList; @@ -850,7 +820,6 @@ void ExportUtil::exportXls(QWidget *widget, Contest *contest, const QString &fil QAxObject *workbook = excel->querySubObject("Workbooks")->querySubObject("Add"); QAxObject *sheet = workbook->querySubObject("ActiveSheet"); sheet->setProperty("Name", QDate::currentDate().toString("yyyy-MM-dd")); - sheet->querySubObject("Cells(int, int)", 1, 1)->setProperty("Value", tr("Rank")); sheet->querySubObject("Cells(int, int)", 1, 2)->setProperty("Value", tr("Name")); @@ -898,7 +867,6 @@ void ExportUtil::exportXls(QWidget *widget, Contest *contest, const QString &fil workbook->dynamicCall("SaveAs(const QString&, int)", QDir::toNativeSeparators(fileName), -4143); excel->dynamicCall("Quit()"); delete excel; - QApplication::restoreOverrideCursor(); QMessageBox::information(widget, tr("LemonLime"), tr("Export is done"), QMessageBox::Ok); #endif @@ -922,7 +890,6 @@ void ExportUtil::exportResult(QWidget *widget, Contest *contest) } QString filter = tr("HTML Document (*.html *.htm);;CSV (*.csv)"); - #ifdef Q_OS_WIN32 QAxObject *excel = new QAxObject("Excel.Application", widget); @@ -930,7 +897,6 @@ void ExportUtil::exportResult(QWidget *widget, Contest *contest) delete excel; #endif - QString fileName = QFileDialog::getSaveFileName(widget, tr("Export Result"), QDir::currentPath() + QDir::separator() + "result.html", filter); @@ -939,7 +905,6 @@ void ExportUtil::exportResult(QWidget *widget, Contest *contest) if (QFileInfo(fileName).suffix() == "html") { QMessageBox::StandardButton res = QMessageBox::warning(widget, tr("Export Result"), tr("Use Default Color Theme?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); - exportHtml(widget, contest, fileName, res == QMessageBox::Yes); } diff --git a/filelineedit.cpp b/filelineedit.cpp index a2bf6799..31804cd0 100644 --- a/filelineedit.cpp +++ b/filelineedit.cpp @@ -76,9 +76,7 @@ void FileLineEdit::refreshFileList() { QStringList files; getFiles(Settings::dataPath(), "", files); - delete completer; - completer = new QCompleter(files, this); setCompleter(completer); } diff --git a/forms/lemon.ui b/forms/lemon.ui index ba57a4a3..790eaa96 100755 --- a/forms/lemon.ui +++ b/forms/lemon.ui @@ -410,7 +410,7 @@ 0 0 725 - 35 + 28 @@ -850,6 +850,10 @@ + + + :/icon/acrobat.svg:/icon/acrobat.svg + Manual diff --git a/generalsettings.cpp b/generalsettings.cpp index 0146544f..a596fedb 100644 --- a/generalsettings.cpp +++ b/generalsettings.cpp @@ -30,7 +30,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) : ui(new Ui::GeneralSettings) { ui->setupUi(this); - ui->defaultFullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore(), this)); ui->defaultTimeLimit->setValidator(new QIntValidator(1, Settings::upperBoundForTimeLimit(), this)); ui->defaultMemoryLimit->setValidator(new QIntValidator(1, Settings::upperBoundForMemoryLimit(), this)); @@ -40,7 +39,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) : ui->rejudgeTimes->setValidator(new QIntValidator(0, Settings::upperBoundForRejudgeTimes(), this)); ui->inputFileExtensions->setValidator(new QRegExpValidator(QRegExp("(\\w+;)*\\w+"), this)); ui->outputFileExtensions->setValidator(new QRegExpValidator(QRegExp("(\\w+;)*\\w+"), this)); - connect(ui->defaultFullScore, SIGNAL(textChanged(QString)), this, SLOT(defaultFullScoreChanged(QString))); connect(ui->defaultTimeLimit, SIGNAL(textChanged(QString)), @@ -69,7 +67,6 @@ GeneralSettings::~GeneralSettings() void GeneralSettings::resetEditSettings(Settings *settings) { editSettings = settings; - ui->defaultFullScore->setText(QString("%1").arg(editSettings->getDefaultFullScore())); ui->defaultTimeLimit->setText(QString("%1").arg(editSettings->getDefaultTimeLimit())); ui->defaultMemoryLimit->setText(QString("%1").arg(editSettings->getDefaultMemoryLimit())); diff --git a/judgingdialog.cpp b/judgingdialog.cpp index 87a60fbe..99ad50b6 100644 --- a/judgingdialog.cpp +++ b/judgingdialog.cpp @@ -100,7 +100,6 @@ void JudgingDialog::judge(const QString &name, int index) stopJudging = false; ui->progressBar->setMaximum(curContest->getTask(index)->getTotalTimeLimit()); curContest->judge(name, index); - /* #ifdef Q_OS_LINUX QString text = "notify-send --expire-time=2000 --urgency=normal " + tr("Finished") + " \"" + tr("Judge Finished - LemonLime") + "\""; @@ -113,9 +112,7 @@ void JudgingDialog::judge(const QString &name, int index) void JudgingDialog::judge(const QList>> &lists) { stopJudging = false; - int allTime = 0; - int listsSize = lists.size(); for (int i = 0; i < listsSize; i++) @@ -160,7 +157,6 @@ void JudgingDialog::judgeAll() void JudgingDialog::singleCaseFinished(int progress, int x, int y, int result, int scoreGot, int timeUsed, int memoryUsed) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; blockFormat.setLeftMargin(30); cursor->insertBlock(blockFormat); @@ -172,7 +168,6 @@ void JudgingDialog::singleCaseFinished(int progress, int x, int y, int result, i addcharFormat.setFontPointSize(7); addcharFormat.setForeground(QBrush(Qt::darkGray)); scorecharFormat.setFontPointSize(8); - QString text; QString addtext = ""; QString scoretext = ""; @@ -284,7 +279,6 @@ void JudgingDialog::singleCaseFinished(int progress, int x, int y, int result, i if (scoretext.length() > 0)cursor->insertText(scoretext, scorecharFormat); ui->progressBar->setValue(ui->progressBar->value() + progress); - QScrollBar *bar = ui->logViewer->verticalScrollBar(); if (isOnMaxValue) bar->setValue(bar->maximum()); @@ -293,7 +287,6 @@ void JudgingDialog::singleCaseFinished(int progress, int x, int y, int result, i void JudgingDialog::dialogAlert(const QString &msg) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; blockFormat.setLeftMargin(30); cursor->insertBlock(blockFormat); @@ -301,7 +294,6 @@ void JudgingDialog::dialogAlert(const QString &msg) format.setFontPointSize(9); format.setForeground(QBrush(Qt::gray)); cursor->insertText(msg, format); - QScrollBar *bar = ui->logViewer->verticalScrollBar(); if (isOnMaxValue) bar->setValue(bar->maximum()); @@ -310,7 +302,6 @@ void JudgingDialog::dialogAlert(const QString &msg) void JudgingDialog::singleSubtaskDependenceFinished(int x, int y, int status) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; blockFormat.setLeftMargin(30); cursor->insertBlock(blockFormat); @@ -318,7 +309,6 @@ void JudgingDialog::singleSubtaskDependenceFinished(int x, int y, int status) QTextCharFormat ratioFormat; charFormat.setFontPointSize(9); ratioFormat.setFontPointSize(9); - QString text; if (status >= 2) @@ -343,7 +333,6 @@ void JudgingDialog::singleSubtaskDependenceFinished(int x, int y, int status) cursor->insertText(tr("Subtask Dependence %1.%2: ").arg(x + 1).arg(y + 1), charFormat); cursor->insertText(text, ratioFormat); - QScrollBar *bar = ui->logViewer->verticalScrollBar(); if (isOnMaxValue) bar->setValue(bar->maximum()); @@ -352,7 +341,6 @@ void JudgingDialog::singleSubtaskDependenceFinished(int x, int y, int status) void JudgingDialog::taskJudgingStarted(const QString &taskName) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; blockFormat.setLeftMargin(15); cursor->insertBlock(blockFormat); @@ -367,7 +355,6 @@ void JudgingDialog::taskJudgingStarted(const QString &taskName) void JudgingDialog::taskJudgedDisplay(const QString &taskName, const QList< QList> &scoreList, const int mxScore) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; blockFormat.setLeftMargin(15); cursor->insertBlock(blockFormat); @@ -377,7 +364,6 @@ void JudgingDialog::taskJudgedDisplay(const QString &taskName, const QList< QLis scoreFormat.setFontPointSize(10); scoreFormat.setFontWeight(QFont::Bold); scoreFormat.setForeground(QBrush(Qt::darkCyan)); - int allScore = 0; for (const auto &i : scoreList) @@ -404,7 +390,6 @@ void JudgingDialog::taskJudgedDisplay(const QString &taskName, const QList< QLis void JudgingDialog::contestantJudgingStart(const QString &contestantName) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextCharFormat charFormat; charFormat.setFontPointSize(12); charFormat.setFontWeight(QFont::Bold); @@ -417,7 +402,6 @@ void JudgingDialog::contestantJudgingStart(const QString &contestantName) void JudgingDialog::contestantJudgingFinished() { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; cursor->insertBlock(blockFormat); cursor->insertBlock(blockFormat); @@ -429,7 +413,6 @@ void JudgingDialog::contestantJudgingFinished() void JudgingDialog::contestantJudgedDisplay(const QString &contestantName, const int score, const int mxScore) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; blockFormat.setLeftMargin(15); cursor->insertBlock(blockFormat); @@ -439,7 +422,6 @@ void JudgingDialog::contestantJudgedDisplay(const QString &contestantName, const scoreFormat.setFontPointSize(12); scoreFormat.setFontWeight(QFont::Bold); scoreFormat.setForeground(QBrush(Qt::darkCyan)); - cursor->insertText(tr("Total score of %1 : ").arg(contestantName), charFormat); cursor->insertText(tr("%1 / %2\n").arg(score).arg(mxScore), scoreFormat); QScrollBar *bar = ui->logViewer->verticalScrollBar(); @@ -451,13 +433,11 @@ void JudgingDialog::contestantJudgedDisplay(const QString &contestantName, const void JudgingDialog::compileError(int progress, int compileState) { bool isOnMaxValue = ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); - QTextBlockFormat blockFormat; blockFormat.setLeftMargin(30); cursor->insertBlock(blockFormat); QTextCharFormat charFormat; charFormat.setFontPointSize(9); - QString text; switch (CompileState(compileState)) @@ -494,7 +474,6 @@ void JudgingDialog::compileError(int progress, int compileState) cursor->insertText(text, charFormat); ui->progressBar->setValue(ui->progressBar->value() + progress); - QScrollBar *bar = ui->logViewer->verticalScrollBar(); if (isOnMaxValue) bar->setValue(bar->maximum()); diff --git a/judgingthread.cpp b/judgingthread.cpp index b563484e..3a155527 100644 --- a/judgingthread.cpp +++ b/judgingthread.cpp @@ -80,7 +80,6 @@ JudgingThread::JudgingThread(QObject *parent) : timeUsed = -1; memoryUsed = -1; judgedTimes = 0; - QTime t = QTime::currentTime(); qsrand(static_cast(t.msec() + t.second() * 1000)); } @@ -265,9 +264,7 @@ void JudgingThread::compareLineByLine(const QString &contestantOutput) } str1[len1 ++] = '\0'; - chkEof1 = ch == EOF; - len2 = 0; while (len2 < 10) @@ -298,7 +295,6 @@ void JudgingThread::compareLineByLine(const QString &contestantOutput) } str2[len2 ++] = '\0'; - chkEof2 = ch == EOF; if (chkEof1 && ! chkEof2) @@ -526,7 +522,6 @@ void JudgingThread::compareIgnoreSpaces(const QString &contestantOutput) } str1[len1] = '\0'; - int len2 = 0; while (len2 < 10) @@ -777,7 +772,6 @@ void JudgingThread::specialJudge(const QString &fileName) } delete judge; - QFile scoreFile(workingDirectory + "_score"); if (! scoreFile.open(QFile::ReadOnly)) @@ -839,11 +833,9 @@ void JudgingThread::runProgram() #ifdef Q_OS_WIN32 SetErrorMode(SEM_NOGPFAULTERRORBOX); - STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; - ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); si.dwFlags = STARTF_USESTDHANDLES; @@ -868,7 +860,6 @@ void JudgingThread::runProgram() si.hStdError = CreateFile((const WCHAR *)((workingDirectory + "_tmperr").utf16()), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, &sa, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - QString values = environment.toStringList().join(QChar('\0')) + '\0'; if (! CreateProcess(NULL, (WCHAR *)(QString("\"%1\" %2").arg(executableFile, arguments).utf16()), NULL, &sa, @@ -1010,15 +1001,12 @@ void JudgingThread::runProgram() FILETIME creationTime, exitTime, kernelTime, userTime; GetProcessTimes(pi.hProcess, &creationTime, &exitTime, &kernelTime, &userTime); - SYSTEMTIME realTime; FileTimeToSystemTime(&userTime, &realTime); - timeUsed = realTime.wMilliseconds + realTime.wSecond * 1000 + realTime.wMinute * 60 * 1000 + realTime.wHour * 60 * 60 * 1000; - GetProcessMemoryInfo(pi.hProcess, (PROCESS_MEMORY_COUNTERS *) &info, sizeof(info)); memoryUsed = info.PeakWorkingSetSize; @@ -1030,10 +1018,8 @@ void JudgingThread::runProgram() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); #else - QFile::copy(":/watcher/watcher_unix", workingDirectory + "watcher"); QProcess::execute(QString("chmod +wx \"") + workingDirectory + "watcher" + "\""); - auto *runner = new QProcess(this); QStringList argumentsList; argumentsList << QString("\"%1\" %2").arg(executableFile, arguments); diff --git a/lemon.cpp b/lemon.cpp index ad5b1f78..f670c6fc 100644 --- a/lemon.cpp +++ b/lemon.cpp @@ -58,31 +58,24 @@ Lemon::Lemon(QWidget *parent) : ui(new Ui::Lemon) { ui->setupUi(this); - curContest = nullptr; settings = new Settings(this); - ui->tabWidget->setVisible(false); ui->closeAction->setEnabled(false); ui->saveAction->setEnabled(false); ui->openFolderAction->setEnabled(false); ui->actionChangeContestName->setEnabled(false); - dataDirWatcher = nullptr; settings->loadSettings(); - TaskMenu = new QMenu(); signalMapper = new QSignalMapper(); - ui->summary->setSettings(settings); ui->taskEdit->setSettings(settings); ui->testCaseEdit->setSettings(settings); - connect(this, SIGNAL(dataPathChanged()), ui->taskEdit, SIGNAL(dataPathChanged())); connect(this, SIGNAL(dataPathChanged()), ui->testCaseEdit, SIGNAL(dataPathChanged())); - connect(ui->summary, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(summarySelectionChanged())); connect(ui->optionsAction, SIGNAL(triggered()), @@ -139,20 +132,18 @@ Lemon::Lemon(QWidget *parent) : this, SLOT(exportStatstics())); connect(ui->aboutAction, SIGNAL(triggered()), this, SLOT(aboutLemon())); - connect(ui->actionManual, SIGNAL(triggered()), this, SLOT(actionManual())); connect(ui->actionMore, SIGNAL(triggered()), this, SLOT(actionMore())); - + connect(ui->actionChangeContestName, SIGNAL(triggered()), + this, SLOT(changeContestName())); connect(ui->exitAction, SIGNAL(triggered()), this, SLOT(close())); - appTranslator = new QTranslator(this); qtTranslator = new QTranslator(this); QApplication::installTranslator(appTranslator); QApplication::installTranslator(qtTranslator); - QStringList fileList = QDir(":/translation").entryList(QStringList() << "lemon_*.qm", QDir::Files); for (int i = 0; i < fileList.size(); i ++) @@ -174,7 +165,6 @@ Lemon::Lemon(QWidget *parent) : connect(ui->setEnglishAction, SIGNAL(triggered()), this, SLOT(setUiLanguage())); loadUiLanguage(); - QSettings settings("Crash", "Lemon"); QSize _size = settings.value("WindowSize", size()).toSize(); resize(_size); @@ -292,7 +282,6 @@ void Lemon::insertWatchPath(const QString &curDir, QFileSystemWatcher *watcher) void Lemon::resetDataWatcher() { delete dataDirWatcher; - dataDirWatcher = new QFileSystemWatcher(this); insertWatchPath(Settings::dataPath(), dataDirWatcher); connect(dataDirWatcher, SIGNAL(directoryChanged(QString)), @@ -356,7 +345,6 @@ void Lemon::showOptionsDialog() } ui->resultViewer->refreshViewer(); - delete dialog; } @@ -374,7 +362,6 @@ void Lemon::refreshButtonClicked() { curContest->refreshContestantList(); ui->resultViewer->refreshViewer(); - judgeExtButtonFlip(ui->resultViewer->rowCount() > 0); ui->cleanupAction->setEnabled(true); ui->refreshAction->setEnabled(true); @@ -389,7 +376,6 @@ void removePath(const QString &path) if (!dir.exists())return; dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); - QFileInfoList fileList = dir.entryInfoList(); foreach (QFileInfo fi, fileList) @@ -409,9 +395,7 @@ void copyPath(const QString &fromPath, const QString &toPath) QString fpath = fromPath + QDir::separator(); QString tpath = toPath + QDir::separator(); - dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); - QFileInfoList fileList = dir.entryInfoList(); foreach (QFileInfo fi, fileList) @@ -442,18 +426,14 @@ void Lemon::cleanupButtonClicked() QDir basDir(Settings::sourcePath()); basDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); QFileInfoList basDirLis = basDir.entryInfoList(); - int tarcnt = basDirLis.size(); - QString backupFolder = "source_bak_%1"; int backupNum = 0; - QDir tempBackupLoca; while (tempBackupLoca.exists(backupFolder.arg(backupNum)))backupNum++; backupFolder = backupFolder.arg(backupNum); - text = tr("Making backup files to dir
`%1'?").arg(backupFolder) + "
"; QMessageBox::StandardButton doBackup = QMessageBox::information(this, tr("Clean up Files"), text, QMessageBox::Yes | QMessageBox::No | QMessageBox::Abort, QMessageBox::Yes); @@ -480,7 +460,6 @@ void Lemon::cleanupButtonClicked() } bkLoca = QDir(backupFolder); - auto *bkProcess = new QProgressDialog(tr("Making Backup..."), "", 0, 0, this); bkProcess->setWindowModality(Qt::WindowModal); bkProcess->setWindowFlags(windowFlags() | Qt::FramelessWindowHint); @@ -489,7 +468,6 @@ void Lemon::cleanupButtonClicked() bkProcess->setRange(0, tarcnt); bkProcess->setValue(0); QCoreApplication::processEvents(); - basDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); basDirLis = basDir.entryInfoList(); @@ -511,23 +489,18 @@ void Lemon::cleanupButtonClicked() process->setCancelButton(nullptr); process->setRange(0, 5); process->setValue(0); - process->setLabelText(tr("Working on it...")); QCoreApplication::processEvents(); - process->setRange(0, tarcnt + 5); process->setValue(0); process->setModal(true); - process->setLabelText(tr("Fetching Data...")); QCoreApplication::processEvents(); - QSet tarNameSet; QSet nameSet; QMap typeSet; QMap origSet; QList taskList = curContest->getTaskList(); - process->setValue(1); process->setLabelText(tr("Initing...")); QCoreApplication::processEvents(); @@ -571,14 +544,12 @@ void Lemon::cleanupButtonClicked() process->setValue(5); process->setLabelText(tr("Now Cleaning...")); QCoreApplication::processEvents(); - basDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); basDirLis = basDir.entryInfoList(); foreach (QFileInfo conDirWho, basDirLis) { QDir conDir(conDirWho.filePath()); - conDir.setFilter(QDir::Files | QDir::Hidden); QFileInfoList conDirLis = conDir.entryInfoList(); @@ -596,7 +567,6 @@ void Lemon::cleanupButtonClicked() if (nameSet.contains(proDirWho.fileName())) { QDir proDir(proDirWho.filePath()); - proDir.setFilter(QDir::Files | QDir::Hidden); foreach (QFileInfo sorFilWho, proDir.entryInfoList()) @@ -650,7 +620,6 @@ void Lemon::cleanupButtonClicked() foreach (QFileInfo proDirWho, conDirLis) { QDir proDir(proDirWho.filePath()); - proDir.setFilter(QDir::Files | QDir::Hidden); foreach (QFileInfo sorFilWho, proDir.entryInfoList()) @@ -662,7 +631,6 @@ void Lemon::cleanupButtonClicked() } delete process; - text = tr("Finished.") + "
"; QMessageBox::information(this, tr("Clean up Files"), text); } @@ -704,7 +672,6 @@ void Lemon::tabIndexChanged(int index) } judgeExtButtonFlip(ui->resultViewer->rowCount() > 0); - ui->cleanupAction->setEnabled(true); ui->refreshAction->setEnabled(true); } @@ -721,7 +688,6 @@ void Lemon::moveUpTask() ui->summary->setContest(curContest); ui->statisticsBrowser->refresh(); ui->resultViewer->refreshViewer(); - curItem = ui->summary->topLevelItem(index - 1); if (!curItem)curItem = ui->summary->topLevelItem(index); @@ -740,7 +706,6 @@ void Lemon::moveDownTask() ui->summary->setContest(curContest); ui->resultViewer->refreshViewer(); ui->statisticsBrowser->refresh(); - curItem = ui->summary->topLevelItem(index + 1); if (!curItem)curItem = ui->summary->topLevelItem(index); @@ -784,7 +749,6 @@ void Lemon::saveContest(const QString &fileName) } QApplication::setOverrideCursor(Qt::WaitCursor); - QByteArray data; QDataStream _out(&data, QIODevice::WriteOnly); curContest->writeToStream(_out); @@ -792,7 +756,6 @@ void Lemon::saveContest(const QString &fileName) QDataStream out(&file); out << unsigned(MagicNumber) << qChecksum(data.data(), static_cast(data.length())) << data.length(); out.writeRawData(data.data(), data.length()); - QApplication::restoreOverrideCursor(); ui->statusBar->showMessage(tr("Saved"), 1000); } @@ -839,13 +802,10 @@ void Lemon::loadContest(const QString &filePath) delete[] raw; data = qUncompress(data); QDataStream in (data); - QApplication::setOverrideCursor(Qt::WaitCursor); - curContest = new Contest(this); curContest->setSettings(settings); curContest->readFromStream(in); - curFile = QFileInfo(filePath).fileName(); QDir::setCurrent(QFileInfo(filePath).path()); QDir().mkdir(Settings::dataPath()); @@ -867,7 +827,6 @@ void Lemon::loadContest(const QString &filePath) ui->cleanupAction->setEnabled(false); ui->refreshAction->setEnabled(false); setWindowTitle(tr("LemonLime - %1").arg(curContest->getContestTitle())); - QApplication::restoreOverrideCursor(); ui->tabWidget->setCurrentIndex(0); } @@ -1035,7 +994,6 @@ void Lemon::addTaskWithScoreScale(const QString &title, const QListrefreshCompilerConfiguration(settings); newTask->setAnswerFileExtension(settings->getDefaultOutputFileExtension()); curContest->addTask(newTask); - int scorePer = sumScore / testCases.size(); int scoreLos = sumScore - scorePer * testCases.size(); @@ -1087,7 +1045,6 @@ void Lemon::addTasksAction() QMap inputFiles; getFiles(Settings::dataPath() + list[i], filters, inputFiles); - filters = settings->getOutputFileExtensions(); if (filters.isEmpty()) filters << "out" << "ans"; @@ -1099,7 +1056,6 @@ void Lemon::addTasksAction() QMap outputFiles; getFiles(Settings::dataPath() + list[i], filters, outputFiles); - QList< QPair> cases; QStringList baseNameList = inputFiles.keys(); @@ -1159,6 +1115,29 @@ void Lemon::exportStatstics() StatisticsBrowser::exportStatstics(this, curContest); } +void Lemon::changeContestName() +{ + if (!curContest) + { + QMessageBox::warning(this, tr("Rename Contest"), tr("No Contest Yet")); + } + + bool confirmed = false; + QString newName = QInputDialog::getText(this, tr("Rename Contest"), tr("Write the name you want."), QLineEdit::Normal, tr("New Name"), &confirmed); + + if (!confirmed) + { + QMessageBox::warning(this, tr("Rename Contest"), tr("The name did not changes.")); + return; + } + + curContest->setContestTitle(newName); + setWindowTitle(tr("LemonLime - %1").arg(curContest->getContestTitle())); + ui->resultViewer->refreshViewer(); + ui->statisticsBrowser->refresh(); + saveContest(curFile); +} + void Lemon::aboutLemon() { QString text; @@ -1167,7 +1146,7 @@ void Lemon::aboutLemon() text += tr("Based on Project Lemon version 1.2 Beta by Zhipeng Jia, 2011") + "
"; QDateTime nowTime(QDateTime::currentDateTime()); text += tr("Build Date: %1").arg(nowTime.toString("yyyy-MM-dd hh:mm:ss")) + "
"; - text += tr("UNSTABLE VERISON") + "
"; + text += tr("BETA VERISON") + "
"; text += tr("This program is under the GPLv3 license") + "
"; text += tr("Update by Dust1404 and iotang") + "
"; @@ -1187,7 +1166,7 @@ void Lemon::actionManual() void Lemon::actionMore() { - QDesktopServices::openUrl(QUrl(QString("https://github.com/iotang/Project_LemonLime/wiki"))); + QDesktopServices::openUrl(QUrl(QString("https://github.com/iotang/Project_LemonLime"))); } void Lemon::setUiLanguage() diff --git a/lemon.h b/lemon.h index ee57ef75..e38ae745 100644 --- a/lemon.h +++ b/lemon.h @@ -90,6 +90,7 @@ private slots: void addTasksAction(); void exportResult(); void exportStatstics(); + void changeContestName(); void aboutLemon(); void actionManual(); static void actionMore(); diff --git a/lemon_zh_CN.qm b/lemon_zh_CN.qm index 155d3db1879b3774619351728adee0640e04856d..1112656b6910d29404db0fc271e7a54ce1f9d423 100755 GIT binary patch delta 3452 zcmYk9dst2R8ppqD?X~u0?X}mQkZPp1BqQvoB#m+{*J`4q(p8(%O^MJ=rQ9mCB++5q zjdGa@!?=tgw<9rQ#4%?u%lx&Z*3OjD1bi;B-gADbSSK81BOa~J#oS=U|kI`wHO$8TjAn2Kw-AUh)CP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odI)|po=b~?p`36Cs4(b#|pNe5&e%T%#IV@73ey3 zvfvm);metV_n|hx>VgmzPxP-yl%Pq}vxepsGOZu%%(bYH$GS_Re$cfO<0Z4U^4 z9Hd-V_6QI9?$NqfEj$XO%5hut%;ypiwOX$ZE~0g0rx#KRC`F=P->0WRnV~o1-=k4= zS#~xUP1#QRl(DBNHeSDC5cv$~>#BlfbO$qW&N1>5|prkgJijl!`^0O|O9U zZsM?#%cOR<*f(Dg_NBtlTIAaX_sHaWaZ-CZbzzC<+uTWw`;Qp%{&kv5uf!S6!>9{> z6z4qumBQ^6qrWJi4eTSv{YbfXs#EA*Ayy6cA^YEmRX%%3*r8%o+BlNxcXFC!Emuo^ zql!Ke@7h|>D~E{>`=}~a2gFDH<({4?KJy?GZx1wRmu;h0Jdj^XMmD=bwlTARH!sRC zKl)3Wfj=AKTgfrI$A+AzF|^Lt8giQ|sRwq-31%*)Oh(DvGeW|xJbU7)>GXf!;^q{d3`GyFH7v=Fn^&=*JLTWFG0BIVI*wZcqi$&y(_ zdkxY%+z!&(P-%o0i6b{v8ue2fknb%yp8u2@b*$tubsJQO_*S+VU^RN46dg&;XA!K> zYJNm6qEpN|=TOQ}1k`+T#cWwY#n><&3$fW233uC%Y5eqP`xecK=0+9>JFm?Y|i zRH@nEMr$QWYOW%yaoN&Y+dNWmz0~`}NHgX;`N{zIF}VlL>=Q^VRS(U^Y%ZX+2Q#;L zD%LQK+1Qpi%9YN{a}Nbqm1O4MPC=KPmnWFJ3k&`rQKSd2Ug4 qSplCok?;UDeFlVw%nX}6WtyMuEWgmenbSiW%a$%-8hw`CaQ#0u-?P^M diff --git a/lemon_zh_CN.ts b/lemon_zh_CN.ts index fe061088..676e8a2c 100755 --- a/lemon_zh_CN.ts +++ b/lemon_zh_CN.ts @@ -97,9 +97,9 @@ - - - + + + Add recommended configurations 添加建议配置 @@ -124,231 +124,231 @@ 步骤 3/3:检查结果,开始使用 LemonLime。 - - - - - - - - - - - - + + + + + + + + + + + + Error 出错了 - + Empty compiler name! 编译器名称为空! - + Empty compiler location! 编译器位置为空! - + Empty interpreter location! 解释器位置为空! - + Empty source file extensions! 源程序扩展名为空! - + Empty byte-code file extensions! 中间字节码扩展名为空! - + [Custom Compiler] 【自定义编译器】 - + Compiler Name: 编译器名称: - + Compiler Type: 编译器类型: - + Compiler's Location: 编译器位置: - + Interpreter's Location: 解释器位置: - + Source File Extensions: 源程序扩展名: - + Byte-code File Extensions: 中间字节码扩展名: - + Default Compiler's Arguments: 默认编译器参数: - + Default Interpreter's Arguments: 默认解释器参数: - + Empty gcc path! gcc 路径为空! - + Empty g++ path! g++ 路径为空! - + Empty fpc path! fpc 路径为空! - + Empty fbc path! fbc 路径为空! - + Empty javac path! javac 路径为空! - + Empty java path! java 路径为空! - + Empty python path! python 路径为空! - + [gcc Compiler] 【gcc 编译器】 - + gcc Path: gcc 路径: - + [g++ Compiler] 【g++ 编译器】 - + g++ Path: g++ 路径: - + [fpc Compiler] 【fpc 编译器】 - + fpc Path: fpc 路径: - + [fbc Compiler] 【fbc 编译器】 - + fbc Path: fbc 路径: - + [Java Compiler] 【Java 编译器】 - + javac Path: javac 路径: - + java Path: java 路径: - + Memory Limit: %1 MB 内存限制:%1 MB - + [Python Compiler] 【Python 编译器】 - + python Path: python 路径: - - - - - - - - - - - - + + + + + + + + + + + + Select Compiler's Location 选择编译器位置 - - + + Executable files (*.exe) 可执行文件 (*.exe) - - + + Executable files (*.*) 可执行文件 (*.*) - - - - - - + + + + + + Select Interpreter's Location 选择解释器位置 @@ -465,59 +465,59 @@ 正则表达式 - + Test Case #%1 测试点 #%1 + - + - - - - + + + Error 出错了 - + Empty full score! 分值为空! - + Empty time limit! 时间限制为空! - + Empty memory limit! 空间限制为空! - + Empty input files pattern! 输入文件格式为空! - + Empty output files pattern! 输出文件格式为空! - + Argument <%1> appears more than once in input files pattern! 参数<%1>在输入文件格式中出现多次! - + Argument <%1> appears more than once in output files pattern! 参数<%1>在输出文件格式中出现多次! - + Invalid regular expression! 正则表达式语法错误! @@ -615,77 +615,77 @@ 环境变量 - - + + Add new ... 添加... - - - - - - + + + + + + Error 出错了 - + Empty compiler's Location! 编译器位置为空! - + Empty interpreter's Location! 解释器位置为空! - + Empty Byte-code Extensions! 中间字节码扩展名为空! - + Empty configuration name! 配置名称为空! - + Configuration %1 appears more than once! 配置 %1 出现多次! - + Invalid configuration name "disable"! 你不能把配置名取名为“disable”! - - + + Select Compiler's Location 选择编译器位置 - - + + Executable files (*.exe) 可执行文件 (*.exe) - - + + Executable files (*.*) 可执行文件 (*.*) - - + + Select Interpreter's Location 选择解释器位置 - + New configuration %1 新建配置 %1 @@ -698,7 +698,7 @@ 准备中… - + Compiling... 编译中… @@ -727,35 +727,35 @@ 高级选项 - - - + + + Error 出错了 - + Compiler %1 appears more than once! 编译器 %1 出现多次! - + Empty compiler name! 编译器名称为空! - + Empty source file extensions! 源程序扩展名为空! - + LemonLime Lemon LemonLime - + Are you sure to delete compiler %1? 确定删除编译器 %1 吗? @@ -773,98 +773,98 @@ 关闭(&C) - + Contestant: %1 选手:%1 - - + + Task 试题 - - + + Rejudge 重新测试 - + Not judged 未测试 - + Cannot find valid source file 未找到选手程序 - - - + + + Source file: 源程序: - + Compile time limit exceeded 编译超时 - + Cannot run given compiler 给定编译器无法运行 - + Compile error &nbsp;&nbsp;Compile error 编译错误 - + Test Case 测试点 - + Input File 输入文件 - + Result 测试结果 - + Time Used 运行用时 - + Memory Used 内存消耗 - + Score 得分 - + Subtask Dependence Status Subtask Dependence Score 子任务依赖情况 - + Success 通过 - + Failed 失败 @@ -921,18 +921,18 @@ 交互库错误 - - + + Invalid 不可用 - + Compile Message 编译信息 - + Message 信息 @@ -988,23 +988,23 @@ 删除(&D) - + Add New Variable 添加新变量 - + Edit Variable 编辑变量 - + LemonLime Lemon LemonLime - + Are you sure to delete variable %1? 确定删除变量%1? @@ -1012,108 +1012,108 @@ ExportUtil - - + + Task 试题 - - + + Not judged 未测试 - - + + Cannot find valid source file 未找到选手程序 - - - - - - + + + + + + Source file: 源程序: - - + + Compile time limit exceeded 编译超时 - - + + Cannot run given compiler 给定编译器无法运行 - - + + Compile error 编译错误 - - + + Test Case 测试点 - - + + Input File 输入文件 - - + + Result 测试结果 - - + + Time Used 运行用时 - - + + Memory Used 内存消耗 - - + + Score 得分 - - + + Subtask Dependence Status Subtask Dependence Score 子任务依赖情况 - - + + Success 通过 - - + + Failed 失败 - + Use Default Color Theme? 使用默认的颜色主题吗? @@ -1170,93 +1170,93 @@ 交互库错误 - - - - - - - - - - - - + + + + + + + + + + + + Invalid 不可用 - - + + Return to top 返回顶部 - - - - - - - - - - + + + + + + + + + + LemonLime Lemon LemonLime - - - - + + + + Cannot open file %1 无法打开%1 - - + + Contest Result 比赛结果 - - + + Rank List 排名表 - + Click names or task scores to jump to details. Judged By LemonLime 点击名字或单题分数跳转到详细信息。使用 LemonLime 评测 - - - - + + + + Rank 排名 - - - - + + + + Name 名称 - - - - + + + + Total Score 总分 - + HTML Document (*.html *.htm);;CSV (*.csv) HTML文档 (*.html *htm);;逗号分隔符 (*.csv) @@ -1269,31 +1269,31 @@ 项目地址: - - + + Contestant: %1 选手:%1 - - - - + + + + Export is done 导出完成 - + Judged By LemonLime 使用 LemonLime 评测 - + No contestant in current contest 不存在选手 - + No task in current contest 不存在试题 @@ -1302,13 +1302,13 @@ HTML文档 (*.html);;逗号分隔符 (*.csv) - + ;;Excel Workbook (*.xls) ;;Excel工作簿 (*.xls) - - + + Export Result 导出成绩 @@ -1387,43 +1387,43 @@ (用";"分隔,空表示无限制。) - - - - - - - + + + + + + + Error 出错了 - + Empty default full score! 默认分值为空! - + Empty default time limit! 默认时间限制为空! - + Empty default memory limit! 默认空间限制为空! - + Empty compile time limit! 编译时间限制为空! - + Empty special judge time limit! 校验器时间限制为空! - + Empty source file size limit! 源程序大小限制为空! @@ -1432,7 +1432,7 @@ 测试线程数为空! - + Empty maximum rejudge times! 最大重测次数为空! @@ -1466,36 +1466,36 @@ 停止测试 - + Test case %1.%2: 测试点 %1.%2: - + Correct answer 答案正确 - + Wrong answer 答案错误 - + Partly correct 答案部分正确 - - + + %1 ms %1 ms %2 MB %1 ms - - - + + + %1 Pt %1 Pt @@ -1504,53 +1504,53 @@ (%1 Pt) - + Time limit exceeded 超过时间限制 - + Memory limit exceeded 超过空间限制 - + Cannot start program 进程被阻塞 - + File error 文件错误 - + Run time error 运行时错误 - - + + %1 MB %1 MB - + Invalid special judge 校验器没有被正确配置 - + Special judge time limit exceeded 校验器超过时间限制 - + Special judge run time error 校验器运行时错误 - + Skipped 被忽略 @@ -1567,80 +1567,80 @@ +%1 Pt, %2 ms, %3 MB - + Interactor error 交互库错误 - + Pure Pure - + Lost Lost - + Far Far - + Subtask Dependence %1.%2: 检查子任务依赖 %1.%2: - + Start judging task %1 开始测试试题 %1 - + Score of Task %1 : 题目 %1 分数: - - + + %1 / %2 %1 / %2 - + Start judging contestant %1 开始测试选手 %1 - + Total score of %1 : 选手 %1 总分: - + Cannot find valid source file 未找到选手程序 - + Compile error 编译错误 - + Compile time limit exceeded 编译超时 - + Invalid compiler 编译器不可用 - + Compile Successfully 编译完成 @@ -1648,72 +1648,72 @@ JudgingThread - - - + + + Cannot open contestant's output file 无法打开选手输出文件 - - - + + + Cannot open standard output file 无法打开标准输出文件 - - - + + + Read "%1" but expect "%2" Read %1 but expect %2 读取到 "%1" ,但期望 "%2" - + Invalid characters found 包含无效字符 - + Invalid characters in standard output file 标准输出文件中包含无效字符 - - + + Shorter than standard output 比标准输出短(确认你的比较方式) - - + + Longer than standard output 比标准输出长(确认你的比较方式) - + Presentation error 格式错误 - - + + Cannot find standard input file 找不到标准输入文件 - + Cannot find contestant's output file 找不到选手输出文件 - + Cannot find standard output file 找不到标准输出文件 - + Cannot copy standard input file 无法复制标准输入文件 @@ -1738,8 +1738,8 @@ Lemon - - + + LemonLime Lemon LemonLime @@ -2006,13 +2006,13 @@ + + + - - - - - + + Clean up Files &Clean up Files 整理文件 @@ -2250,7 +2250,7 @@ - + Manual 用户手册 @@ -2259,17 +2259,17 @@ 导出统计信息 - + English 简体中文 - + Are you sure to Clean up Files? 确定要整理文件吗? - + Reading guide are recommended. 建议参看教程后再确认操作。 @@ -2278,7 +2278,7 @@ 创建备份文件到 <br> `source.bak'? - + Aborted. 没有进行整理。 @@ -2291,90 +2291,103 @@ 没有进行整理:没法创建 `source.bak'。 - + Making Backup... 备份中… - + Cleaning 整理中 - + Working on it... 正在整理… - + Fetching Data... 抓取题目数据… - + Initing... 预处理中… - + Now Cleaning... 整理文件中… - + Finished. 整理完成。 - + Aborted 没有进行整理 - - - - - + + + + + Error 出错了 - - + + Cannot open file %1 无法打开 %1 - + Save Failed 保存失败 - + Saved 已保存 - - + + File %1 is broken %1 已损坏 - - + + + LemonLime - %1 LemonLime - %1 - + + The name did not changes. + 名字没有改变。 + + + + BETA VERISON + BETA 版本 + + UNSTABLE VERISON - 不稳定版本 + 不稳定版本 + + + Rename Contest - 重命名比赛 + 重命名比赛 Input the name you prefer. @@ -2398,7 +2411,7 @@ 注意 - + Aborted: Cannot make dir `%1'. 没有进行整理:没法创建 `%1'。 @@ -2571,23 +2584,38 @@ LemonLime - %1 - + Cannot make contest path 无法创建比赛目录 - + No task found 找不到任何试题 - + + No Contest Yet + 还没有比赛 + + + + Write the name you want. + 输入你想要的名字。 + + + + New Name + 新名字 + + + A tiny judging environment for OI contest based on Project Lemon A tiny judging environment for OI contest 基于Lemon的简易OI竞赛测试环境 - + Based on Project Lemon version 1.2 Beta by Zhipeng Jia, 2011 Base on Project Lemon version 1.2 Beta by Zhipeng Jia, 2011 基于Lemon v1.2 by Zhipeng Jia, 2011 @@ -2601,7 +2629,7 @@ 由Dust1404更新 - + Update by Dust1404 and iotang Featured by iotang 由 Dust1404 和 iotang 更新 @@ -2659,12 +2687,12 @@ 下面是一个例子: - + Making backup files to dir <br> `%1'? 创建备份文件到 <br> `%1'? - + Aborted: `%1' already exist. 没有进行整理:`%1' 已经存在。 @@ -2781,7 +2809,7 @@ 项目地址 - + About LemonLime About LemonPlus 关于 LemonLime @@ -2791,7 +2819,7 @@ v1.2 测试版 - + Build Date: %1 构建日期:%1 @@ -2800,7 +2828,7 @@ Copyright (c) 2011 Zhipeng Jia - + This program is under the <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a> license 本程序基于<a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a>许可协议 @@ -2961,71 +2989,71 @@ ResultViewer - - + + Delete 删除选手 - - + + Details 详情 - - + + Judge 测试 - + Name 名称 - + Rank 排名 - + Total Score 总分 - + Total Used Time (s) 总用时(s) - + Judging Time 测试时间 - - - - - - + + + + + + Invalid 不可用 - + LemonLime Lemon LemonLime - + Are you sure to delete selected contestant(s)? 确定删除选定的选手吗? - + Delete data in the disk as well Delete directories in the hard disk as well 同时从硬盘中删除选手数据 @@ -3065,67 +3093,67 @@ Settings - + Correct Answer 答案正确 - + Wrong Answer 答案错误 - + Partly Correct 答案部分正确 - + Time Limit Exceeded 超过时间限制 - + Memory Limit Exceeded 超过空间限制 - + Cannot Start Program 进程被阻塞 - + File Error 文件错误 - + Run Time Error 运行时错误 - + Invalid Special Judge 校验器没有被正确配置 - + Special Judge Time Limit Exceeded 校验器超过时间限制 - + Special Judge Run Time Error 校验器运行时错误 - + Skipped 被忽略 - + Interactor Error 交互库错误 @@ -3147,165 +3175,165 @@ p, li { white-space: pre-wrap; } - - + + No contest yet 还没有比赛 - - + + No task yet 还没有题目 - - + + No contestant yet 还没有参赛者 - + Contest 比赛 - + Overall 总览 - + Score 得分 - + Count 数量 - + Ratio 占比 - + Prefix 前缀和 - + Suffix 后缀和 - - + + Average 平均 - + Standard Deviation 标准差 - + Score Discrimination Power 区分度 - + No. 编号. - + Input 输入 - + Output 输出 - + Pure Arcaea Pure - + Far Arcaea Far - + Lost Arcaea Lost - - + + Files 个文件 - + Some unhandled situation happened. May not all contestants are well judged, or not rejudged after changing testcases. Please refresh and rejudge. Some unhandled situation happened. Please refresh and rejudge. 有些奇怪的错误发生了。可能并非所有参赛者都测试了,或者在更改测试数据后没有重新测试。请刷新选手列表并重新测试。 - + Warning: Judgement is not finished. 警告:没有测试完全部选手。 - + Problems 题目 - + Task 试题 - + Number of answer submitted 提交人数 - - - - - + + + + + LemonLime LemonLime - + Cannot open file %1 无法打开 %1 - + Export is done 导出完成 - + HTML Document (*.html) HTML文档 (*.html) - + Export Statstics 导出统计信息 @@ -3313,56 +3341,56 @@ p, li { white-space: pre-wrap; } SummaryTree - - + + Add a New Task 添加新试题 - - + + Add a Test Case 添加新测试点 - - + + Add Test Cases ... 添加多组测试点... - - + + Delete Current Task 删除选定试题 - - + + Delete Current Test Case 删除选定测试点 - - - - + + + + Test Case #%1 测试点 #%1 - + Problem %1 试题%1 - + LemonLime Lemon LemonLime - + Are you sure to delete this task? 确定删除选定试题? @@ -3751,24 +3779,24 @@ p, li { white-space: pre-wrap; } MB - - - + + + Error 出错了 - + Empty input file name! 输入文件名为空! - + Empty output file name! 输出文件名为空! - + Dependence subtask index error! 子任务依赖编号错误! diff --git a/main.cpp b/main.cpp index 48486171..623609f4 100644 --- a/main.cpp +++ b/main.cpp @@ -36,7 +36,6 @@ auto main(int argc, char *argv[]) -> int #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // High DPI supported #endif - QtSingleApplication a(argc, argv); if (a.sendMessage("")) @@ -56,14 +55,10 @@ auto main(int argc, char *argv[]) -> int fonts.setFamily("PingFangSC-Regular"); #endif QtSingleApplication::setFont(fonts); - Q_INIT_RESOURCE(resource); - QPixmap pixmap(":/logo/splash.png"); QSplashScreen screen(pixmap); - Lemon w; - qint64 startTime = QDateTime::currentMSecsSinceEpoch(); int splashTime = w.getSplashTime(); @@ -80,9 +75,7 @@ auto main(int argc, char *argv[]) -> int } a.setActivationWindow(&w); - w.show(); w.welcome(); - return QtSingleApplication::exec(); } diff --git a/pics/acrobat.svg b/pics/acrobat.svg new file mode 100644 index 00000000..bde6bc15 --- /dev/null +++ b/pics/acrobat.svg @@ -0,0 +1,3 @@ + + + diff --git a/resource.qrc b/resource.qrc index 1d73cb29..93cad110 100755 --- a/resource.qrc +++ b/resource.qrc @@ -37,6 +37,7 @@ pics/quickopen-file.svg pics/system-help.svg pics/splash.png + pics/acrobat.svg lemon_zh_CN.qm diff --git a/resultviewer.cpp b/resultviewer.cpp index 8f92094e..d2d84415 100644 --- a/resultviewer.cpp +++ b/resultviewer.cpp @@ -44,7 +44,6 @@ ResultViewer::ResultViewer(QWidget *parent) : QTableWidget(parent) { curContest = nullptr; - deleteContestantAction = new QAction(tr("Delete"), this); detailInformationAction = new QAction(tr("Details"), this); judgeSelectedAction = new QAction(tr("Judge"), this); @@ -140,7 +139,6 @@ void ResultViewer::refreshViewer() QStringList headerList; headerList << tr("Rank") << tr("Name") << tr("Total Score"); QList taskList = curContest->getTaskList(); - Settings setting; curContest->copySettings(setting); @@ -153,7 +151,6 @@ void ResultViewer::refreshViewer() setColumnCount(taskList.size() + 5); setHorizontalHeaderLabels(headerList); horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); - QList contestantList = curContest->getContestantList(); QList< QPair> sortList; QList fullScore; @@ -180,7 +177,6 @@ void ResultViewer::refreshViewer() if (score != -1) { item(i, j + 3)->setData(Qt::DisplayRole, score); - QColor bg = QColor::fromHsl(0, 0, 255); if (taskList[j]->getTaskType() != Task::AnswersOnly && contestantList[i]->getCompileState(j) != CompileSuccessfully) @@ -209,11 +205,9 @@ void ResultViewer::refreshViewer() { item(i, 2)->setData(Qt::DisplayRole, totalScore); item(i, 2)->setBackground(setting.getColorGrand(totalScore, sfullScore)); - QFont font; font.setBold(true); item(i, 2)->setFont(font); - item(i, taskList.size() + 3)->setData(Qt::DisplayRole, double (totalUsedTime) / 1000); item(i, taskList.size() + 4)->setData(Qt::DisplayRole, judgingTime.toString("yyyy-MM-dd hh:mm:ss")); sortList.append(qMakePair(-totalScore, contestantList[i]->getContestantName())); @@ -267,9 +261,7 @@ void ResultViewer::refreshViewer() void ResultViewer::judgeSelected() { QList selectionRange = selectedRanges(); - QMap> mapping; - QList taskList = curContest->getTaskList(); int taskSize = taskList.size(); @@ -318,7 +310,6 @@ void ResultViewer::judgeAll() void ResultViewer::judgeUnjudged() { QMap> mapping; - QList contestantList = curContest->getContestantList(); QList taskList = curContest->getTaskList(); int contestantSize = contestantList.size(); @@ -354,7 +345,6 @@ void ResultViewer::judgeUnjudged() void ResultViewer::judgeGrey() { QMap> mapping; - QList contestantList = curContest->getContestantList(); QList taskList = curContest->getTaskList(); int contestantSize = contestantList.size(); @@ -390,7 +380,6 @@ void ResultViewer::judgeGrey() void ResultViewer::judgeMagenta() { QMap> mapping; - QList contestantList = curContest->getContestantList(); QList taskList = curContest->getTaskList(); int contestantSize = contestantList.size(); diff --git a/settings.cpp b/settings.cpp index 70df2f51..4e40b4a6 100644 --- a/settings.cpp +++ b/settings.cpp @@ -233,7 +233,6 @@ auto Settings::getColorPer(double p) -> QColor double h; double s; double l; - distan = (colorMxH - colorMiH) / 360.00 / 110.00; h = colorMiH / 360.00 + 100 * p * distan; @@ -262,7 +261,6 @@ auto Settings::getColorPer(double p) -> QColor h = fmax(0, fmin(h, 1)); s = fmax(0, fmin(s, 1)); l = fmax(0, fmin(l, 1)); - return QColor::fromHslF(h, s, l); } @@ -272,7 +270,6 @@ auto Settings::getColorGrand(double p) -> QColor double h; double s; double l; - distan = grandRateH * (colorMxH - colorMiH) / 360.00 / 110.00; h = grandCompH / 360.00 + colorMiH / 360.00 + 100 * p * distan; @@ -301,7 +298,6 @@ auto Settings::getColorGrand(double p) -> QColor h = fmax(0, fmin(h, 1)); s = fmax(0, fmin(s, 1)); l = fmax(0, fmin(l, 1)); - return QColor::fromHslF(h, s, l); } @@ -402,9 +398,7 @@ auto Settings::getCompiler(int index) -> Compiler * return compilerList[index]; } - return nullptr; - } void Settings::swapCompiler(int a, int b) @@ -647,9 +641,7 @@ void Settings::copyFrom(Settings *other) void Settings::saveSettings() { QSettings settings("Crash", "Lemon"); - settings.setValue("UiLanguage", uiLanguage); - settings.beginGroup("GeneralSettings"); settings.setValue("DefaultFullScore", defaultFullScore); settings.setValue("DefaultTimeLimit", defaultTimeLimit); @@ -663,7 +655,6 @@ void Settings::saveSettings() settings.setValue("InputFileExtensions", inputFileExtensions); settings.setValue("OutputFileExtensions", outputFileExtensions); settings.endGroup(); - settings.beginGroup("VisualSettings"); settings.setValue("ColorMxH", colorMxH); settings.setValue("ColorMxS", colorMxS); @@ -685,7 +676,6 @@ void Settings::saveSettings() settings.setValue("GrandRateL", grandRateL); settings.setValue("SplashTime", splashTime); settings.endGroup(); - settings.beginWriteArray("v1.2/CompilerSettings"); for (int i = 0; i < compilerList.size(); i ++) @@ -718,7 +708,6 @@ void Settings::saveSettings() } settings.endArray(); - settings.beginWriteArray("v1.2/RecentContest"); for (int i = 0; i < recentContest.size(); i ++) @@ -737,11 +726,8 @@ void Settings::loadSettings() compilerList.clear(); recentContest.clear(); - QSettings settings("Crash", "Lemon"); - uiLanguage = settings.value("UiLanguage", QLocale::system().name()).toString(); - settings.beginGroup("GeneralSettings"); defaultFullScore = settings.value("DefaultFullScore", 10).toInt(); defaultTimeLimit = settings.value("DefaultTimeLimit", 1000).toInt(); @@ -755,7 +741,6 @@ void Settings::loadSettings() inputFileExtensions = settings.value("InputFileExtensions", QStringList() << "in").toStringList(); outputFileExtensions = settings.value("OutputFileExtensions", QStringList() << "out" << "ans").toStringList(); settings.endGroup(); - settings.beginGroup("VisualSettings"); colorMxH = settings.value("ColorMxH", 120).toInt(); colorMxS = settings.value("ColorMxS", 50).toDouble(); @@ -777,7 +762,6 @@ void Settings::loadSettings() grandRateL = settings.value("GrandRateL", 1.33).toDouble(); splashTime = settings.value("SplashTime", 500).toInt(); settings.endGroup(); - int compilerCount = settings.beginReadArray("v1.2/CompilerSettings"); for (int i = 0; i < compilerCount; i ++) @@ -820,7 +804,6 @@ void Settings::loadSettings() } settings.endArray(); - int listCount = settings.beginReadArray("v1.2/RecentContest"); for (int i = 0; i < listCount; i ++) @@ -830,7 +813,6 @@ void Settings::loadSettings() } settings.endArray(); - #ifdef Q_OS_WIN32 diffPath = QDir::toNativeSeparators(QDir::currentPath()) + QDir::separator() + "diff.exe"; #endif diff --git a/statisticsbrowser.cpp b/statisticsbrowser.cpp index bd56e550..dcd1f51a 100644 --- a/statisticsbrowser.cpp +++ b/statisticsbrowser.cpp @@ -53,7 +53,6 @@ void StatisticsBrowser::setContest(Contest *contest) auto StatisticsBrowser::getScoreNormalChart(const QMap &scoreCount, int listSize, int totalScore) -> QString { QString buffer = ""; - long long overallScoreSum = 0; double scoreDiscrim = 0; double scoreStandardDevia = 0; @@ -78,7 +77,6 @@ auto StatisticsBrowser::getScoreNormalChart(const QMap &scoreCount, in } double scoreAverage = 1.00 * overallScoreSum / listSize; - buffer += "
%1%1%1%1
%2
"; buffer += QString("").arg(tr("Score")).arg(tr("Count")).arg(tr("Ratio")).arg(tr("Prefix")).arg(tr("Suffix")); @@ -87,9 +85,7 @@ auto StatisticsBrowser::getScoreNormalChart(const QMap &scoreCount, in i--; int curScoreTier = i.key(); int curScoreTierNum = i.value(); - scoreStandardDevia += qPow(curScoreTier - scoreAverage, 2) * curScoreTierNum; - buffer += ""; buffer += QString("").arg(curScoreTier < 0 ? QString("N/A") : QString::number(curScoreTier)); buffer += QString("").arg(curScoreTierNum); @@ -101,21 +97,17 @@ auto StatisticsBrowser::getScoreNormalChart(const QMap &scoreCount, in } buffer += "
%1%2%3%4%5
%1 Pt%1
"; - scoreStandardDevia = qSqrt(scoreStandardDevia / listSize); scoreDiscrim = scoreDiscrim * scoreDiscrim; - buffer += "

" + tr("Average") + " : " + QString::number(scoreAverage) + " / " + QString::number(totalScore) + "

"; buffer += "

" + tr("Standard Deviation") + " : " + QString::number(scoreStandardDevia) + "

"; buffer += "

" + tr("Score Discrimination Power") + " : " + QString::number(scoreDiscrim) + "

"; - return buffer; } auto StatisticsBrowser::getTestcaseScoreChart(QList testCaseList, QList>> scoreList, QList>> resultList) -> QString { QString buffer = ""; - buffer += ""; buffer += QString("").arg(tr("No.")).arg(tr("Input")).arg(tr("Output")).arg(tr("Pure")).arg(tr("Far")).arg(tr("Lost")).arg(tr("Average")); @@ -123,7 +115,6 @@ auto StatisticsBrowser::getTestcaseScoreChart(QList testCaseList, QL { QStringList inFileList = testCaseList[i]->getInputFiles(); QStringList outFileList = testCaseList[i]->getOutputFiles(); - int mxScore = testCaseList[i]->getFullScore(); QList miScoreRecord; QList miStatRecord; @@ -202,11 +193,10 @@ auto StatisticsBrowser::getTestcaseScoreChart(QList testCaseList, QL } buffer += "
%1%2%3%4%5%6%7
"; - return buffer; } -int StatisticsBrowser::checkValid(QList taskList, QList contestantList) +auto StatisticsBrowser::checkValid(QList taskList, const QList &contestantList) -> int { for (auto i : taskList) { @@ -296,17 +286,12 @@ void StatisticsBrowser::refresh() } int totalScore = curContest->getTotalScore(); - buffer += ""; buffer += ""; buffer += ""; - buffer += "

" + QString("%1 %2").arg(tr("Contest")).arg(curContest->getContestTitle()) + "

"; - buffer += "

" + tr("Overall") + "

"; - int haveError = 0; - QMap scoreCount; for (auto &i : contestantList) @@ -333,7 +318,6 @@ void StatisticsBrowser::refresh() buffer += getScoreNormalChart(scoreCount, contestantList.size(), totalScore); buffer += "
"; buffer += "
"; - buffer += "

" + tr("Problems") + "

"; for (int i = 0; i < taskList.size(); i++) @@ -341,9 +325,7 @@ void StatisticsBrowser::refresh() buffer += "

"; buffer += QString("%1 %2: %3").arg(tr("Task")).arg(i + 1).arg(taskList[i]->getProblemTile()); buffer += "

"; - int numberSubmitted = 0; - QMap cnts; QList>> TestcaseScoreList; QList>> resultList; @@ -384,10 +366,8 @@ void StatisticsBrowser::exportStatsticsHtml(QWidget *widget, const QString &file QApplication::setOverrideCursor(Qt::WaitCursor); QTextStream out(&file); - out.setCodec("UTF-8"); out << nowBrowserText; - QApplication::restoreOverrideCursor(); QMessageBox::information(widget, tr("LemonLime"), tr("Export is done"), QMessageBox::Ok); } @@ -418,12 +398,10 @@ void StatisticsBrowser::exportStatstics(QWidget *widget, Contest *curContest) } QString filter = tr("HTML Document (*.html)"); - QString fileName = QFileDialog::getSaveFileName(widget, tr("Export Statstics"), QDir::currentPath() + QDir::separator() + "statstics.html", filter); if (fileName.isEmpty()) return; if (QFileInfo(fileName).suffix() == "html") exportStatsticsHtml(widget, fileName); - } diff --git a/statisticsbrowser.h b/statisticsbrowser.h index d244f5cc..1e9dfa0a 100644 --- a/statisticsbrowser.h +++ b/statisticsbrowser.h @@ -51,7 +51,7 @@ public slots: private: Ui::StatisticsBrowser *ui; Contest *curContest; - int checkValid(QList, QList); + static int checkValid(QList, const QList &); static QString getScoreNormalChart(const QMap &, int, int); static QString getTestcaseScoreChart(QList, QList>>, QList>>); static void exportStatsticsHtml(QWidget *, const QString &); diff --git a/summarytree.cpp b/summarytree.cpp index 51075212..d6924a81 100644 --- a/summarytree.cpp +++ b/summarytree.cpp @@ -32,7 +32,6 @@ SummaryTree::SummaryTree(QWidget *parent) : { curContest = nullptr; addCount = 0; - addTaskAction = new QAction(tr("Add a New Task"), this); addTestCaseAction = new QAction(tr("Add a Test Case"), this); addTestCasesAction = new QAction(tr("Add Test Cases ..."), this); @@ -42,7 +41,6 @@ SummaryTree::SummaryTree(QWidget *parent) : addTestCaseKeyAction = new QAction(this); deleteTaskKeyAction = new QAction(this); deleteTestCaseKeyAction = new QAction(this); - addTaskKeyAction->setShortcutContext(Qt::WidgetShortcut); addTestCaseKeyAction->setShortcutContext(Qt::WidgetShortcut); deleteTaskKeyAction->setShortcutContext(Qt::WidgetShortcut); @@ -59,7 +57,6 @@ SummaryTree::SummaryTree(QWidget *parent) : addAction(addTestCaseKeyAction); addAction(deleteTaskKeyAction); addAction(deleteTestCaseKeyAction); - connect(addTaskAction, SIGNAL(triggered()), this, SLOT(addTask())); connect(addTestCaseAction, SIGNAL(triggered()), @@ -162,7 +159,6 @@ void SummaryTree::setSettings(Settings *_settings) void SummaryTree::contextMenuEvent(QContextMenuEvent */*event*/) { auto *contextMenu = new QMenu(this); - QTreeWidgetItem *curItem = currentItem(); if (! curItem) diff --git a/task.cpp b/task.cpp index cd1800ef..48198dd4 100644 --- a/task.cpp +++ b/task.cpp @@ -303,9 +303,7 @@ auto Task::getTestCase(int index) const -> TestCase * return testCaseList[index]; } - return nullptr; - } void Task::deleteTestCase(int index) diff --git a/taskeditwidget.cpp b/taskeditwidget.cpp index 8505f0ba..887f11d9 100644 --- a/taskeditwidget.cpp +++ b/taskeditwidget.cpp @@ -31,9 +31,7 @@ TaskEditWidget::TaskEditWidget(QWidget *parent) : ui(new Ui::TaskEditWidget) { ui->setupUi(this); - editTask = nullptr; - ui->specialJudge->setFilters(QDir::Files | QDir::Executable); ui->interactorPath->setFilters(QDir::Files); ui->graderPath->setFilters(QDir::Files); @@ -43,18 +41,14 @@ TaskEditWidget::TaskEditWidget(QWidget *parent) : ui->interactorPath, SLOT(refreshFileList())); connect(this, SIGNAL(dataPathChanged()), ui->graderPath, SLOT(refreshFileList())); - ui->sourceFileName->setValidator(new QRegExpValidator(QRegExp("\\w+"), this)); ui->inputFileName->setValidator(new QRegExpValidator(QRegExp(R"((\w+)(\.\w+)?)"), this)); ui->outputFileName->setValidator(new QRegExpValidator(QRegExp(R"((\w+)(\.\w+)?)"), this)); ui->interactorName->setValidator(new QRegExpValidator(QRegExp(R"((\w+)(\.\w+)?)"), this)); ui->answerFileExtension->setValidator(new QRegExpValidator(QRegExp("\\w+"), this)); - ui->sourceFilesTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->graderFilesTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - //ui->interactionButton->setVisible(false); //rebuilding interaction, remove it temporarily - connect(ui->problemTitle, SIGNAL(textChanged(QString)), this, SLOT(problemTitleChanged(QString))); connect(ui->traditionalButton, SIGNAL(toggled(bool)), @@ -200,7 +194,6 @@ void TaskEditWidget::refreshWidgetState() if (! editTask) return; int types = editTask->getTaskType(); - ui->interactorPathLabel->setVisible(types == Task::Interaction); ui->interactorPath->setVisible(types == Task::Interaction); ui->graderPathLabel->setVisible(types == Task::Interaction); @@ -240,7 +233,6 @@ void TaskEditWidget::refreshWidgetState() ui->multiFilesPathLineEdit->setVisible(types == Task::Communication); ui->multiFilesNameLineEdit->setVisible(types == Task::Communication); ui->multiFilesPathNameLabel->setVisible(types == Task::Communication); - multiFilesRefresh(); } @@ -483,7 +475,6 @@ void TaskEditWidget::multiFilesRefresh() QStringList sourcePaths = editTask->getSourceFilesPath(); QStringList sourceNames = editTask->getSourceFilesName(); - ui->sourceFilesTable->setRowCount(sourcePaths.length()); for (int i = 0; i < sourcePaths.length() ; i++) @@ -494,7 +485,6 @@ void TaskEditWidget::multiFilesRefresh() QStringList graderPaths = editTask->getGraderFilesPath(); QStringList graderNames = editTask->getGraderFilesName(); - ui->graderFilesTable->setRowCount(graderPaths.length()); for (int i = 0; i < graderPaths.length() ; i++) @@ -542,10 +532,8 @@ void TaskEditWidget::addSourceFileClicked() if (path.length() <= 0 || name.length() <= 0) return; addSourceFiles(path, name); - ui->multiFilesPathLineEdit->clear(); ui->multiFilesNameLineEdit->clear(); - multiFilesRefresh(); } @@ -559,10 +547,8 @@ void TaskEditWidget::addGraderFileClicked() if (path.length() <= 0 || name.length() <= 0) return; addGraderFiles(path, name); - ui->multiFilesPathLineEdit->clear(); ui->multiFilesNameLineEdit->clear(); - multiFilesRefresh(); } @@ -575,7 +561,6 @@ void TaskEditWidget::rmSourceFileClicked() if (ranges.length() <= 0) return; rmSourceFilesAt(ranges.at(0).topRow()); - multiFilesRefresh(); } @@ -588,6 +573,5 @@ void TaskEditWidget::rmGraderFileClicked() if (ranges.length() <= 0) return; rmGraderFilesAt(ranges.at(0).topRow()); - multiFilesRefresh(); } diff --git a/testcaseeditwidget.cpp b/testcaseeditwidget.cpp index 44c10cfc..1423f052 100644 --- a/testcaseeditwidget.cpp +++ b/testcaseeditwidget.cpp @@ -31,24 +31,19 @@ TestCaseEditWidget::TestCaseEditWidget(QWidget *parent) : ui(new Ui::TestCaseEditWidget) { ui->setupUi(this); - editTestCase = nullptr; - deleteAction = new QAction(this); deleteAction->setShortcutContext(Qt::WidgetShortcut); deleteAction->setShortcut(QKeySequence::Delete); deleteAction->setEnabled(false); ui->fileList->addAction(deleteAction); - QRegExp regx("[0-9,]+$"); QValidator *subtaskDependenceValidator = new QRegExpValidator(regx, ui->subtaskDependecne); ui->subtaskDependecne->setValidator(subtaskDependenceValidator); - ui->fullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore(), this)); ui->timeLimit->setValidator(new QIntValidator(1, Settings::upperBoundForTimeLimit(), this)); ui->memoryLimit->setValidator(new QIntValidator(1, Settings::upperBoundForMemoryLimit(), this)); ui->fileList->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - ui->inputFileEdit->setFilters(QDir::Files); ui->outputFileEdit->setFilters(QDir::Files); connect(this, SIGNAL(dataPathChanged()), @@ -57,7 +52,6 @@ TestCaseEditWidget::TestCaseEditWidget(QWidget *parent) : ui->outputFileEdit, SLOT(refreshFileList())); connect(ui->subtaskDependecne, SIGNAL(editingFinished()), this, SLOT(subtaskDependenceChanged())); //auto save subtaskDependence - connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addSingleCase())); connect(deleteAction, SIGNAL(triggered()), diff --git a/testlib_for_lemons.h b/testlib_for_lemons.h index fc07f1b1..0623b5af 100644 --- a/testlib_for_lemons.h +++ b/testlib_for_lemons.h @@ -503,7 +503,6 @@ class random_t void setSeed(int argc, char *argv[]) { random_t p; - seed = 3905348978240129619LL; for (int i = 1; i < argc; i++) @@ -552,7 +551,6 @@ class random_t return (int)((n * (long long) nextBits(31)) >> 31); const long long limit = INT_MAX / n * n; - long long bits; do @@ -579,7 +577,6 @@ class random_t __testlib_fail("random_t::next(long long n): n must be positive"); const long long limit = __TESTLIB_LONGLONG_MAX / n * n; - long long bits; do @@ -968,7 +965,6 @@ static bool __pattern_isCommandChar(const std::string &s, size_t pos, char value return false; int slashes = 0; - int before = int (pos) - 1; while (before >= 0 && s[before] == '\\') @@ -1078,7 +1074,6 @@ static void __pattern_scanCounts(const std::string &s, size_t &pos, int &from, i { std::vector parts; std::string part; - pos++; while (pos < s.length() && !__pattern_isCommandChar(s, pos, '}')) @@ -1158,7 +1153,6 @@ static std::vector __pattern_scanCharSet(const std::string &s, size_t &pos { pos++; bool negative = __pattern_isCommandChar(s, pos, '^'); - char prev = 0; while (pos < s.length() && !__pattern_isCommandChar(s, pos, ']')) @@ -1183,7 +1177,6 @@ static std::vector __pattern_scanCharSet(const std::string &s, size_t &pos result.push_back(c); result.push_back(next); - prev = 0; } else @@ -1236,7 +1229,6 @@ pattern::pattern(std::string s) : s(s), from(0), to(0) t += s[i]; s = t; - int opened = 0; int firstClose = -1; std::vector seps; @@ -1539,7 +1531,6 @@ class BufferedFileInputStreamReader: public InputStreamReader bufferSize = MAX_UNREAD_COUNT + readSize; bufferPos = int (MAX_UNREAD_COUNT); std::memset(isEof + MAX_UNREAD_COUNT, 0, sizeof(isEof[0]) * readSize); - return readSize > 0; } else @@ -1977,7 +1968,6 @@ void InStream::textColor(WORD color) HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(handle, color); #endif - #ifdef linux char *shell_path = getenv("SHELL"); @@ -2148,7 +2138,6 @@ NORETURN void InStream::quit(TResult result, const char *msg) quitscr(LightGray, msg); std::fprintf(stderr, "\n"); - inf.close(); ouf.close(); ans.close(); @@ -2256,7 +2245,6 @@ void InStream::reset() } opened = true; - __testlib_set_binary(file); if (stdfile) @@ -2277,7 +2265,6 @@ void InStream::init(std::string fileName, TMode mode) void InStream::init(std::FILE *f, TMode mode) { opened = false; - name = "untitled"; if (f == stdin) @@ -2291,7 +2278,6 @@ void InStream::init(std::FILE *f, TMode mode) this->file = f; this->mode = mode; - reset(); } @@ -2499,9 +2485,7 @@ static inline bool equals(long long integer, const char *s) static inline double stringToDouble(InStream &in, const char *buffer) { double retval; - size_t length = strlen(buffer); - int minusCount = 0; int plusCount = 0; int decimalPointCount = 0; @@ -2562,7 +2546,6 @@ static inline double stringToStrictDouble(InStream &in, const char *buffer, int in.quit(_fail, "stringToStrictDouble: minAfterPointDigitCount should be less or equal to maxAfterPointDigitCount."); double retval; - size_t length = strlen(buffer); if (length == 0 || length > 1000) @@ -2647,7 +2630,6 @@ static inline long long stringToLongLong(InStream &in, const char *buffer) in.quit(_pe, ("Expected integer, but \"" + __testlib_part(buffer) + "\" found").c_str()); long long retval = 0LL; - int zeroes = 0; int processingZeroes = true; @@ -2687,7 +2669,6 @@ int InStream::readInteger() quit(_unexpected_eof, "Unexpected end of file - int32 expected"); readWordTo(_tmpReadToken); - long long value = stringToLongLong(*this, _tmpReadToken.c_str()); if (value < INT_MIN || value > INT_MAX) @@ -2860,7 +2841,6 @@ bool InStream::eoln() else { bool returnCr = false; - #ifdef CR_MUST_IN_EOL if (c != CR) @@ -3048,7 +3028,6 @@ NORETURN void quit(TResult result, const char *msg) NORETURN void __testlib_quitp(double points, const char *message) { __testlib_points = points; - std::string quitMessage; if (localJudger) @@ -3122,7 +3101,6 @@ NORETURN void __testlib_help() std::fprintf(stderr, "by Mike Mirzayanov, copyright(c) 2005-2013\n"); std::fprintf(stderr, "Checker name: \"%s\"\n", checkerName.c_str()); InStream::textColor(InStream::LightGray); - std::fprintf(stderr, "\n"); std::fprintf(stderr, "Latest features: \n"); @@ -3132,10 +3110,8 @@ NORETURN void __testlib_help() } std::fprintf(stderr, "\n"); - std::fprintf(stderr, "Program must be run with the following arguments: \n"); std::fprintf(stderr, " [ [<-appes>]]\n\n"); - std::exit(FAIL_EXIT_CODE); } @@ -3143,10 +3119,8 @@ static void __testlib_ensuresPreconditions() { // testlib assumes: sizeof(int) = 4. __TESTLIB_STATIC_ASSERT(sizeof(int) == 4); - // testlib assumes: INT_MAX == 2147483647. __TESTLIB_STATIC_ASSERT(INT_MAX == 2147483647); - // testlib assumes: sizeof(long long) = 8. __TESTLIB_STATIC_ASSERT(sizeof(long long) == 8); @@ -3164,9 +3138,7 @@ void registerGen(int argc, char *argv[], int randomGeneratorVersion) quitf(_fail, "Random generator version is expected to be 0 or 1."); random_t::version = randomGeneratorVersion; - __testlib_ensuresPreconditions(); - testlibMode = _generator; __testlib_set_binary(stdin); rnd.setSeed(argc, argv); @@ -3191,7 +3163,6 @@ void registerGen(int argc, char *argv[]) void registerInteraction(int argc, char *argv[]) { __testlib_ensuresPreconditions(); - testlibMode = _interactor; __testlib_set_binary(stdin); @@ -3252,10 +3223,8 @@ void registerInteraction(int argc, char *argv[]) void registerValidation() { __testlib_ensuresPreconditions(); - testlibMode = _validator; __testlib_set_binary(stdin); - inf.init(stdin, _input); inf.strict = true; } @@ -3263,7 +3232,6 @@ void registerValidation() void registerTestlibCmd(int argc, char *argv[]) { __testlib_ensuresPreconditions(); - testlibMode = _checker; __testlib_set_binary(stdin); @@ -3315,7 +3283,6 @@ void registerTestlib(int argc, ...) " [ [<-appes>]]"); char **argv = new char *[argc + 1]; - va_list ap; va_start(ap, argc); argv[0] = NULL; @@ -3326,7 +3293,6 @@ void registerTestlib(int argc, ...) } va_end(ap); - registerTestlibCmd(argc + 1, argv); delete[] argv; } @@ -3335,10 +3301,8 @@ void registerLocalChecker(const std::string &_inputFile, const std::string &_out { localJudger = 1; __testlib_ensuresPreconditions(); - testlibMode = _checker; __testlib_set_binary(stdin); - inf.init(_inputFile, _input); ouf.init(_outputFile, _output); ans.init(_answerFile, _answer); diff --git a/visualsettings.cpp b/visualsettings.cpp index f93d5f74..8a3167e7 100644 --- a/visualsettings.cpp +++ b/visualsettings.cpp @@ -25,7 +25,6 @@ VisualSettings::VisualSettings(QWidget *parent) : ui(new Ui::VisualSettings) { ui->setupUi(this); - connect(ui->spinBoxMxH, SIGNAL(valueChanged(int)), this, SLOT(colorMxHChanged(int))); connect(ui->doubleSpinBoxMxS, SIGNAL(valueChanged(double)), @@ -50,7 +49,6 @@ VisualSettings::VisualSettings(QWidget *parent) : this, SLOT(colorCeSChanged(double))); connect(ui->doubleSpinBoxCeL, SIGNAL(valueChanged(double)), this, SLOT(colorCeLChanged(double))); - connect(ui->grandCompH, SIGNAL(valueChanged(double)), this, SLOT(grandCompHChanged(double))); connect(ui->grandCompS, SIGNAL(valueChanged(double)), @@ -63,10 +61,8 @@ VisualSettings::VisualSettings(QWidget *parent) : this, SLOT(grandRateSChanged(double))); connect(ui->grandRateL, SIGNAL(valueChanged(double)), this, SLOT(grandRateLChanged(double))); - connect(ui->splashTime, SIGNAL(valueChanged(int)), this, SLOT(splashTimeChanged(int))); - connect(ui->resetToDefaultButton, SIGNAL(clicked()), this, SLOT(whenResetToDefault())); } @@ -121,7 +117,6 @@ void VisualSettings::whenResetToDefault() void VisualSettings::resetEditSettings(Settings *settings) { editSettings = settings; - ui->spinBoxMxH->setValue(editSettings->getColorMxH()); ui->doubleSpinBoxMxS->setValue(editSettings->getColorMxS()); ui->doubleSpinBoxMxL->setValue(editSettings->getColorMxL()); diff --git a/watcher_macos.cpp b/watcher_macos.cpp index dc63cbee..a9e63203 100644 --- a/watcher_macos.cpp +++ b/watcher_macos.cpp @@ -47,7 +47,6 @@ int main(int argc, char *argv[]) timeLimit = (timeLimit - 1) / 1000 + 1; sscanf(argv[6], "%d", &memoryLimit); memoryLimit *= 1024; - pid = fork(); if (pid > 0) @@ -124,7 +123,6 @@ int main(int argc, char *argv[]) { (rlim_t) timeLimit, (rlim_t)(timeLimit + 1) }; - setrlimit(RLIMIT_AS, &memlim); setrlimit(RLIMIT_STACK, &stalim); setrlimit(RLIMIT_CPU, &timlim); diff --git a/watcher_unix b/watcher_unix index 2c193c59fab8a02e05f8fdc33b8e433c4e5a4c62..3906783e5034266ca3b3957cd3e9d25debb2af0d 100755 GIT binary patch literal 32232 zcmeHwd3;>Ok^dWwMw-!ck4CaA+cMa)kc}@%mT!Y?G?K=ev2~#t*)rE-ERC$ex|kW+ zhJf+L7!bx_5+Fdxt~o;z@`GdvVIhajooqI1$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