diff --git a/NEWS.md b/NEWS.md index 44d691da..8c084257 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,7 @@ Version 0.7.3 - enhancement: when running a program, redirect a data file to its stdin - fix: can't correctly handle '&&' and '||' in the #if directive (and correctly parse windows.h header file) - fix: crash when create an empty project + - fix: syntax issues' filepath info not correct when build projects Version 0.7.2 - fix: rainbow parenthesis stop functioning when change editor's general options diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index 0f2c9f27..5aef3a4a 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -295,6 +295,8 @@ QString Compiler::getCCompileArguments(bool checkSyntax) value = pOption->value; } if (value > 0 && pOption->isC) { + if (checkSyntax && pOption->isLinker) + continue; if (pOption->choices.isEmpty()) { result += " " + pOption->setting; } else if (value < pOption->choices.size()) { @@ -342,6 +344,8 @@ QString Compiler::getCppCompileArguments(bool checkSyntax) value = pOption->value; } if (value > 0 && pOption->isCpp) { + if (checkSyntax && pOption->isLinker) + continue; if (pOption->choices.isEmpty()) { result += " " + pOption->setting; } else if (value < pOption->choices.size()) { diff --git a/RedPandaIDE/compiler/filecompiler.cpp b/RedPandaIDE/compiler/filecompiler.cpp index b487b245..e18e2a86 100644 --- a/RedPandaIDE/compiler/filecompiler.cpp +++ b/RedPandaIDE/compiler/filecompiler.cpp @@ -59,7 +59,8 @@ bool FileCompiler::prepareForCompile() throw CompileError(tr("Can't find the compiler for file %1").arg(mFilename)); } - mArguments += getLibraryArguments(fileType); + if (!mOnlyCheckSyntax) + mArguments += getLibraryArguments(fileType); if (!fileExists(mCompiler)) { throw CompileError(tr("The Compiler '%1' doesn't exists!").arg(mCompiler)); diff --git a/RedPandaIDE/compiler/stdincompiler.cpp b/RedPandaIDE/compiler/stdincompiler.cpp index ff7cb435..63e4dcbe 100644 --- a/RedPandaIDE/compiler/stdincompiler.cpp +++ b/RedPandaIDE/compiler/stdincompiler.cpp @@ -47,7 +47,8 @@ bool StdinCompiler::prepareForCompile() default: throw CompileError(tr("Can't find the compiler for file %1").arg(mFilename)); } - mArguments += getLibraryArguments(fileType); + if (!mOnlyCheckSyntax) + mArguments += getLibraryArguments(fileType); if (!fileExists(mCompiler)) { throw CompileError(tr("The Compiler '%1' doesn't exists!").arg(mCompiler)); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index b69387d8..4cf5341b 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -991,7 +991,7 @@ void MainWindow::checkSyntaxInBack(Editor *e) return; mCheckSyntaxInBack=true; - ui->tableIssues->clearIssues(); + clearIssues(); CompileTarget target =getCompileTarget(); if (target ==CompileTarget::Project) { mCompilerManager->checkSyntax(e->filename(),e->text(), @@ -1024,7 +1024,7 @@ bool MainWindow::compile(bool rebuild) if (e->inProject() && e->modified()) return false; } - ui->tableIssues->clearIssues(); + clearIssues(); // Increment build number automagically if (mProject->options().versionInfo.autoIncBuildNr) { @@ -1042,7 +1042,7 @@ bool MainWindow::compile(bool rebuild) } else { Editor * editor = mEditorList->getEditor(); if (editor != NULL ) { - ui->tableIssues->clearIssues(); + clearIssues(); if (editor->modified()) { if (!editor->save(false,false)) return false; @@ -1871,7 +1871,7 @@ void MainWindow::buildContextMenus() ui->tableIssues); connect(mTableIssuesClearAction,&QAction::triggered, [this](){ - ui->tableIssues->clearIssues(); + clearIssues(); }); //context menu signal for search view @@ -2755,7 +2755,7 @@ void MainWindow::closeProject(bool refreshEditor) } if (!mQuitting) { // Clear error browser - ui->tableIssues->clearIssues(); + clearIssues(); updateProjectView(); } } @@ -4491,6 +4491,15 @@ void MainWindow::setFilesViewRoot(const QString &path) ui->txtFilesPath->setCursorPosition(1); } +void MainWindow::clearIssues() +{ + int i = ui->tabMessages->indexOf(ui->tabIssues); + if (i!=-1) { + ui->tabMessages->setTabText(i, tr("Issues")); + } + ui->tableIssues->clearIssues(); +} + Ui::MainWindow *MainWindow::mainWidget() const { return ui; diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index b4532e6d..3a3606ab 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -195,6 +195,7 @@ private: void includeOrSkipDirs(const QStringList& dirs, bool skip); void showSearchReplacePanel(bool show); void setFilesViewRoot(const QString& path); + void clearIssues(); private slots: void onAutoSaveTimeout();