add compiler set by executable

This commit is contained in:
Roy Qu 2024-03-27 23:43:51 +08:00
parent bca572b6f5
commit 9b0889f6c3
3 changed files with 4 additions and 4 deletions

View File

@ -2413,7 +2413,7 @@ void Settings::CompilerSet::setGCCProperties(const QString& binDir, const QStrin
#endif
}
}
}
}
// Set compiler folder
QDir tmpDir(binDir);
@ -3186,6 +3186,7 @@ bool Settings::CompilerSets::addSets(const QString &folder, const QString& c_pro
if (set->binDirs().contains(folder) && extractFileName(set->CCompiler())==c_prog)
return false;
}
qDebug()<<folder<<c_prog;
// Default, release profile
PCompilerSet baseSet = addSet(folder,c_prog);
if (!baseSet || baseSet->name().isEmpty())

View File

@ -1550,6 +1550,7 @@ public:
explicit CompilerSets(Settings* settings);
PCompilerSet addSet();
bool addSets(const QString& folder);
bool addSets(const QString& folder, const QString& c_prog);
CompilerSetList clearSets();
void findSets();
void saveSets();
@ -1571,7 +1572,6 @@ public:
PCompilerSet addSet(const QString& folder, const QString& c_prog);
PCompilerSet addSet(const PCompilerSet &pSet);
PCompilerSet addSet(const QJsonObject &set);
bool addSets(const QString& folder, const QString& c_prog);
void savePath(const QString& name, const QString& path);
void savePathList(const QString& name, const QStringList& pathList);

View File

@ -505,9 +505,8 @@ void CompilerSetOptionWidget::on_btnAddCompilerSetByFile_clicked()
return;
QFileInfo fileInfo(file);
if (!fileInfo.isExecutable())
return false;
if (!pSettings->compilerSets().addSets(fileInfo.absolutePath(), fileInfo.fileName()));
return;
pSettings->compilerSets().addSets(fileInfo.absolutePath(), fileInfo.fileName());
doLoad();
}