| 68 | } |
| 69 | |
| 70 | void ChatConfigurationController::applyConfiguration(const QString &configName) |
| 71 | { |
| 72 | if (configName == QObject::tr("Current Settings")) { |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | auto &manager = Settings::ConfigurationManager::instance(); |
| 77 | QVector<Settings::AIConfiguration> configs = manager.configurations( |
| 78 | Settings::ConfigurationType::Chat); |
| 79 | |
| 80 | for (const Settings::AIConfiguration &config : configs) { |
| 81 | if (config.name == configName) { |
| 82 | auto &settings = Settings::generalSettings(); |
| 83 | |
| 84 | settings.caProvider.setValue(config.provider); |
| 85 | settings.caModel.setValue(config.model); |
| 86 | settings.caTemplate.setValue(config.templateName); |
| 87 | settings.caUrl.setValue(config.url); |
| 88 | settings.caCustomEndpoint.setValue(config.customEndpoint); |
| 89 | |
| 90 | settings.writeSettings(); |
| 91 | |
| 92 | m_currentConfiguration = QString("%1 - %2").arg(config.provider, config.model); |
| 93 | emit currentConfigurationChanged(); |
| 94 | |
| 95 | break; |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | } // namespace QodeAssist::Chat |
nothing calls this directly
no test coverage detected