From a410226f467db17e97b04f8615cc188d97949eee Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 17 Feb 2023 09:11:52 +0800 Subject: [PATCH] Don't confirm recompiler when debug single file --- RedPandaIDE/mainwindow.cpp | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index e4f42629..fbf44d94 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -2234,29 +2234,17 @@ void MainWindow::debug() debugFile.setFile(filePath); if (!debugFile.exists()) { - if (QMessageBox::question(this,tr("Compile"), - tr("Source file is not compiled.")+"

" + tr("Compile now?"), - QMessageBox::Yes|QMessageBox::No, - QMessageBox::Yes) == QMessageBox::Yes) { - mCompileSuccessionTask=std::make_shared(); - mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; - mCompileSuccessionTask->binDirs = binDirs; - compile(); - return; - } - } else { - if (compareFileModifiedTime(e->filename(),filePath)>=0) { - if (QMessageBox::question(this,tr("Compile"), - tr("Source file is more recent than executable.")+"

" + tr("Recompile?"), - QMessageBox::Yes|QMessageBox::No, - QMessageBox::Yes) == QMessageBox::Yes) { - mCompileSuccessionTask=std::make_shared(); - mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; - mCompileSuccessionTask->binDirs = binDirs; - compile(); - return; - } - } + mCompileSuccessionTask=std::make_shared(); + mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; + mCompileSuccessionTask->binDirs = binDirs; + compile(); + return; + } else if (compareFileModifiedTime(e->filename(),filePath)>=0) { + mCompileSuccessionTask=std::make_shared(); + mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; + mCompileSuccessionTask->binDirs = binDirs; + compile(); + return; } prepareDebugger();