| 120 | } |
| 121 | |
| 122 | void 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 | |
| 157 | void CompilerSettings::deleteCompiler() { |
| 158 | if (QMessageBox::question(this, tr("LemonLime"), |
nothing calls this directly
no test coverage detected