MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / addCompiler

Method addCompiler

src/compilersettings.cpp:122–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void CompilerSettings::addCompiler() {
123 auto *wizard = new AddCompilerWizard(this);
124
125 if (wizard->exec() == QDialog::Accepted) {
126 QList<Compiler *> compilerList = editSettings->getCompilerList();
127 QStringList compilerNames;
128
129 for (auto &i : compilerList) {
130 compilerNames.append(i->getCompilerName());
131 }
132
133 compilerList = wizard->getCompilerList();
134
135 for (auto &i : compilerList) {
136 if (compilerNames.contains(i->getCompilerName())) {
137 int cnt = 2;
138 QString name = i->getCompilerName();
139
140 while (compilerNames.contains(QString("%1 (%2)").arg(name).arg(cnt))) {
141 cnt++;
142 }
143
144 i->setCompilerName(QString("%1 (%2)").arg(name).arg(cnt));
145 }
146
147 editSettings->addCompiler(i);
148 ui->compilerList->addItem(new QListWidgetItem(i->getCompilerName()));
149 ui->compilerList->setCurrentRow(ui->compilerList->count() - 1);
150 refreshItemState();
151 }
152 }
153
154 delete wizard;
155}
156
157void CompilerSettings::deleteCompiler() {
158 if (QMessageBox::question(this, tr("LemonLime"),

Callers

nothing calls this directly

Calls 4

getCompilerNameMethod · 0.80
setCompilerNameMethod · 0.80
addItemMethod · 0.80
getCompilerListMethod · 0.45

Tested by

no test coverage detected