From a14257971c14b5ab21bf278ab4447bf5a7073740 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Mon, 22 Nov 2021 16:40:50 +0800 Subject: [PATCH] - fix: when make project and del non-existing files, shouldn't show error messages --- NEWS.md | 2 ++ RedPandaIDE/compiler/compilermanager.cpp | 2 +- RedPandaIDE/compiler/projectcompiler.cpp | 9 +++++---- RedPandaIDE/mainwindow.cpp | 10 ---------- RedPandaIDE/mainwindow.h | 2 -- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/NEWS.md b/NEWS.md index a918d8aa..e86b69c8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,8 @@ Version 0.9.2 For Dev-C++ 7 Beta - fix: option "Move caret to the first non-space char in the current line when press HOME key" dosen't work fine. - fix: ctrl+left can't correctly move to the beginning of the last word - enhancement: add "delete line"/"duplicate line"/"delete word"/"delete to EOL"/"delete to BOL" in the edit menu + - fix: crash when run "Project" / "Clean Make files" + - fix: when make project and del non-existing files, shouldn't show error messages Version 0.9.1 For Dev-C++ 7 Beta - enhancement: code completion suggestion for "__func__" variable diff --git a/RedPandaIDE/compiler/compilermanager.cpp b/RedPandaIDE/compiler/compilermanager.cpp index 9c680f9e..ebc96c31 100644 --- a/RedPandaIDE/compiler/compilermanager.cpp +++ b/RedPandaIDE/compiler/compilermanager.cpp @@ -133,8 +133,8 @@ void CompilerManager::cleanProject(std::shared_ptr project) mCompileIssueCount = 0; ProjectCompiler* compiler = new ProjectCompiler(project,false,false); compiler->setOnlyClean(true); - mCompiler->setRebuild(false); mCompiler = compiler; + mCompiler->setRebuild(false); connect(mCompiler, &Compiler::finished, mCompiler, &QObject::deleteLater); connect(mCompiler, &Compiler::compileFinished, this, &CompilerManager::onCompileFinished); diff --git a/RedPandaIDE/compiler/projectcompiler.cpp b/RedPandaIDE/compiler/projectcompiler.cpp index d6b65313..90a04d91 100644 --- a/RedPandaIDE/compiler/projectcompiler.cpp +++ b/RedPandaIDE/compiler/projectcompiler.cpp @@ -9,7 +9,8 @@ #include ProjectCompiler::ProjectCompiler(std::shared_ptr project, bool silent, bool onlyCheckSyntax): - Compiler("",silent,onlyCheckSyntax) + Compiler("",silent,onlyCheckSyntax), + mOnlyClean(false) { setProject(project); } @@ -264,9 +265,9 @@ void ProjectCompiler::writeMakeClean(QFile &file) { writeln(file, "clean: clean-custom"); if (mProject->options().type == ProjectType::DynamicLib) - writeln(file, "\t${RM} $(CLEANOBJ) $(BIN) $(DEF) $(STATIC)"); + writeln(file, "\t${RM} $(CLEANOBJ) $(BIN) $(DEF) $(STATIC) > NUL 2>&1 "); else - writeln(file, "\t${RM} $(CLEANOBJ) $(BIN)"); + writeln(file, "\t${RM} $(CLEANOBJ) $(BIN) > NUL 2>&1 "); writeln(file); } @@ -465,7 +466,7 @@ bool ProjectCompiler::prepareForCompile() mArguments = QString("-f \"%1\" clean").arg(extractRelativePath( mProject->directory(), mProject->makeFileName())); - } if (mRebuild) { + } else if (mRebuild) { mArguments = QString("-f \"%1\" clean all").arg(extractRelativePath( mProject->directory(), mProject->makeFileName())); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 300df729..89568946 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -5695,16 +5695,6 @@ void MainWindow::on_actionProblem_triggered() showHideMessagesTab(ui->tabProblem,state); } - -void MainWindow::on_actionInsert_Line_triggered() -{ - Editor *e=mEditorList->getEditor(); - if (e) { - e->insertLine(); - } -} - - void MainWindow::on_actionDelete_Line_triggered() { Editor *e=mEditorList->getEditor(); diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 693299e8..4e0383b4 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -518,8 +518,6 @@ private slots: void on_actionProblem_triggered(); - void on_actionInsert_Line_triggered(); - void on_actionDelete_Line_triggered(); void on_actionDuplicate_Line_triggered();