From 4ab15c2ee16c433a980b6551b3bc6c89770e6a50 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 2 Mar 2023 18:15:31 +0800 Subject: [PATCH] - enhancement: When first display two editor panes, auto make them the same width - change: Don't rebuild the whole project when run/debug, if only contents of project unit file is modified. - fix: rebuild may not work, if project's parallel build option is enabled. --- NEWS.md | 3 +++ RedPandaIDE/compiler/compiler.cpp | 3 +++ RedPandaIDE/compiler/compiler.h | 2 ++ RedPandaIDE/compiler/projectcompiler.cpp | 11 ++++++++-- RedPandaIDE/editorlist.cpp | 8 ++++++++ RedPandaIDE/mainwindow.cpp | 26 +++++++++++++++++++++++- RedPandaIDE/project.cpp | 2 -- 7 files changed, 50 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 3f6a3ad9..f784df60 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,9 @@ Red Panda C++ Version 2.16 - fix: Can't correctly parse function pointer var definition. - enhancement: Improve support for function pointer typedefs. - enhancement: Improve support for function pointer vars. + - enhancement: When first display two editor panes, auto make them the same width + - change: Don't rebuild the whole project when run/debug, if only contents of project unit file is modified. + - fix: rebuild may not work, if project's parallel build option is enabled. Red Panda C++ Version 2.15 diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index 267706ff..71c20397 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -62,6 +62,9 @@ void Compiler::run() QElapsedTimer timer; timer.start(); runCommand(mCompiler, mArguments, mDirectory, pipedText()); + for(int i=0;idirectory(), mProject->makeFileName())); } else if (mRebuild) { - mArguments = QString(" %1 -f \"%2\" clean all").arg(parallelParam, - extractRelativePath( + mArguments = QString(" -f \"%1\" clean").arg(extractRelativePath( mProject->directory(), mProject->makeFileName())); + mExtraCompilersList.append(mCompiler); + mExtraArgumentsList.append(QString(" %1 -f \"%2\" all").arg(parallelParam, + extractRelativePath( + mProject->directory(), + mProject->makeFileName()))); } else { mArguments = QString(" %1 -f \"%2\" all").arg(parallelParam, extractRelativePath( @@ -619,6 +623,9 @@ bool ProjectCompiler::prepareForCompile() log("--------"); log(tr("- makefile processer: %1").arg(mCompiler)); log(tr("- Command: %1 %2").arg(extractFileName(mCompiler)).arg(mArguments)); + for(int i=0;isetVisible(true); mRightPageWidget->setVisible(true); + { + QList sizes=mSplitter->sizes(); + int total = sizes[0]+sizes[1]; + sizes[0] = total / 2; + sizes[1] = total - sizes[0]; + mSplitter->setSizes(sizes); + } + break; } } diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index c6205a9f..d349d163 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -2051,7 +2051,19 @@ void MainWindow::runExecutable(RunType runType) QStringList binDirs = mProject->binDirs(); QFileInfo execInfo(mProject->executable()); QDateTime execModTime = execInfo.lastModified(); + if (execInfo.exists() && mProject->modifiedSince(execModTime)) { + //if project options changed, or units added/removed + //mProject->saveAll(); + mCompileSuccessionTask=std::make_shared(); + mCompileSuccessionTask->type = CompileSuccessionTaskType::RunNormal; + mCompileSuccessionTask->execName=mProject->executable(); + mCompileSuccessionTask->isExecutable=true; + mCompileSuccessionTask->binDirs=binDirs; + compile(true); + return; + } if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) { + //if units modified; //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = CompileSuccessionTaskType::RunNormal; @@ -2166,7 +2178,8 @@ void MainWindow::debug() { QFileInfo execInfo(mProject->executable()); QDateTime execModTime = execInfo.lastModified(); - if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) { + if (execInfo.exists() && mProject->modifiedSince(execModTime)) { + //if project options changed, or units added/removed //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; @@ -2176,6 +2189,17 @@ void MainWindow::debug() compile(true); return; } + if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) { + //if units modified + //mProject->saveAll(); + mCompileSuccessionTask=std::make_shared(); + mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; + mCompileSuccessionTask->execName=mProject->executable(); + mCompileSuccessionTask->isExecutable=true; + mCompileSuccessionTask->binDirs=binDirs; + compile(); + return; + } } // Did we choose a host application for our DLL? if (mProject->options().type == ProjectType::DynamicLib) { diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index e3c1116e..a23beb81 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -189,8 +189,6 @@ bool Project::modifiedSince(const QDateTime &time) { if (modified()) return true; - if (unitsModifiedSince(time)) - return true; QFileInfo info(filename()); return (info.lastModified()>time); }