From c637ca3e4b8395ab38e10ee9d24f5db37362269c Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 1 Mar 2023 18:46:43 +0800 Subject: [PATCH] - fix: Can't debug project when project is saved after it's compiled. --- NEWS.md | 1 + RedPandaIDE/mainwindow.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 6ca257f0..541f3427 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Red Panda C++ Version 2.16 - fix: Project files that not in the project folder is not correctly handled in makefile. - enhancement: Improve support for function pointer typedefs. + - fix: Can't debug project when project is saved after it's compiled. Red Panda C++ Version 2.15 diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 6993228d..093c9ec7 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -2051,7 +2051,7 @@ void MainWindow::runExecutable(RunType runType) QStringList binDirs = mProject->binDirs(); QFileInfo execInfo(mProject->executable()); QDateTime execModTime = execInfo.lastModified(); - if (execInfo.exists() && mProject->modifiedSince(execModTime)) { + if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) { //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = CompileSuccessionTaskType::RunNormal; @@ -2166,14 +2166,14 @@ void MainWindow::debug() { QFileInfo execInfo(mProject->executable()); QDateTime execModTime = execInfo.lastModified(); - if (execInfo.exists() && mProject->modifiedSince(execModTime)) { + if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) { //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; mCompileSuccessionTask->execName=mProject->executable(); mCompileSuccessionTask->isExecutable=true; mCompileSuccessionTask->binDirs=binDirs; - compile(); + compile(true); return; } }