MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / selection

Method selection

src/subprojects/AutoEqIntegration/AeqSelector.cpp:214–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214QString AeqSelector::selection(DataFormat format, bool silent)
215{
216 if (ui->list->selectionModel()->selectedRows().isEmpty())
217 {
218 return QString();
219 }
220
221 auto item = proxyModel->data(ui->list->selectionModel()->selectedRows().first(), Qt::UserRole).value<AeqMeasurement>();
222
223 QString name;
224 switch(format)
225 {
226 case AeqSelector::dGraphicEq:
227 name = "graphic.txt";
228 break;
229 case AeqSelector::dCsv:
230 name = "raw.csv";
231 break;
232 }
233
234 QFile file(item.path(pkgManager->databaseDirectory(), name));
235 if(!file.exists())
236 {
237 if(!silent)
238 {
239 QMessageBox::critical(this, tr("Error"), tr("Unable to retrieve corresponding file from database. Please update the local database as it appears to be incomplete."));
240 }
241 return QString();
242 }
243
244 auto guard = qScopeGuard([&]{ file.close(); });
245 file.open(QFile::ReadOnly);
246 return file.readAll();
247}

Callers 3

onSelectionChangedMethod · 0.95
onDarkModeToggledMethod · 0.80

Calls 6

databaseDirectoryMethod · 0.80
QStringClass · 0.50
isEmptyMethod · 0.45
dataMethod · 0.45
pathMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected