From 07f6b975f1c815cce48b34f979920806e64f5552 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 16 Dec 2022 16:36:59 +0800 Subject: [PATCH] fix: auto find compilers failed. --- RedPandaIDE/settings.cpp | 12 ++++++------ RedPandaIDE/settings.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 4651e075..4211f4a9 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -1599,7 +1599,7 @@ Settings::CompilerSet::CompilerSet(const QString& compilerFolder, const QString& QDir dir(compilerFolder); if (dir.exists(c_prog)) { - setProperties(dir.absoluteFilePath(c_prog)); + setProperties(compilerFolder,c_prog); //manually set the directories setDirectories(compilerFolder, mCompilerType); @@ -2092,15 +2092,15 @@ static void addExistingDirectory(QStringList& dirs, const QString& directory) { dirs.append(dirPath); } -void Settings::CompilerSet::setProperties(const QString& c_prog) +void Settings::CompilerSet::setProperties(const QString& binDir, const QString& c_prog) { - if (!fileExists(c_prog)) - return; - QString binDir=extractFileDir(c_prog); + // We have tested before the call +// if (!fileExists(c_prog)) +// return; // Obtain version number and compiler distro etc QStringList arguments; arguments.append("-v"); - QByteArray output = getCompilerOutput(binDir,c_prog,arguments); + QByteArray output = getCompilerOutput(binDir, c_prog,arguments); //Target QByteArray targetStr = "Target: "; diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index 827010f2..3dc07c2f 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -1246,7 +1246,7 @@ public: CompilerSet& operator= (const CompilerSet&& ) = delete; // Initialization - void setProperties(const QString& c_prog); + void setProperties(const QString& binDir, const QString& c_prog); void resetCompileOptionts(); bool setCompileOption(const QString& key, int valIndex);