| 1064 | } |
| 1065 | |
| 1066 | void MainWindow::onVdcDatabaseSelected(const QItemSelection &, const QItemSelection &) { |
| 1067 | QItemSelectionModel *select = ui->ddcTable->selectionModel(); |
| 1068 | |
| 1069 | if (select->hasSelection()) |
| 1070 | { |
| 1071 | ui->ddc_files->clearCurrentFile(); |
| 1072 | |
| 1073 | int index = select->selectedRows().first().row(); |
| 1074 | auto* model = static_cast<VdcDatabaseModel*>(ui->ddcTable->model()); |
| 1075 | |
| 1076 | QFile file(AppConfig::instance().getPath("temp.vdc")); |
| 1077 | if (file.open(QIODevice::WriteOnly | QIODevice::Text)) |
| 1078 | { |
| 1079 | file.write(model->composeVdcFile(index).toUtf8().constData()); |
| 1080 | } |
| 1081 | file.close(); |
| 1082 | |
| 1083 | auto newId = model->id(index); |
| 1084 | if (newId != "0") |
| 1085 | { |
| 1086 | AppConfig::instance().set(AppConfig::VdcLastDatabaseId, newId); |
| 1087 | } |
| 1088 | |
| 1089 | /* Workaround: Load different file to make sure the config parser notices a change and reloads the DDC engine */ |
| 1090 | DspConfig::instance().set(DspConfig::ddc_file, ""); |
| 1091 | DspConfig::instance().commit(); |
| 1092 | |
| 1093 | _currentVdc = AppConfig::instance().getPath("temp.vdc"); |
| 1094 | } |
| 1095 | |
| 1096 | applyConfig(); |
| 1097 | } |
| 1098 | |
| 1099 | // IRS |
| 1100 | void MainWindow::setIrsFile(const QString& path) |
nothing calls this directly
no test coverage detected