From ba9bbca010ae791a479040445c18699644ae4069 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 14 Mar 2024 13:03:06 +0800 Subject: [PATCH] - change: When debugging, don't auto set focus to the editor. --- NEWS.md | 1 + RedPandaIDE/mainwindow.cpp | 6 +++--- RedPandaIDE/settings.cpp | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 900d5204..b9017c3c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -54,6 +54,7 @@ Red Panda C++ Version 2.27 - fix: Debugger console's background not correctly cleared before redrawn. - enhancement: Make output in the debug console cleaner. - enhancement: Execute the last debug command in the debug console if ENTER pressed. + - change: When debugging, don't auto set focus to the editor. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 11d84041..86e9830f 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1152,7 +1152,7 @@ void MainWindow::setActiveBreakpoint(QString fileName, int Line, bool setFocus) { removeActiveBreakpoints(); // Then active the current line in the current file - Editor *e = openFile(fileName); + Editor *e = openFile(fileName, false); if (e!=nullptr) { e->setActiveBreakpointFocus(Line,setFocus); if (setFocus) { @@ -2561,10 +2561,10 @@ void MainWindow::debug() } prepareDebugger(); - QString filePath = debugFile.filePath().replace('\\','/'); + QString newFilePath = debugFile.filePath().replace('\\','/'); if (!mDebugger->startClient( pSettings->compilerSets().defaultIndex(), - filePath, + newFilePath, true, debugInferiorhasBreakpoint(), binDirs, diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 98c34e67..afbad3d9 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -3387,6 +3387,9 @@ void Settings::CompilerSets::loadSets() mSettings->mSettings.beginGroup(SETTING_COMPILTER_SETS); mDefaultIndex = mSettings->mSettings.value(SETTING_COMPILTER_SETS_DEFAULT_INDEX,-1).toInt(); mDefaultIndexTimeStamp = mSettings->mSettings.value(SETTING_COMPILTER_SETS_DEFAULT_INDEX_TIMESTAMP,0).toLongLong(); + //fix error time + if (mDefaultIndexTimeStamp > QDateTime::currentMSecsSinceEpoch()) + mDefaultIndexTimeStamp = QDateTime::currentMSecsSinceEpoch(); int listSize = mSettings->mSettings.value(SETTING_COMPILTER_SETS_COUNT,0).toInt(); mSettings->mSettings.endGroup(); bool loadError = false;