diff --git a/RedPandaIDE/compiler/filecompiler.cpp b/RedPandaIDE/compiler/filecompiler.cpp index 63972d6e..ca9b723b 100644 --- a/RedPandaIDE/compiler/filecompiler.cpp +++ b/RedPandaIDE/compiler/filecompiler.cpp @@ -84,7 +84,7 @@ bool FileCompiler::prepareForRebuild() QString exeName = getCompiledExecutableName(mFilename); QFile file(exeName); - if (!file.remove()) { + if (file.exists() && !file.remove()) { QFileInfo info(exeName); throw CompileError(tr("Can't delete the old executable file \"%1\".\n").arg(info.absoluteFilePath())); } diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 2c2e0d9c..65f53582 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1497,9 +1497,12 @@ void MainWindow::onCompileFinished() for (int i=0;itableIssues->count();i++) { PCompileIssue issue = ui->tableIssues->issue(i); if (issue->type == CompileIssueType::Error) { + if (e && e->filename() != issue->filename) + continue; ui->tableIssues->selectRow(i); QModelIndex index =ui->tableIssues->model()->index(i,0); emit ui->tableIssues->doubleClicked(index); + break; } } @@ -1507,6 +1510,8 @@ void MainWindow::onCompileFinished() for (int i=0;itableIssues->count();i++) { PCompileIssue issue = ui->tableIssues->issue(i); if (issue->type == CompileIssueType::Warning) { + if (e && e->filename() != issue->filename) + continue; ui->tableIssues->selectRow(i); QModelIndex index =ui->tableIssues->model()->index(i,0); emit ui->tableIssues->doubleClicked(index);